From 90c10ea1fc189fddf4269b8f75d890b4e546b4e4 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 7 May 2020 16:42:35 +0100 Subject: [PATCH] Handle boolean inputs in vulkan shader parameters * We change to use VarType instead of CompType for signature parameters which allows us to represent different types of variables beyond just unsigned/signed integer and float. --- qrenderdoc/Code/BufferFormatter.cpp | 17 +---- qrenderdoc/Code/QRDUtils.cpp | 17 +---- qrenderdoc/Windows/BufferViewer.cpp | 2 +- .../D3D11PipelineStateViewer.cpp | 6 +- .../PipelineState/GLPipelineStateViewer.cpp | 2 +- renderdoc/api/replay/pipestate.inl | 14 ++-- renderdoc/api/replay/replay_enums.h | 25 +++++++ renderdoc/api/replay/shader_types.h | 10 +-- renderdoc/data/glsl_shaders.cpp | 74 +++++++++---------- renderdoc/driver/d3d11/d3d11_shaderdebug.cpp | 4 +- renderdoc/driver/d3d12/d3d12_shaderdebug.cpp | 4 +- renderdoc/driver/gl/gl_postvs.cpp | 2 +- renderdoc/driver/gl/gl_shader_refl.cpp | 16 ++-- .../driver/shaders/dxbc/dxbc_container.cpp | 6 +- renderdoc/driver/shaders/dxbc/dxbc_debug.cpp | 38 ++++------ .../driver/shaders/dxbc/dxbc_disassemble.cpp | 2 +- .../driver/shaders/spirv/spirv_processor.cpp | 20 +++++ .../driver/shaders/spirv/spirv_processor.h | 2 + .../driver/shaders/spirv/spirv_reflect.cpp | 20 +---- renderdoc/driver/vulkan/vk_postvs.cpp | 44 +++-------- renderdoc/driver/vulkan/vk_shaderdebug.cpp | 54 +++++++++----- renderdoc/replay/renderdoc_serialise.inl | 2 +- util/test/demos/vk/vk_shader_debug_zoo.cpp | 5 ++ 23 files changed, 186 insertions(+), 200 deletions(-) diff --git a/qrenderdoc/Code/BufferFormatter.cpp b/qrenderdoc/Code/BufferFormatter.cpp index a4dda29df..c03ac93b1 100644 --- a/qrenderdoc/Code/BufferFormatter.cpp +++ b/qrenderdoc/Code/BufferFormatter.cpp @@ -899,22 +899,7 @@ ResourceFormat GetInterpretedResourceFormat(const ShaderConstant &elem) ResourceFormat format; format.type = interpretType; - switch(elem.type.descriptor.type) - { - case VarType::Half: - case VarType::Float: format.compType = CompType::Float; break; - case VarType::Double: format.compType = CompType::Double; break; - case VarType::SInt: - case VarType::SShort: - case VarType::SLong: - case VarType::SByte: format.compType = CompType::SInt; break; - case VarType::Bool: - case VarType::UInt: - case VarType::UShort: - case VarType::ULong: - case VarType::UByte: format.compType = CompType::UInt; break; - default: format.compType = CompType::UInt; break; - } + format.compType = VarTypeCompType(elem.type.descriptor.type); if(interpretCompType != CompType::Typeless) format.compType = interpretCompType; diff --git a/qrenderdoc/Code/QRDUtils.cpp b/qrenderdoc/Code/QRDUtils.cpp index d579b9e33..3681401f4 100644 --- a/qrenderdoc/Code/QRDUtils.cpp +++ b/qrenderdoc/Code/QRDUtils.cpp @@ -1140,22 +1140,7 @@ QString ToQStr(const AddressMode addr, const GraphicsAPI apitype) QString TypeString(const SigParameter &sig) { - QString ret = lit(""); - - if(sig.compType == CompType::Float) - ret += lit("float"); - else if(sig.compType == CompType::UInt || sig.compType == CompType::UScaled) - ret += lit("uint"); - else if(sig.compType == CompType::SInt || sig.compType == CompType::SScaled) - ret += lit("int"); - else if(sig.compType == CompType::UNorm || sig.compType == CompType::UNormSRGB) - ret += lit("unorm float"); - else if(sig.compType == CompType::SNorm) - ret += lit("snorm float"); - else if(sig.compType == CompType::Depth) - ret += lit("float"); - else if(sig.compType == CompType::Double) - ret += lit("double"); + QString ret = ToQStr(sig.varType); if(sig.compCount > 1) ret += QString::number(sig.compCount); diff --git a/qrenderdoc/Windows/BufferViewer.cpp b/qrenderdoc/Windows/BufferViewer.cpp index 2381f86af..7d59e69c6 100644 --- a/qrenderdoc/Windows/BufferViewer.cpp +++ b/qrenderdoc/Windows/BufferViewer.cpp @@ -1415,7 +1415,7 @@ static void ConfigureColumnsForShader(ICaptureContext &ctx, const ShaderReflecti p.format.type = ResourceFormatType::Regular; p.format.compByteWidth = sizeof(float); p.format.compCount = sig.compCount; - p.format.compType = sig.compType; + p.format.compType = VarTypeCompType(sig.varType); if(sig.systemValue == ShaderBuiltin::Position) posidx = i; diff --git a/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp index 62a3dd992..bd6038fce 100644 --- a/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp @@ -1260,14 +1260,14 @@ void D3D11PipelineStateViewer::setState() .arg(VS[i].compCount); // VS wants different types - if(IA[i].compType != VS[i].compType) + if(IA[i].varType != VS[i].varType) mismatchDetails += tr("IA bytecode semantic %1 (%2) is %4).arg(VS bytecode semantic %1 (%3) is %5\n") .arg(i) .arg(IAname) .arg(VSname) - .arg(ToQStr(IA[i].compType)) - .arg(ToQStr(VS[i].compType)); + .arg(ToQStr(IA[i].varType)) + .arg(ToQStr(VS[i].varType)); } } diff --git a/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp index 92d8c4c3e..9c2dfe6a1 100644 --- a/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp @@ -1267,7 +1267,7 @@ void GLPipelineStateViewer::setState() { name = state.vertexShader.reflection->inputSignature[attrib].varName; compCount = state.vertexShader.reflection->inputSignature[attrib].compCount; - compType = state.vertexShader.reflection->inputSignature[attrib].compType; + compType = VarTypeCompType(state.vertexShader.reflection->inputSignature[attrib].varType); usedSlot = true; } } diff --git a/renderdoc/api/replay/pipestate.inl b/renderdoc/api/replay/pipestate.inl index 160a0de5c..998dbcd46 100644 --- a/renderdoc/api/replay/pipestate.inl +++ b/renderdoc/api/replay/pipestate.inl @@ -789,20 +789,16 @@ rdcarray PipeState::GetVertexInputs() const if(!attrs[i].enabled) { uint32_t compCount = m_GL->vertexShader.reflection->inputSignature[attrib].compCount; - CompType compType = m_GL->vertexShader.reflection->inputSignature[attrib].compType; + VarType varType = m_GL->vertexShader.reflection->inputSignature[attrib].varType; for(uint32_t c = 0; c < compCount; c++) { - if(compType == CompType::Float) + if(varType == VarType::Float) ret[a].genericValue.floatValue[c] = attrs[i].genericValue.floatValue[c]; - else if(compType == CompType::UInt) + else if(varType == VarType::UInt) ret[a].genericValue.uintValue[c] = attrs[i].genericValue.uintValue[c]; - else if(compType == CompType::SInt) + else if(varType == VarType::SInt) ret[a].genericValue.intValue[c] = attrs[i].genericValue.intValue[c]; - else if(compType == CompType::UScaled) - ret[a].genericValue.floatValue[c] = (float)attrs[i].genericValue.uintValue[c]; - else if(compType == CompType::SScaled) - ret[a].genericValue.floatValue[c] = (float)attrs[i].genericValue.intValue[c]; } ret[a].genericEnabled = true; @@ -811,7 +807,7 @@ rdcarray PipeState::GetVertexInputs() const ret[a].instanceRate = 0; ret[a].format.compByteWidth = 4; ret[a].format.compCount = (uint8_t)compCount; - ret[a].format.compType = compType; + ret[a].format.compType = VarTypeCompType(varType); ret[a].format.type = ResourceFormatType::Regular; } } diff --git a/renderdoc/api/replay/replay_enums.h b/renderdoc/api/replay/replay_enums.h index 8375d2940..9e2de2042 100644 --- a/renderdoc/api/replay/replay_enums.h +++ b/renderdoc/api/replay/replay_enums.h @@ -350,6 +350,31 @@ enum class CompType : uint8_t DECLARE_REFLECTION_ENUM(CompType); +DOCUMENT(R"(Get the component type of a variable type. + +:param VarType type: The variable type +:return: The base component type of this variable type +:rtype: CompType +)"); +constexpr CompType VarTypeCompType(VarType type) +{ + // temporarily disable clang-format to make this more readable. + // Ideally we'd use a simple switch() but VS2015 doesn't support that :(. + // clang-format off + return (type == VarType::Double) ? CompType::Double + + : (type == VarType::Float || type == VarType::Half) ? CompType::Float + + : (type == VarType::ULong || type == VarType::UInt || + type == VarType::UShort || type == VarType::UByte || type == VarType::Bool) ? CompType::UInt + + : (type == VarType::SLong || type == VarType::SInt || + type == VarType::SShort || type == VarType::SByte) ? CompType::SInt + + : CompType::Typeless; + // clang-format on +} + DOCUMENT(R"(A single source component for a destination texture swizzle. .. data:: Red diff --git a/renderdoc/api/replay/shader_types.h b/renderdoc/api/replay/shader_types.h index eec3121d8..760907dff 100644 --- a/renderdoc/api/replay/shader_types.h +++ b/renderdoc/api/replay/shader_types.h @@ -795,7 +795,7 @@ struct SigParameter { return varName == o.varName && semanticName == o.semanticName && semanticIdxName == o.semanticIdxName && semanticIndex == o.semanticIndex && - regIndex == o.regIndex && systemValue == o.systemValue && compType == o.compType && + regIndex == o.regIndex && systemValue == o.systemValue && varType == o.varType && regChannelMask == o.regChannelMask && channelUsedMask == o.channelUsedMask && needSemanticIndex == o.needSemanticIndex && compCount == o.compCount && stream == o.stream; @@ -814,8 +814,8 @@ struct SigParameter return regIndex < o.regIndex; if(!(systemValue == o.systemValue)) return systemValue < o.systemValue; - if(!(compType == o.compType)) - return compType < o.compType; + if(!(varType == o.varType)) + return varType < o.varType; if(!(regChannelMask == o.regChannelMask)) return regChannelMask < o.regChannelMask; if(!(channelUsedMask == o.channelUsedMask)) @@ -847,8 +847,8 @@ stage. See :data:`systemValue`. DOCUMENT("The :class:`ShaderBuiltin` value that this element contains."); ShaderBuiltin systemValue = ShaderBuiltin::Undefined; - DOCUMENT("The :class:`component type ` of data that this element stores."); - CompType compType = CompType::Float; + DOCUMENT("The :class:`variable type ` of data that this element stores."); + VarType varType = VarType::Float; DOCUMENT(R"(A bitmask indicating which components in the shader register are stored, for APIs that pack signatures together. diff --git a/renderdoc/data/glsl_shaders.cpp b/renderdoc/data/glsl_shaders.cpp index 108a59b9b..346cc61ac 100644 --- a/renderdoc/data/glsl_shaders.cpp +++ b/renderdoc/data/glsl_shaders.cpp @@ -664,7 +664,7 @@ void main() { CHECK(sig.regIndex == 0); CHECK(sig.systemValue == ShaderBuiltin::Position); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 4); CHECK(sig.regChannelMask == 0xf); CHECK(sig.channelUsedMask == 0xf); @@ -677,7 +677,7 @@ void main() { CHECK(sig.regIndex == 3); CHECK(sig.systemValue == ShaderBuiltin::Undefined); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 2); CHECK(sig.regChannelMask == 0x3); CHECK(sig.channelUsedMask == 0x3); @@ -690,7 +690,7 @@ void main() { CHECK(sig.regIndex == 6); CHECK(sig.systemValue == ShaderBuiltin::Undefined); - CHECK(sig.compType == CompType::UInt); + CHECK(sig.varType == VarType::UInt); CHECK(sig.compCount == 3); CHECK(sig.regChannelMask == 0x7); CHECK(sig.channelUsedMask == 0x7); @@ -706,7 +706,7 @@ void main() { CHECK(sig.regIndex == 0); CHECK(sig.systemValue == ShaderBuiltin::ColorOutput); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 4); CHECK(sig.regChannelMask == 0xf); CHECK(sig.channelUsedMask == 0xf); @@ -719,7 +719,7 @@ void main() { CHECK(sig.regIndex == 1); CHECK(sig.systemValue == ShaderBuiltin::ColorOutput); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 3); CHECK(sig.regChannelMask == 0x7); CHECK(sig.channelUsedMask == 0x7); @@ -732,7 +732,7 @@ void main() { CHECK(sig.regIndex == 2); CHECK(sig.systemValue == ShaderBuiltin::ColorOutput); - CHECK(sig.compType == CompType::SInt); + CHECK(sig.varType == VarType::SInt); CHECK(sig.compCount == 1); CHECK(sig.regChannelMask == 0x1); CHECK(sig.channelUsedMask == 0x1); @@ -747,7 +747,7 @@ void main() { // the location of outputs, so this will be wrong // CHECK(sig.regIndex == 0); CHECK(sig.systemValue == ShaderBuiltin::DepthOutput); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 1); CHECK(sig.regChannelMask == 0x1); CHECK(sig.channelUsedMask == 0x1); @@ -1372,7 +1372,7 @@ void main() { CHECK(sig.regIndex == 0); CHECK(sig.systemValue == ShaderBuiltin::Position); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 4); CHECK(sig.regChannelMask == 0xf); CHECK(sig.channelUsedMask == 0xf); @@ -1407,7 +1407,7 @@ void main() { CHECK(sig.regIndex == 0); CHECK(sig.systemValue == ShaderBuiltin::Position); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 4); CHECK(sig.regChannelMask == 0xf); CHECK(sig.channelUsedMask == 0xf); @@ -1420,7 +1420,7 @@ void main() { CHECK(sig.regIndex == 0); CHECK(sig.systemValue == ShaderBuiltin::PointSize); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 1); CHECK(sig.regChannelMask == 0x1); CHECK(sig.channelUsedMask == 0x1); @@ -1468,7 +1468,7 @@ void main() CHECK(sig.regIndex == 0); CHECK(sig.systemValue == ShaderBuiltin::Position); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 4); CHECK(sig.regChannelMask == 0xf); CHECK(sig.channelUsedMask == 0xf); @@ -1481,7 +1481,7 @@ void main() CHECK(sig.regIndex == 0); CHECK(sig.systemValue == ShaderBuiltin::Undefined); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 3); CHECK(sig.regChannelMask == 0x7); CHECK(sig.channelUsedMask == 0x7); @@ -1494,7 +1494,7 @@ void main() CHECK(sig.regIndex == 1); CHECK(sig.systemValue == ShaderBuiltin::Undefined); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 3); CHECK(sig.regChannelMask == 0x7); CHECK(sig.channelUsedMask == 0x7); @@ -1507,7 +1507,7 @@ void main() CHECK(sig.regIndex == 2); CHECK(sig.systemValue == ShaderBuiltin::Undefined); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 3); CHECK(sig.regChannelMask == 0x7); CHECK(sig.channelUsedMask == 0x7); @@ -1520,7 +1520,7 @@ void main() CHECK(sig.regIndex == 6); CHECK(sig.systemValue == ShaderBuiltin::Undefined); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 2); CHECK(sig.regChannelMask == 0x3); CHECK(sig.channelUsedMask == 0x3); @@ -1533,7 +1533,7 @@ void main() CHECK(sig.regIndex == 7); CHECK(sig.systemValue == ShaderBuiltin::Undefined); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 2); CHECK(sig.regChannelMask == 0x3); CHECK(sig.channelUsedMask == 0x3); @@ -1546,7 +1546,7 @@ void main() CHECK(sig.regIndex == 9); CHECK(sig.systemValue == ShaderBuiltin::Undefined); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 2); CHECK(sig.regChannelMask == 0x3); CHECK(sig.channelUsedMask == 0x3); @@ -1559,7 +1559,7 @@ void main() CHECK(sig.regIndex == 10); CHECK(sig.systemValue == ShaderBuiltin::Undefined); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 2); CHECK(sig.regChannelMask == 0x3); CHECK(sig.channelUsedMask == 0x3); @@ -1572,7 +1572,7 @@ void main() CHECK(sig.regIndex == 11); CHECK(sig.systemValue == ShaderBuiltin::Undefined); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 2); CHECK(sig.regChannelMask == 0x3); CHECK(sig.channelUsedMask == 0x3); @@ -1585,7 +1585,7 @@ void main() CHECK(sig.regIndex == 12); CHECK(sig.systemValue == ShaderBuiltin::Undefined); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 2); CHECK(sig.regChannelMask == 0x3); CHECK(sig.channelUsedMask == 0x3); @@ -1653,7 +1653,7 @@ void main() CHECK(sig.regIndex == 0); CHECK(sig.systemValue == ShaderBuiltin::Position); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 4); CHECK(sig.regChannelMask == 0xf); CHECK(sig.channelUsedMask == 0xf); @@ -1666,7 +1666,7 @@ void main() CHECK(sig.regIndex == 0); CHECK(sig.systemValue == ShaderBuiltin::Undefined); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 1); CHECK(sig.regChannelMask == 0x1); CHECK(sig.channelUsedMask == 0x1); @@ -1679,7 +1679,7 @@ void main() CHECK(sig.regIndex == 1); CHECK(sig.systemValue == ShaderBuiltin::Undefined); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 3); CHECK(sig.regChannelMask == 0x7); CHECK(sig.channelUsedMask == 0x7); @@ -1692,7 +1692,7 @@ void main() CHECK(sig.regIndex == 2); CHECK(sig.systemValue == ShaderBuiltin::Undefined); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 1); CHECK(sig.regChannelMask == 0x1); CHECK(sig.channelUsedMask == 0x1); @@ -1705,7 +1705,7 @@ void main() CHECK(sig.regIndex == 3); CHECK(sig.systemValue == ShaderBuiltin::Undefined); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 1); CHECK(sig.regChannelMask == 0x1); CHECK(sig.channelUsedMask == 0x1); @@ -1718,7 +1718,7 @@ void main() CHECK(sig.regIndex == 4); CHECK(sig.systemValue == ShaderBuiltin::Undefined); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 1); CHECK(sig.regChannelMask == 0x1); CHECK(sig.channelUsedMask == 0x1); @@ -1731,7 +1731,7 @@ void main() CHECK(sig.regIndex == 5); CHECK(sig.systemValue == ShaderBuiltin::Undefined); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 1); CHECK(sig.regChannelMask == 0x1); CHECK(sig.channelUsedMask == 0x1); @@ -1744,7 +1744,7 @@ void main() CHECK(sig.regIndex == 6); CHECK(sig.systemValue == ShaderBuiltin::Undefined); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 1); CHECK(sig.regChannelMask == 0x1); CHECK(sig.channelUsedMask == 0x1); @@ -1757,7 +1757,7 @@ void main() CHECK(sig.regIndex == 7); CHECK(sig.systemValue == ShaderBuiltin::Undefined); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 1); CHECK(sig.regChannelMask == 0x1); CHECK(sig.channelUsedMask == 0x1); @@ -1770,7 +1770,7 @@ void main() CHECK(sig.regIndex == 8); CHECK(sig.systemValue == ShaderBuiltin::Undefined); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 1); CHECK(sig.regChannelMask == 0x1); CHECK(sig.channelUsedMask == 0x1); @@ -1783,7 +1783,7 @@ void main() CHECK(sig.regIndex == 9); CHECK(sig.systemValue == ShaderBuiltin::Undefined); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 1); CHECK(sig.regChannelMask == 0x1); CHECK(sig.channelUsedMask == 0x1); @@ -1853,7 +1853,7 @@ void main() CHECK(sig.regIndex == 0); CHECK(sig.systemValue == ShaderBuiltin::Position); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 4); CHECK(sig.regChannelMask == 0xf); CHECK(sig.channelUsedMask == 0xf); @@ -1874,7 +1874,7 @@ void main() CHECK(sig.regIndex == a); CHECK(sig.systemValue == ShaderBuiltin::Undefined); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 3); CHECK(sig.regChannelMask == 0x7); CHECK(sig.channelUsedMask == 0x7); @@ -1948,7 +1948,7 @@ void main() CHECK(sig.regIndex == 0); CHECK(sig.systemValue == ShaderBuiltin::Position); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 4); CHECK(sig.regChannelMask == 0xf); CHECK(sig.channelUsedMask == 0xf); @@ -1961,7 +1961,7 @@ void main() CHECK(sig.regIndex == 0); CHECK(sig.systemValue == ShaderBuiltin::Undefined); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 2); CHECK(sig.regChannelMask == 0x3); CHECK(sig.channelUsedMask == 0x3); @@ -1979,7 +1979,7 @@ void main() CHECK(sig.regIndex == 0); CHECK(sig.systemValue == ShaderBuiltin::Position); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 4); CHECK(sig.regChannelMask == 0xf); CHECK(sig.channelUsedMask == 0xf); @@ -1992,7 +1992,7 @@ void main() CHECK(sig.regIndex == 0); CHECK(sig.systemValue == ShaderBuiltin::Undefined); - CHECK(sig.compType == CompType::Float); + CHECK(sig.varType == VarType::Float); CHECK(sig.compCount == 2); CHECK(sig.regChannelMask == 0x3); CHECK(sig.channelUsedMask == 0x3); diff --git a/renderdoc/driver/d3d11/d3d11_shaderdebug.cpp b/renderdoc/driver/d3d11/d3d11_shaderdebug.cpp index c75a3b325..799ea8ad5 100644 --- a/renderdoc/driver/d3d11/d3d11_shaderdebug.cpp +++ b/renderdoc/driver/d3d11/d3d11_shaderdebug.cpp @@ -2078,7 +2078,7 @@ ShaderDebugTrace *D3D11Replay::DebugVertex(uint32_t eventId, uint32_t vertid, ui if(draw->flags & DrawFlags::Indexed) sv_vertid = idx; - if(dxbc->GetReflection()->InputSig[i].compType == CompType::Float) + if(dxbc->GetReflection()->InputSig[i].varType == VarType::Float) state.inputs[i].value.f.x = state.inputs[i].value.f.y = state.inputs[i].value.f.z = state.inputs[i].value.f.w = (float)sv_vertid; else @@ -2087,7 +2087,7 @@ ShaderDebugTrace *D3D11Replay::DebugVertex(uint32_t eventId, uint32_t vertid, ui } else if(dxbc->GetReflection()->InputSig[i].systemValue == ShaderBuiltin::InstanceIndex) { - if(dxbc->GetReflection()->InputSig[i].compType == CompType::Float) + if(dxbc->GetReflection()->InputSig[i].varType == VarType::Float) state.inputs[i].value.f.x = state.inputs[i].value.f.y = state.inputs[i].value.f.z = state.inputs[i].value.f.w = (float)instid; else diff --git a/renderdoc/driver/d3d12/d3d12_shaderdebug.cpp b/renderdoc/driver/d3d12/d3d12_shaderdebug.cpp index 47684d0d5..201d1f9ef 100644 --- a/renderdoc/driver/d3d12/d3d12_shaderdebug.cpp +++ b/renderdoc/driver/d3d12/d3d12_shaderdebug.cpp @@ -2026,7 +2026,7 @@ ShaderDebugTrace *D3D12Replay::DebugVertex(uint32_t eventId, uint32_t vertid, ui if(draw->flags & DrawFlags::Indexed) sv_vertid = idx; - if(dxbc->GetReflection()->InputSig[i].compType == CompType::Float) + if(dxbc->GetReflection()->InputSig[i].varType == VarType::Float) state.inputs[i].value.f.x = state.inputs[i].value.f.y = state.inputs[i].value.f.z = state.inputs[i].value.f.w = (float)sv_vertid; else @@ -2035,7 +2035,7 @@ ShaderDebugTrace *D3D12Replay::DebugVertex(uint32_t eventId, uint32_t vertid, ui } else if(dxbc->GetReflection()->InputSig[i].systemValue == ShaderBuiltin::InstanceIndex) { - if(dxbc->GetReflection()->InputSig[i].compType == CompType::Float) + if(dxbc->GetReflection()->InputSig[i].varType == VarType::Float) state.inputs[i].value.f.x = state.inputs[i].value.f.y = state.inputs[i].value.f.z = state.inputs[i].value.f.w = (float)instid; else diff --git a/renderdoc/driver/gl/gl_postvs.cpp b/renderdoc/driver/gl/gl_postvs.cpp index e185e5a81..2128b9195 100644 --- a/renderdoc/driver/gl/gl_postvs.cpp +++ b/renderdoc/driver/gl/gl_postvs.cpp @@ -94,7 +94,7 @@ static void MakeVaryingsFromShaderReflection(ShaderReflection &refl, rdcarraycomponentType; - desc.compType = CompType::Float; + desc.varType = VarType::Float; if(compType == COMPONENT_TYPE_UINT32) - desc.compType = CompType::UInt; + desc.varType = VarType::UInt; else if(compType == COMPONENT_TYPE_SINT32) - desc.compType = CompType::SInt; + desc.varType = VarType::SInt; else if(compType != COMPONENT_TYPE_FLOAT32) RDCERR("Unexpected component type in signature"); diff --git a/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp b/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp index 6d99f7b44..2a3a5328c 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp @@ -4754,14 +4754,15 @@ void GatherPSInputDataForInitialValues(const DXBC::DXBCContainer *dxbc, { filled = true; - if(prevStageDxbc.OutputSig[os].compType == CompType::Float) + if(prevStageDxbc.OutputSig[os].varType == VarType::Float) psInputDefinition += "float"; - else if(prevStageDxbc.OutputSig[os].compType == CompType::SInt) + else if(prevStageDxbc.OutputSig[os].varType == VarType::SInt) psInputDefinition += "int"; - else if(prevStageDxbc.OutputSig[os].compType == CompType::UInt) + else if(prevStageDxbc.OutputSig[os].varType == VarType::UInt) psInputDefinition += "uint"; else - RDCERR("Unexpected input signature type: %d", prevStageDxbc.OutputSig[os].compType); + RDCERR("Unexpected input signature type: %s", + ToStr(prevStageDxbc.OutputSig[os].varType).c_str()); int numCols = (prevStageDxbc.OutputSig[os].regChannelMask & 0x1 ? 1 : 0) + (prevStageDxbc.OutputSig[os].regChannelMask & 0x2 ? 1 : 0) + @@ -4792,14 +4793,13 @@ void GatherPSInputDataForInitialValues(const DXBC::DXBCContainer *dxbc, nextreg = sig.regIndex + 1; - if(sig.compType == CompType::Float) + if(sig.varType == VarType::Float) { // if we're packed with ints on either side, we must be nointerpolation bool nointerp = false; for(size_t j = 0; j < numInputs; j++) { - if(sig.regIndex == psDxbc.InputSig[j].regIndex && - psDxbc.InputSig[j].compType != CompType::Float) + if(sig.regIndex == psDxbc.InputSig[j].regIndex && psDxbc.InputSig[j].varType != VarType::Float) { nointerp = true; break; @@ -4831,12 +4831,12 @@ void GatherPSInputDataForInitialValues(const DXBC::DXBCContainer *dxbc, psInputDefinition += "float"; } - else if(sig.compType == CompType::SInt) + else if(sig.varType == VarType::SInt) psInputDefinition += "nointerpolation int"; - else if(sig.compType == CompType::UInt) + else if(sig.varType == VarType::UInt) psInputDefinition += "nointerpolation uint"; else - RDCERR("Unexpected input signature type: %d", sig.compType); + RDCERR("Unexpected input signature type: %s", ToStr(sig.varType).c_str()); int numCols = (sig.regChannelMask & 0x1 ? 1 : 0) + (sig.regChannelMask & 0x2 ? 1 : 0) + (sig.regChannelMask & 0x4 ? 1 : 0) + (sig.regChannelMask & 0x8 ? 1 : 0); @@ -4952,7 +4952,7 @@ void GatherPSInputDataForInitialValues(const DXBC::DXBCContainer *dxbc, if(arrayLength > 0) inputVarNames[i] += StringFormat::Fmt("[%d]", RDCMAX(0, arrayIndex)); - if(included && sig.compType == CompType::Float) + if(included && sig.varType == VarType::Float) { if(arrayLength == 0) { @@ -5043,13 +5043,7 @@ ShaderDebugTrace *InterpretDebugger::BeginDebug(const DXBC::DXBCContainer *dxbcC : sig.regChannelMask & 0x2 ? 2 : sig.regChannelMask & 0x1 ? 1 : 0; - - if(sig.compType == CompType::UInt) - v.type = VarType::UInt; - else if(sig.compType == CompType::SInt) - v.type = VarType::SInt; - else - v.type = VarType::Float; + v.type = sig.varType; ShaderVariable &dst = state.inputs[sig.regIndex]; @@ -5153,13 +5147,7 @@ ShaderDebugTrace *InterpretDebugger::BeginDebug(const DXBC::DXBCContainer *dxbcC : sig.regChannelMask & 0x2 ? 2 : sig.regChannelMask & 0x1 ? 1 : 0; - - if(sig.compType == CompType::UInt) - v.type = VarType::UInt; - else if(sig.compType == CompType::SInt) - v.type = VarType::SInt; - else - v.type = VarType::Float; + v.type = sig.varType; ShaderVariable &dst = state.variables[idx]; diff --git a/renderdoc/driver/shaders/dxbc/dxbc_disassemble.cpp b/renderdoc/driver/shaders/dxbc/dxbc_disassemble.cpp index 4cfb71f8d..66ac40c99 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_disassemble.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_disassemble.cpp @@ -341,7 +341,7 @@ void Program::FetchComputeProperties(DXBC::Reflection *reflection) SigParameter param; - param.compType = CompType::UInt; + param.varType = VarType::UInt; param.regIndex = ~0U; switch(type) diff --git a/renderdoc/driver/shaders/spirv/spirv_processor.cpp b/renderdoc/driver/shaders/spirv/spirv_processor.cpp index 95f0f0266..dd491aafe 100644 --- a/renderdoc/driver/shaders/spirv/spirv_processor.cpp +++ b/renderdoc/driver/shaders/spirv/spirv_processor.cpp @@ -29,6 +29,26 @@ namespace rdcspv { +Scalar scalar(VarType type) +{ + switch(type) + { + case VarType::Float: return scalar(); + case VarType::Double: return scalar(); + case VarType::Half: return Scalar(Op::TypeFloat, 16, false); + case VarType::SInt: return scalar(); + case VarType::UInt: return scalar(); + case VarType::SShort: return scalar(); + case VarType::UShort: return scalar(); + case VarType::SLong: return scalar(); + case VarType::ULong: return scalar(); + case VarType::SByte: return scalar(); + case VarType::UByte: return scalar(); + case VarType::Bool: return scalar(); + default: RDCERR("No scalar type for %s", ToStr(type).c_str()); return scalar(); + } +} + void ExecutionModes::Register(const OpExecutionMode &mode) { if(mode.mode == ExecutionMode::LocalSize) diff --git a/renderdoc/driver/shaders/spirv/spirv_processor.h b/renderdoc/driver/shaders/spirv/spirv_processor.h index 55c1293f9..76e4cc369 100644 --- a/renderdoc/driver/shaders/spirv/spirv_processor.h +++ b/renderdoc/driver/shaders/spirv/spirv_processor.h @@ -97,6 +97,8 @@ struct Scalar template inline constexpr Scalar scalar(); +Scalar scalar(VarType t); + #define SCALAR_TYPE(ctype, op, width, sign) \ template <> \ inline constexpr Scalar scalar() \ diff --git a/renderdoc/driver/shaders/spirv/spirv_reflect.cpp b/renderdoc/driver/shaders/spirv/spirv_reflect.cpp index 664d65e5c..877cb7dc7 100644 --- a/renderdoc/driver/shaders/spirv/spirv_reflect.cpp +++ b/renderdoc/driver/shaders/spirv/spirv_reflect.cpp @@ -175,10 +175,8 @@ void AddXFBAnnotations(const ShaderReflection &refl, const SPIRVPatchData &patch outpatch[i].ID, rdcspv::DecorationParam(xfbStride))); } - uint32_t compByteSize = 4; - - if(outsig[i].compType == CompType::Double) - compByteSize = 8; + // components always get promoted to at least 32-bit + uint32_t compByteSize = RDCMAX(4U, VarTypeByteSize(outsig[i].varType)); xfbStride += outsig[i].compCount * compByteSize; } @@ -1597,19 +1595,7 @@ void Reflector::AddSignatureParameter(const bool isInput, const ShaderStage stag return; } - switch(varType->scalar().type) - { - case Op::TypeBool: - case Op::TypeInt: - sig.compType = varType->scalar().signedness ? CompType::SInt : CompType::UInt; - break; - case Op::TypeFloat: - sig.compType = varType->scalar().width == 64 ? CompType::Double : CompType::Float; - break; - default: - RDCERR("Unexpected base type of input/output signature %u", varType->scalar().type); - break; - } + sig.varType = varType->scalar().Type(); sig.compCount = RDCMAX(1U, varType->vector().count); sig.stream = 0; diff --git a/renderdoc/driver/vulkan/vk_postvs.cpp b/renderdoc/driver/vulkan/vk_postvs.cpp index 01971f058..52a583979 100644 --- a/renderdoc/driver/vulkan/vk_postvs.cpp +++ b/renderdoc/driver/vulkan/vk_postvs.cpp @@ -459,16 +459,7 @@ static void ConvertToMeshOutputCompute(const ShaderReflection &refl, const SPIRV // base type - either a scalar or a vector, since matrix outputs are decayed to vectors { - rdcspv::Scalar scalarType = rdcspv::scalar(); - - if(refl.outputSignature[i].compType == CompType::UInt) - scalarType = rdcspv::scalar(); - else if(refl.outputSignature[i].compType == CompType::SInt) - scalarType = rdcspv::scalar(); - else if(refl.outputSignature[i].compType == CompType::Float) - scalarType = rdcspv::scalar(); - else if(refl.outputSignature[i].compType == CompType::Double) - scalarType = rdcspv::scalar(); + rdcspv::Scalar scalarType = rdcspv::scalar(refl.outputSignature[i].varType); io.vec4ID = editor.DeclareType(rdcspv::Vector(scalarType, 4)); @@ -499,33 +490,30 @@ static void ConvertToMeshOutputCompute(const ShaderReflection &refl, const SPIRV io.variableID = patchData.inputs[i].ID; - rdcspv::Scalar scalarType = rdcspv::scalar(); + rdcspv::Scalar scalarType = rdcspv::scalar(refl.inputSignature[i].varType); // base type - either a scalar or a vector, since matrix outputs are decayed to vectors - if(refl.inputSignature[i].compType == CompType::UInt) + CompType compType = VarTypeCompType(refl.inputSignature[i].varType); + if(compType == CompType::UInt) { - scalarType = rdcspv::scalar(); io.tbuffer = tbuffer_uint; } - else if(refl.inputSignature[i].compType == CompType::SInt) + else if(compType == CompType::SInt) { - scalarType = rdcspv::scalar(); io.tbuffer = tbuffer_sint; } - else if(refl.inputSignature[i].compType == CompType::Float) + else if(compType == CompType::Float) { - scalarType = rdcspv::scalar(); io.tbuffer = tbuffer_float; } - else if(refl.inputSignature[i].compType == CompType::Double) + else if(compType == CompType::Double) { - scalarType = rdcspv::scalar(); // doubles are loaded packed from a uint tbuffer io.tbuffer = tbuffer_uint; } // doubles are loaded as uvec4 and then packed in pairs, so we need to declare vec4ID as uvec4 - if(refl.inputSignature[i].compType == CompType::Double) + if(compType == CompType::Double) io.vec4ID = editor.DeclareType(rdcspv::Vector(rdcspv::scalar(), 4)); else io.vec4ID = editor.DeclareType(rdcspv::Vector(scalarType, 4)); @@ -667,15 +655,7 @@ static void ConvertToMeshOutputCompute(const ShaderReflection &refl, const SPIRV uint32_t memberOffset = 0; for(uint32_t o = 0; o < numOutputs; o++) { - uint32_t elemSize = 0; - if(refl.outputSignature[o].compType == CompType::Double) - elemSize = 8; - else if(refl.outputSignature[o].compType == CompType::SInt || - refl.outputSignature[o].compType == CompType::UInt || - refl.outputSignature[o].compType == CompType::Float) - elemSize = 4; - else - RDCERR("Unexpected component type for output signature element"); + uint32_t elemSize = RDCMAX(4U, VarTypeByteSize(refl.outputSignature[o].varType)); uint32_t numComps = refl.outputSignature[o].compCount; @@ -951,7 +931,7 @@ static void ConvertToMeshOutputCompute(const ShaderReflection &refl, const SPIRV if(valueID) { - if(refl.inputSignature[i].compType == compType) + if(VarTypeCompType(refl.inputSignature[i].varType) == compType) { ops.add(rdcspv::OpStore(ins[i].variableID, valueID)); } @@ -1022,7 +1002,7 @@ static void ConvertToMeshOutputCompute(const ShaderReflection &refl, const SPIRV } } - if(refl.inputSignature[i].compType == CompType::Double) + if(refl.inputSignature[i].varType == VarType::Double) { // since doubles are packed into two uints, we need to multiply the index by two idx = ops.add(rdcspv::OpIMul(uint32ID, editor.MakeId(), idx, @@ -1034,7 +1014,7 @@ static void ConvertToMeshOutputCompute(const ShaderReflection &refl, const SPIRV uint32_t comp = Bits::CountTrailingZeroes(uint32_t(refl.inputSignature[i].regChannelMask)); - if(refl.inputSignature[i].compType == CompType::Double) + if(refl.inputSignature[i].varType == VarType::Double) { // since doubles are packed into two uints, we now need to fetch more data and do // packing. We can fetch the data unconditionally since it's harmless to read out of the diff --git a/renderdoc/driver/vulkan/vk_shaderdebug.cpp b/renderdoc/driver/vulkan/vk_shaderdebug.cpp index cd5230d7a..cbb7f167a 100644 --- a/renderdoc/driver/vulkan/vk_shaderdebug.cpp +++ b/renderdoc/driver/vulkan/vk_shaderdebug.cpp @@ -2721,27 +2721,28 @@ static void CreatePSInputFetcher(rdcarray &fragspv, uint32_t &structSt { const SigParameter ¶m = shadRefl.refl.inputSignature[i]; - rdcspv::Scalar base; - switch(param.compType) - { - case CompType::Float: base = rdcspv::scalar(); break; - case CompType::UInt: base = rdcspv::scalar(); break; - case CompType::SInt: base = rdcspv::scalar(); break; - case CompType::Double: base = rdcspv::scalar(); break; - default: RDCERR("Unexpected type %s", ToStr(param.compType).c_str()); - } + rdcspv::Scalar base = rdcspv::scalar(param.varType); values[i].structIndex = (uint32_t)offsets.size(); + uint32_t width = (base.width / 8); + + // treat bools as uints + if(base.type == rdcspv::Op::TypeBool) + width = 4; + offsets.push_back(structStride); - structStride += param.compCount * (base.width / 8); + structStride += param.compCount * width; if(param.compCount == 1) values[i].valueType = editor.DeclareType(base); else values[i].valueType = editor.DeclareType(rdcspv::Vector(base, param.compCount)); - ids.push_back(values[i].valueType); + if(values[i].valueType == boolType) + ids.push_back(uint32Type); + else + ids.push_back(values[i].valueType); // align offset conservatively, to 16-byte aligned. We do this with explicit uints so we can // preview with spirv-cross (and because it doesn't cost anything particularly) @@ -3036,8 +3037,10 @@ static void CreatePSInputFetcher(rdcarray &fragspv, uint32_t &structSt for(uint32_t idx : access.accessChain) accessIndices.push_back(getUIntConst(idx)); + rdcspv::Id valueType = values[i].valueType; + rdcspv::Id ptrType = - editor.DeclareType(rdcspv::Pointer(values[i].valueType, rdcspv::StorageClass::Input)); + editor.DeclareType(rdcspv::Pointer(valueType, rdcspv::StorageClass::Input)); // if we have no access chain it's a global pointer of the type we want, so just load // straight out of it @@ -3047,23 +3050,31 @@ static void CreatePSInputFetcher(rdcarray &fragspv, uint32_t &structSt else ptr = ops.add(rdcspv::OpAccessChain(ptrType, editor.MakeId(), access.ID, accessIndices)); - rdcspv::Id base = ops.add(rdcspv::OpLoad(values[i].valueType, editor.MakeId(), ptr)); + rdcspv::Id base = ops.add(rdcspv::OpLoad(valueType, editor.MakeId(), ptr)); + + if(valueType == boolType) + { + valueType = uint32Type; + // can't store bools directly, need to convert to uint + base = ops.add( + rdcspv::OpSelect(valueType, editor.MakeId(), base, getUIntConst(1), getUIntConst(0))); + } values[i].data[Variant_Base] = base; editor.SetName(base, StringFormat::Fmt("__rd_base_%zu_%s", i, param.varName.c_str())); // only float values have derivatives - if(param.compType == CompType::Float) + if(VarTypeCompType(param.varType) == CompType::Float) { values[i].data[Variant_ddxcoarse] = - ops.add(rdcspv::OpDPdxCoarse(values[i].valueType, editor.MakeId(), base)); + ops.add(rdcspv::OpDPdxCoarse(valueType, editor.MakeId(), base)); values[i].data[Variant_ddycoarse] = - ops.add(rdcspv::OpDPdyCoarse(values[i].valueType, editor.MakeId(), base)); + ops.add(rdcspv::OpDPdyCoarse(valueType, editor.MakeId(), base)); values[i].data[Variant_ddxfine] = - ops.add(rdcspv::OpDPdxFine(values[i].valueType, editor.MakeId(), base)); + ops.add(rdcspv::OpDPdxFine(valueType, editor.MakeId(), base)); values[i].data[Variant_ddyfine] = - ops.add(rdcspv::OpDPdyFine(values[i].valueType, editor.MakeId(), base)); + ops.add(rdcspv::OpDPdyFine(valueType, editor.MakeId(), base)); editor.SetName(values[i].data[Variant_ddxcoarse], StringFormat::Fmt("__rd_ddxcoarse_%zu_%s", i, param.varName.c_str())); @@ -3078,7 +3089,7 @@ static void CreatePSInputFetcher(rdcarray &fragspv, uint32_t &structSt { values[i].data[Variant_ddxcoarse] = values[i].data[Variant_ddycoarse] = values[i].data[Variant_ddxfine] = values[i].data[Variant_ddyfine] = - editor.AddConstant(rdcspv::OpConstantNull(values[i].valueType, editor.MakeId())); + editor.AddConstant(rdcspv::OpConstantNull(valueType, editor.MakeId())); editor.SetName(values[i].data[Variant_ddxcoarse], StringFormat::Fmt("__rd_noderiv_%zu_%s", i, param.varName.c_str())); @@ -3265,7 +3276,10 @@ static void CreatePSInputFetcher(rdcarray &fragspv, uint32_t &structSt for(size_t i = 0; i < values.size(); i++) { - rdcspv::Id ptrType = editor.DeclareType(rdcspv::Pointer(values[i].valueType, bufferClass)); + rdcspv::Id valueType = values[i].valueType; + if(valueType == boolType) + valueType = uint32Type; + rdcspv::Id ptrType = editor.DeclareType(rdcspv::Pointer(valueType, bufferClass)); for(size_t j = 0; j < Variant_Count; j++) { diff --git a/renderdoc/replay/renderdoc_serialise.inl b/renderdoc/replay/renderdoc_serialise.inl index f03ff3454..a84873b48 100644 --- a/renderdoc/replay/renderdoc_serialise.inl +++ b/renderdoc/replay/renderdoc_serialise.inl @@ -159,7 +159,7 @@ void DoSerialise(SerialiserType &ser, SigParameter &el) SERIALISE_MEMBER(semanticIndex); SERIALISE_MEMBER(regIndex); SERIALISE_MEMBER(systemValue); - SERIALISE_MEMBER(compType); + SERIALISE_MEMBER(varType); SERIALISE_MEMBER(regChannelMask); SERIALISE_MEMBER(channelUsedMask); SERIALISE_MEMBER(needSemanticIndex); diff --git a/util/test/demos/vk/vk_shader_debug_zoo.cpp b/util/test/demos/vk/vk_shader_debug_zoo.cpp index 1859a079b..3f85d1c86 100644 --- a/util/test/demos/vk/vk_shader_debug_zoo.cpp +++ b/util/test/demos/vk/vk_shader_debug_zoo.cpp @@ -1768,6 +1768,11 @@ void main() break; } #endif + case 19: + { + Color = gl_FrontFacing ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); + default: + } default: break; } }