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.
This commit is contained in:
baldurk
2020-05-07 22:46:41 +01:00
parent c70929d40a
commit 90c10ea1fc
23 changed files with 186 additions and 200 deletions
+1 -16
View File
@@ -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;
+1 -16
View File
@@ -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);
+1 -1
View File
@@ -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;
@@ -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));
}
}
@@ -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;
}
}