ソースを参照

vulkan: Fix resource in first struct param not getting decorated

rdb 5 日 前
コミット
5e3d1c16fc
1 ファイル変更3 行追加3 行削除
  1. 3 3
      panda/src/vulkandisplay/vulkanShaderContext.cxx

+ 3 - 3
panda/src/vulkandisplay/vulkanShaderContext.cxx

@@ -253,7 +253,7 @@ create_modules(VkDevice device, const ShaderType::Struct *push_constant_block_ty
         AccessChain chain = tattr_set_params[i];
         if (chain.size() > 0) {
           int index = spv_module->find_parameter(_shader->_parameters[chain._var_id]._name);
-          if (index > 0) {
+          if (index >= 0) {
             chain._var_id = spv_module->get_parameter(index).id;
             auto it = hoist_pass._hoisted_vars.find(chain);
             if (it != hoist_pass._hoisted_vars.end()) {
@@ -269,7 +269,7 @@ create_modules(VkDevice device, const ShaderType::Struct *push_constant_block_ty
         AccessChain chain = lattr_set_params[i];
         if (chain.size() > 0) {
           int index = spv_module->find_parameter(_shader->_parameters[chain._var_id]._name);
-          if (index > 0) {
+          if (index >= 0) {
             chain._var_id = spv_module->get_parameter(index).id;
             auto it = hoist_pass._hoisted_vars.find(chain);
             if (it != hoist_pass._hoisted_vars.end()) {
@@ -285,7 +285,7 @@ create_modules(VkDevice device, const ShaderType::Struct *push_constant_block_ty
         AccessChain chain = sattr_set_params[i];
         if (chain.size() > 0) {
           int index = spv_module->find_parameter(_shader->_parameters[chain._var_id]._name);
-          if (index > 0) {
+          if (index >= 0) {
             chain._var_id = spv_module->get_parameter(index).id;
             auto it = hoist_pass._hoisted_vars.find(chain);
             if (it != hoist_pass._hoisted_vars.end()) {