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:
committed by
Philipp Oeser
parent
797ee63c70
commit
bbb9b1fb04
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user