File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4042,16 +4042,22 @@ int MOJOSHADER_linkSPIRVShaders(const MOJOSHADER_parseData *vertex_spirv,
40424042 uint32 typeDeclOffset = vTable -> attrib_type_offsets [element -> usage ][element -> usageIndex ];
40434043 if (typeDeclOffset > 0 ) // Vertex attribs passed may not exist in the vertex shader
40444044 {
4045+ ((uint32 * )vertex_spirv -> output )[typeDeclOffset ] = typeDecl ;
40454046 for (uint32 j = 0 ; j < vTable -> attrib_type_load_offsets [element -> usage ][element -> usageIndex ].num_loads ; j += 1 )
40464047 {
4048+
40474049 uint32 typeLoadOffset = vTable -> attrib_type_load_offsets [element -> usage ][element -> usageIndex ].load_types [j ];
40484050 uint32 opcodeLoadOffset = vTable -> attrib_type_load_offsets [element -> usage ][element -> usageIndex ].load_opcodes [j ];
4049- uint32 * ptr_to_opcode_u32 = & ((uint32 * )vertex_spirv -> output )[opcodeLoadOffset ];
4050- ((uint32 * )vertex_spirv -> output )[typeLoadOffset ] = typeLoad ;
4051- * ptr_to_opcode_u32 = (* ptr_to_opcode_u32 & 0xFFFF0000 ) | opcodeLoad ;
4052- }
4053- }
4054- }
4051+ if (typeLoadOffset > 0 )
4052+ ((uint32 * )vertex_spirv -> output )[typeLoadOffset ] = typeLoad ;
4053+ if (opcodeLoadOffset > 0 )
4054+ {
4055+ uint32 * ptr_to_opcode_u32 = & ((uint32 * )vertex_spirv -> output )[opcodeLoadOffset ];
4056+ * ptr_to_opcode_u32 = (* ptr_to_opcode_u32 & 0xFFFF0000 ) | opcodeLoad ;
4057+ } // if
4058+ } // for
4059+ } // if
4060+ } // if
40554061
40564062 MOJOSHADER_spirv_link_attributes (vertex_spirv , pixel_spirv , 0 );
40574063 return sizeof (SpirvPatchTable );
You can’t perform that action at this time.
0 commit comments