GPU: Avoid assert caused by overlapping attribute in material shaders

This was caused by `drw_ResourceID` taking one vertex input
(at slot 15) which was then also used by material shaders.

Starting material shaders at 14 in this case avoid the overlap.

Note that this reduces the amount of supported attribute when
using the workarounds by one.
This commit is contained in:
Clément Foucault
2024-11-06 13:03:24 +01:00
committed by Philipp Oeser
parent 797ee63c70
commit bbb9b1fb04
+1 -1
View File
@@ -342,7 +342,7 @@ void GPUCodegen::generate_attribs()
/* Input declaration, loading / assignment to interface and geometry shader passthrough. */
std::stringstream load_ss;
int slot = 15;
int slot = GPU_shader_draw_parameters_support() ? 15 : 14;
LISTBASE_FOREACH (GPUMaterialAttribute *, attr, &graph.attributes) {
if (slot == -1) {
BLI_assert_msg(0, "Too many attributes");