Info return type is used for sampleinfo and resinfo

This commit is contained in:
baldurk
2021-07-13 18:06:37 +01:00
parent 7f13429d0e
commit 7d6e7dfb78
3 changed files with 11 additions and 11 deletions
@@ -1125,7 +1125,7 @@ struct Operation
operation = NUM_REAL_OPCODES;
flags = FLAG_NONE;
preciseValues = 0;
resinfoRetType = NUM_RETTYPES;
infoRetType = NUM_RETTYPES;
syncFlags = 0;
texelOffset[0] = texelOffset[1] = texelOffset[2] = 0;
resDim = RESOURCE_DIMENSION_UNKNOWN;
@@ -1155,8 +1155,8 @@ struct Operation
union
{
ResinfoRetType resinfoRetType; // return type of resinfo
uint8_t syncFlags; // sync flags (for compute shader sync operations)
ResinfoRetType infoRetType; // return type of resinfo
uint8_t syncFlags; // sync flags (for compute shader sync operations)
};
int8_t texelOffset[3] = {0}; // U,V,W texel offset
@@ -2549,7 +2549,7 @@ void Program::EncodeOperation(rdcarray<uint32_t> &tokenStream, const Operation &
Opcode::PreciseValues.Set(OpcodeToken0, op.preciseValues);
if(op.operation == OPCODE_RESINFO)
Opcode::ResinfoReturn.Set(OpcodeToken0, op.resinfoRetType);
Opcode::ResinfoReturn.Set(OpcodeToken0, op.infoRetType);
if(op.operation == OPCODE_SYNC)
Opcode::SyncFlags.Set(OpcodeToken0, op.syncFlags);
@@ -2664,8 +2664,8 @@ bool Program::DecodeOperation(uint32_t *&tokenStream, Operation &retOp, bool fri
retOp.flags = Operation::Flags(retOp.flags | Operation::FLAG_SATURATE);
retOp.preciseValues = Opcode::PreciseValues.Get(OpcodeToken0);
if(op == OPCODE_RESINFO)
retOp.resinfoRetType = Opcode::ResinfoReturn.Get(OpcodeToken0);
if(op == OPCODE_RESINFO || op == OPCODE_SAMPLE_INFO)
retOp.infoRetType = Opcode::ResinfoReturn.Get(OpcodeToken0);
if(op == OPCODE_SYNC)
retOp.syncFlags = Opcode::SyncFlags.Get(OpcodeToken0);
@@ -2847,7 +2847,7 @@ bool Program::DecodeOperation(uint32_t *&tokenStream, Operation &retOp, bool fri
if(op == OPCODE_RESINFO)
{
retOp.str += "_";
retOp.str += ToStr(retOp.resinfoRetType);
retOp.str += ToStr(retOp.infoRetType);
}
if(op == OPCODE_SYNC)
+4 -4
View File
@@ -3657,7 +3657,7 @@ void ThreadState::StepNext(ShaderDebugState *state, DebugAPIWrapper *apiWrapper,
result = swizzled;
result.type = VarType::Float;
}
else if(op.resinfoRetType == RETTYPE_FLOAT)
else if(op.infoRetType == RETTYPE_FLOAT)
{
result.value.f32v[0] = (float)swizzled.value.u32v[0];
result.value.f32v[1] = (float)swizzled.value.u32v[1];
@@ -3784,7 +3784,7 @@ void ThreadState::StepNext(ShaderDebugState *state, DebugAPIWrapper *apiWrapper,
}
// apply ret type
if(op.resinfoRetType == RETTYPE_FLOAT)
if(op.infoRetType == RETTYPE_FLOAT)
{
result.value.f32v[0] = (float)swizzled.value.u32v[0];
result.value.f32v[1] = (float)swizzled.value.u32v[1];
@@ -3792,7 +3792,7 @@ void ThreadState::StepNext(ShaderDebugState *state, DebugAPIWrapper *apiWrapper,
result.value.f32v[3] = (float)swizzled.value.u32v[3];
result.type = VarType::Float;
}
else if(op.resinfoRetType == RETTYPE_RCPFLOAT)
else if(op.infoRetType == RETTYPE_RCPFLOAT)
{
// only width/height/depth values we set are reciprocated, other values
// are just left as is
@@ -3814,7 +3814,7 @@ void ThreadState::StepNext(ShaderDebugState *state, DebugAPIWrapper *apiWrapper,
result.value.f32v[3] = (float)swizzled.value.u32v[3];
result.type = VarType::Float;
}
else if(op.resinfoRetType == RETTYPE_UINT)
else if(op.infoRetType == RETTYPE_UINT)
{
result = swizzled;
result.type = VarType::UInt;