浏览代码

shaderpipeline: Fix DX9 test failure with regular sampler array

rdb 1 年之前
父节点
当前提交
201ef43ed5
共有 1 个文件被更改,包括 6 次插入0 次删除
  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;