Commit Graph

8 Commits

Author SHA1 Message Date
Hans Goudey
91627b3d47 GPU: Remove int float fetch mode combination
This commit finishes removing the uses of the integer to float
vertex buffer fetch mode. Previous commits noted below already started
that process. The last usage was geometry attributes. Now integers are
converted to floats as part of the existing upload process.

The change makes the Vulkan vertex buffer type conversion unused, so
it's removed. That's nice because Vulkan vertex buffers go from 1040 to
568 bytes in size and have significantly less overhead on creation.

Related:
- 153abc372e
- 1e1ac2bb9b
- 617858e453

Pull Request: https://projects.blender.org/blender/blender/pulls/138873
2025-05-15 15:29:12 +02:00
Clément Foucault
5fc8d4f759 Fix: GPU: Broken tests
These tests were hitting an assert about
invalid format. They were testing for this
legacy format we don't support anymore.

# Conflicts:
#	source/blender/gpu/vulkan/tests/vk_data_conversion_test.cc
2025-05-13 19:50:49 +02:00
Hans Goudey
1e1ac2bb9b Fix: Various asserts when creating GPU vertex formats
Caused by 617858e453.

These formats should use types aligned to 4 bytes. That's generally
required by modern GPUs. Uploading with these types also avoids
automatic conversion by the Vulkan backend which is something
we're hoping to remove fully.

In the end this PR removes a bunch of code related to supporting
the older single-byte formats.

Pull Request: https://projects.blender.org/blender/blender/pulls/138836
2025-05-13 19:07:01 +02:00
Clément Foucault
9990273d04 GPU: Change Type enum to use lower case values
This is to help for future resource declaration
using macros.

Rel #137261

Pull Request: https://projects.blender.org/blender/blender/pulls/137367
2025-04-11 22:39:01 +02:00
Jeroen Bakker
4dbb9b34c6 Fix: Vulkan: Compositor cryptomatte
When using cryptomatte the last identifier was never used due to a
memory alignment issue. Scalar types should not be aligned, but they
were.

Pull Request: https://projects.blender.org/blender/blender/pulls/133815
2025-01-30 15:51:09 +01:00
Aras Pranckevicius
c6f5c89669 BLI: faster float<->half array conversions, use in Vulkan
In addition to float<->half functions to convert one number (#127708), add
float_to_half_array and half_to_float_array functions:
- On x64, this uses SSE2 4-wide implementation to do the conversion
  (2x faster half->float, 4x faster float->half compared to scalar),
  - There's also an AVX2 codepath that uses CPU hardware F16C instructions
    (8-wide), to be used when/if blender codebase will start to be built
    for AVX2 (today it is not yet).
- On arm64, this uses NEON VCVT instructions to do the conversion.

Use these functions in Vulkan buffer/texture conversion code. Time taken to
convert float->half texture while viewing EXR file in image space (22M
numbers to convert): 39.7ms -> 10.1ms (would be 6.9ms if building for AVX2)

Pull Request: https://projects.blender.org/blender/blender/pulls/127838
2024-09-22 17:39:54 +02:00
Jeroen Bakker
994e05accd Vulkan: Encoding of Mat3 in Std430 struct
The encoding of mat3 in std430 was incorrect leading to a drawing
artifact in the direction control of sunlight in sky textures.

The error was that every 3 floats requires an additional float
as each row of the mat3 is aligned to 16 bytes.

Pull Request: https://projects.blender.org/blender/blender/pulls/127246
2024-09-09 12:44:22 +02:00
Jeroen Bakker
189113c727 Cleanup: Move vulkan specific tests in tests folder
When reviewing the render graph core PR, we discussed where specific
backend tests should be located. The code style is clear that it
needs to be located in a tests folder next to the code it tests.

This PR moved the tests folder from next to the files they test to
a tests folder.

Pull Request: https://projects.blender.org/blender/blender/pulls/120777
2024-04-18 12:47:23 +02:00