Apply SampleBias bias correctly when debugging D3D12 Shaders

This commit is contained in:
Jake Turner
2024-11-06 07:34:51 +00:00
parent a888296148
commit 88fdd4a2e9
@@ -321,6 +321,13 @@ bool D3D12ShaderDebug::CalculateSampleGather(
sampleOp == DEBUG_SAMPLE_TEX_GATHER4_CMP || sampleOp == DEBUG_SAMPLE_TEX_GATHER4_PO_CMP)
samp.ptr += sizeof(D3D12Descriptor);
if((sampleOp == DEBUG_SAMPLE_TEX_SAMPLE_BIAS || sampleOp == DEBUG_SAMPLE_TEX_SAMPLE_CMP_BIAS) &&
samplerData.bias != 0.0f)
{
D3D12_SAMPLER_DESC2 desc = descriptor.GetSampler();
desc.MipLODBias = RDCCLAMP(desc.MipLODBias + samplerData.bias, -15.99f, 15.99f);
descriptor.Init(&desc);
}
descriptor.Create(D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER, device, samp);
}