This is the first step of moving the create infos
back inside shader sources.
All info files are now treated as source files.
However, they are not considered in the include tree
yet. This will come in another following PR.
Each shader source file now generate a `.info` file
containing only the create info declarations.
This renames all info files so that they do not
conflict with their previous versions that were
copied (non-generated).
Pull Request: https://projects.blender.org/blender/blender/pulls/146676
Currently for the result of GPU subdivision, normals are stored in two
places. First, interleaved with the positions, and second, in a separate
"lnor" vertex buffer. This extra duplication costs 12 bytes of GPU
memory usage per subdivided face corner, which is quite a lot. It also
causes problems because it's inconsistent with the format used for
regular non-subdivided meshes, causing various hacks and issues
throughout the code.
This PR moves the normals into just the "lnor" vertex buffer. This
starts some code simplifications, but ends up still more complicated
than I'd like because some edit selection flags are still stored in the
fourth component of the normal vector. Tacking that makes this PR too
big, but it would be a good next step.
Pull Request: https://projects.blender.org/blender/blender/pulls/137158
This unify the C++ and GLSL codebase style.
The GLSL types are still in the backend compatibility
layers to support python shaders. However, the C++
shader compilation layer doesn't have them to enforce
correct type usage.
Note that this is going to break pretty much all PRs
in flight that targets shader code.
Rel #137261
Pull Request: https://projects.blender.org/blender/blender/pulls/137369
They are actually already some literals with the `f` suffix
that are in our shader codebase and we never had problem in
the past 5 years (or even 8 years).
So I think it is safe to do and improves convergence of codestyles.
Pull Request: https://projects.blender.org/blender/blender/pulls/137352
GPU subdivision shaders can read out of bound when evaluating
the last face. This seems to be always been the case, but Metal + Vulkan
has validation to detect these mis-usages.
Binary search was initialized with out of bound values so the last
face could select out of bound index due to rounding.
Pull Request: https://projects.blender.org/blender/blender/pulls/136242
This PR migrates the subdiv_patch_evaluation_comp.glsl to use
shader create info.
The part of OSD that is used is included as a typedef source (osd_patch_basis.glsl).
Pull Request: https://projects.blender.org/blender/blender/pulls/134917
This PR migrates the custom_data_interp_comp.glsl to use
shader create info.
During development tests have been conducted to use specialization constants,
but due to limitations inside Metal we didn't use them.
Number of ShaderCreateInfos have been reduced by using macros. Variadic macros
have not been used as they don't support CPP compilation.
Pull Request: https://projects.blender.org/blender/blender/pulls/134932
Subdiv shader library contains an optional part that shaders can include.
As we are migrating each shader at a time there are now multiple PRs doing
the same thing. Best to add the changes to main already so it doesn't add
confusion during review.
Pull Request: https://projects.blender.org/blender/blender/pulls/134906
This change migrates the first 2 subdiv shaders to use the ShaderCreateInfo.
Other shaders will follow in separate PRs.
- Should compile when using `WITH_GPU_SHADER_CPP_COMPILATION`
- A `subdiv_` prefix is added only to the functions related to `PosNorLoop`.
But eventually the prefix should also be added to other lib functions.
- Due to Metal restrictions `subdiv_set_vertex_*` is implemented using a
functional paradigma. Our Metal backend only supports `inout` qualifier
on thead local data structures.
Pull Request: https://projects.blender.org/blender/blender/pulls/134218