diff --git a/src/dxvk/dxvk_shader.cpp b/src/dxvk/dxvk_shader.cpp index 55af858d..c597240b 100644 --- a/src/dxvk/dxvk_shader.cpp +++ b/src/dxvk/dxvk_shader.cpp @@ -132,8 +132,10 @@ namespace dxvk { // Remap resource binding IDs uint32_t* code = spirvCode.data(); - for (uint32_t ofs : m_idOffsets) - code[ofs] = mapping.getBindingId(code[ofs]); + for (uint32_t ofs : m_idOffsets) { + if (code[ofs] < MaxNumResourceSlots) + code[ofs] = mapping.getBindingId(code[ofs]); + } return new DxvkShaderModule(vkd, this, spirvCode); } diff --git a/src/dxvk/dxvk_shader.h b/src/dxvk/dxvk_shader.h index fd515545..e204ebc9 100644 --- a/src/dxvk/dxvk_shader.h +++ b/src/dxvk/dxvk_shader.h @@ -3,6 +3,7 @@ #include #include "dxvk_include.h" +#include "dxvk_limits.h" #include "dxvk_pipelayout.h" #include "../spirv/spirv_code_buffer.h"