mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-31 11:51:04 +00:00
D3D12 Pixel History fix format conversion for post-modification value
The per fragment post-modification value needs similar handling as the per fragment shader out
This commit is contained in:
@@ -3010,14 +3010,19 @@ void FillInColor(ResourceFormat fmt, const D3D12PixelHistoryValue &value, Modifi
|
||||
void ConvertAndFillInColor(ResourceFormat srcFmt, ResourceFormat outFmt,
|
||||
const D3D12PixelHistoryValue &value, ModificationValue &mod)
|
||||
{
|
||||
FloatVector v4 = DecodeFormattedComponents(srcFmt, value.color);
|
||||
|
||||
// To properly handle some cases of component bounds, roundtrip through encoding again
|
||||
uint8_t tempColor[32];
|
||||
EncodeFormattedComponents(outFmt, v4, (byte *)tempColor);
|
||||
v4 = DecodeFormattedComponents(outFmt, tempColor);
|
||||
|
||||
memcpy(mod.col.floatValue.data(), &v4, sizeof(v4));
|
||||
if((outFmt.compType == CompType::UInt) || (outFmt.compType == CompType::SInt))
|
||||
{
|
||||
PixelHistoryDecode(srcFmt, value.color, mod.col);
|
||||
}
|
||||
else
|
||||
{
|
||||
FloatVector v4 = DecodeFormattedComponents(srcFmt, value.color);
|
||||
// To properly handle some cases of component bounds, roundtrip through encoding again
|
||||
uint8_t tempColor[32];
|
||||
EncodeFormattedComponents(outFmt, v4, (byte *)tempColor);
|
||||
v4 = DecodeFormattedComponents(outFmt, tempColor);
|
||||
memcpy(mod.col.floatValue.data(), &v4, sizeof(v4));
|
||||
}
|
||||
}
|
||||
|
||||
float GetDepthValue(DXGI_FORMAT depthFormat, const D3D12PixelHistoryValue &value)
|
||||
|
||||
Reference in New Issue
Block a user