Fix assert when disassembling unorm or snorm typed resources

This commit is contained in:
baldurk committed 2024-08-20 14:49:47 +01:00
1 parent a1dc494fb5
commit 8cb615e217
2 files changed
+10 -21

No files matched your search

@@ -3405,6 +3405,13 @@ void Program::MakeRDDisassemblyString(const DXBC::Reflection *reflection)
{
VarType varType = VarTypeForComponentType(compType);
typeStr += "<";
if(compType == ComponentType::UNormF64 ||
compType == ComponentType::UNormF32 || compType == ComponentType::UNormF16)
typeStr += "unorm ";
else if(compType == ComponentType::SNormF64 ||
compType == ComponentType::SNormF32 ||
compType == ComponentType::SNormF16)
typeStr += "snorm ";
typeStr += ToStr(varType);
if(compCount > 1)
typeStr += StringFormat::Fmt("%d", compCount);
+3 -21
View File
@@ -988,29 +988,11 @@ VarType VarTypeForComponentType(ComponentType compType)
case ComponentType::F32: varType = VarType::Float; break;
case ComponentType::F64: varType = VarType::Double; break;
case ComponentType::SNormF16:
varType = VarType::Half;
RDCERR("Unexpected type in cbuffer annotations");
break;
case ComponentType::UNormF16:
varType = VarType::Half;
RDCERR("Unexpected type in cbuffer annotations");
break;
case ComponentType::UNormF16: varType = VarType::Half; break;
case ComponentType::SNormF32:
varType = VarType::Float;
RDCERR("Unexpected type in cbuffer annotations");
break;
case ComponentType::UNormF32:
varType = VarType::Float;
RDCERR("Unexpected type in cbuffer annotations");
break;
case ComponentType::UNormF32: varType = VarType::Float; break;
case ComponentType::SNormF64:
varType = VarType::Double;
RDCERR("Unexpected type in cbuffer annotations");
break;
case ComponentType::UNormF64:
varType = VarType::Double;
RDCERR("Unexpected type in cbuffer annotations");
break;
case ComponentType::UNormF64: varType = VarType::Double; break;
}
return varType;
}