summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/include/ShaderResourceVariableBase.hpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/Graphics/GraphicsEngine/include/ShaderResourceVariableBase.hpp b/Graphics/GraphicsEngine/include/ShaderResourceVariableBase.hpp
index dbd7fb46..eada5264 100644
--- a/Graphics/GraphicsEngine/include/ShaderResourceVariableBase.hpp
+++ b/Graphics/GraphicsEngine/include/ShaderResourceVariableBase.hpp
@@ -122,15 +122,22 @@ inline Uint32 GetAllowedTypeBits(const SHADER_RESOURCE_VARIABLE_TYPE* AllowedVar
inline Int32 FindImmutableSampler(const ImmutableSamplerDesc* ImtblSamplers,
Uint32 NumImtblSamplers,
- SHADER_TYPE ShaderType,
+ SHADER_TYPE ShaderStages,
const char* ResourceName,
const char* SamplerSuffix)
{
for (Uint32 s = 0; s < NumImtblSamplers; ++s)
{
const auto& Sam = ImtblSamplers[s];
- if (((Sam.ShaderStages & ShaderType) != 0) && StreqSuff(ResourceName, Sam.SamplerOrTextureName, SamplerSuffix))
+ if (((Sam.ShaderStages & ShaderStages) != 0) && StreqSuff(ResourceName, Sam.SamplerOrTextureName, SamplerSuffix))
+ {
+ DEV_CHECK_ERR((Sam.ShaderStages & ShaderStages) == ShaderStages,
+ "Resource '", ResourceName, "' is defined for the following shader stages: ", GetShaderStagesString(ShaderStages),
+ ", but immutable sampler '", Sam.SamplerOrTextureName, "' specifes only some of these stages: ", GetShaderStagesString(Sam.ShaderStages),
+ ". A resource that is present in multiple shader stages can't use different immutable samples in different stages. "
+ "Either use separate resources for different stages, or define the immutable sample for all stages that the resource uses.");
return s;
+ }
}
return -1;