From 7b35bc8486edb3605876e16ee794bee8c7077bcf Mon Sep 17 00:00:00 2001 From: assiduous Date: Mon, 1 Mar 2021 21:32:11 -0800 Subject: RunTimeResourceArray: added constant buffers --- .../GraphicsEngineD3DBase/include/D3DShaderResourceLoader.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Graphics/GraphicsEngineD3DBase') diff --git a/Graphics/GraphicsEngineD3DBase/include/D3DShaderResourceLoader.hpp b/Graphics/GraphicsEngineD3DBase/include/D3DShaderResourceLoader.hpp index 1bd4678d..d5cf7e6e 100644 --- a/Graphics/GraphicsEngineD3DBase/include/D3DShaderResourceLoader.hpp +++ b/Graphics/GraphicsEngineD3DBase/include/D3DShaderResourceLoader.hpp @@ -102,6 +102,15 @@ void LoadD3DShaderResources(TShaderReflection* pShaderReflection, SkipCount = 1; UINT BindCount = BindingDesc.BindCount; + if (BindCount == UINT_MAX) + { + // For some reason + // Texture2D g_Textures[] + // produces BindCount == 0, but + // ConstantBuffer g_ConstantBuffers[] + // produces BindCount == UINT_MAX + BindCount = 0; + } // Handle arrays // For shader models 5_0 and before, every resource array element is enumerated individually. -- cgit v1.2.3