Shader/SpirV: Fix sampler storage class

This commit is contained in:
Lynix 2020-09-22 21:50:56 +02:00
parent 79c53061e0
commit d665af1f9d
1 changed files with 2 additions and 2 deletions

View File

@ -238,7 +238,7 @@ namespace Nz
RegisterPointerType(output.type, SpirvStorageClass::Output);
for (const auto& uniform : shader.GetUniforms())
RegisterPointerType(uniform.type, SpirvStorageClass::Uniform);
RegisterPointerType(uniform.type, (IsSamplerType(uniform.type)) ? SpirvStorageClass::UniformConstant : SpirvStorageClass::Uniform);
for (const auto& func : shader.GetFunctions())
RegisterFunctionType(func.returnType, func.parameters);
@ -330,7 +330,7 @@ namespace Nz
{
SpirvConstantCache::Variable variable;
variable.debugName = uniform.name;
variable.storageClass = SpirvStorageClass::Uniform;
variable.storageClass = (IsSamplerType(uniform.type)) ? SpirvStorageClass::UniformConstant : SpirvStorageClass::Uniform;
variable.type = SpirvConstantCache::BuildPointerType(shader, uniform.type, variable.storageClass);
UInt32 varId = m_currentState->constantTypeCache.Register(variable);