GPU: Refactor texture samplers #105642

Merged
Omar Emara merged 9 commits from OmarEmaraDev/blender:texture-sampler-refactor into main 2023-04-04 15:16:20 +02:00

9 Commits

Author SHA1 Message Date
Omar Emara 0115902b4f Resolve conflicts
buildbot/vexp-code-patch-coordinator Build done. Details
2023-04-04 13:01:18 +02:00
Omar Emara 80adda5d4b Merge branch 'main' into texture-sampler-refactor 2023-04-04 12:58:48 +02:00
Omar Emara 5d72104f12 Address review comments 2023-03-21 15:11:19 +02:00
Omar Emara 60122cd245 Address review comments 2023-03-13 10:54:08 +02:00
Omar Emara 2ab1ad367f Document sampler presets and rename filtering methods 2023-03-12 16:47:32 +02:00
Omar Emara 08890d9dd8 Address review comments 2023-03-11 21:26:49 +02:00
Omar Emara 532e781fff Fix more Metal compile errors
buildbot/vexp-code-patch-coordinator Build done. Details
2023-03-11 18:54:25 +02:00
Omar Emara 0d4a76e8fa Fix Metal compile errors
buildbot/vexp-code-patch-coordinator Build done. Details
2023-03-11 18:45:22 +02:00
Omar Emara a6b32fb8df GPU: Refactor texture samplers
buildbot/vexp-code-patch-coordinator Build done. Details
This patch refactors the texture samples code by mainly splitting the
eGPUSamplerState enum into multiple smaller enums and packing them
inside a GPUSamplerState struct. This was done because many members of
the enum were mutually exclusive, which was worked around during setting
up the samplers in the various backends, and additionally made the API
confusing, like the GPU_texture_wrap_mode function, which had two
mutually exclusive parameters.

The new structure also improved and clarified the backend sampler cache,
reducing the cache size from 514 samplers to just 130 samplers, which
also slightly improved the initialization time. Further, the
GPU_SAMPLER_MAX signal value was naturally incorporated into the
structure using the GPU_SAMPLER_STATE_TYPE_INTERNAL type.

The only expected functional change is in the realtime compositor, which
now supports per-axis repetition control, utilizing new API functions
for that purpose.

This patch is loosely based on an older patch D14366 by Ethan Hall.
2023-03-10 20:18:09 +02:00