Browse Source

shaderpipeline: Fix DX9 test failure with regular sampler array

rdb 1 year ago
parent
commit
201ef43ed5
1 changed files with 6 additions and 0 deletions
  1. 6 0
      panda/src/shaderpipeline/spirVHoistStructResourcesPass.cxx

+ 6 - 0
panda/src/shaderpipeline/spirVHoistStructResourcesPass.cxx

@@ -286,6 +286,12 @@ transform_function_op(Instruction op, uint32_t function_id) {
           }
         }
 
+        if (access_chain.size() == 0) {
+          // There are no structs involved, this is probably just an array of
+          // samplers.  No need to hoist.
+          return true;
+        }
+
         auto hit = _hoisted_vars.find(access_chain);
         nassertr(hit != _hoisted_vars.end(), false);
         uint32_t new_var_id = hit->second;