mirror of
https://github.com/xenia-project/xenia.git
synced 2026-07-11 01:24:34 +02:00
[GPU/D3D12] Convert gamma-as-linear red to gamma in transfers to stencil
Co-authored-by: Herman S. <429230+has207@users.noreply.github.com>
This commit is contained in:
@@ -3621,22 +3621,21 @@ D3D12RenderTargetCache::GetOrCreateTransferPipelines(TransferShaderKey key) {
|
|||||||
}
|
}
|
||||||
a.OpMov(dxbc::Dest::O(0), dxbc::Src::R(1));
|
a.OpMov(dxbc::Dest::O(0), dxbc::Src::R(1));
|
||||||
} else if (mode.output == TransferOutput::kDepth) {
|
} else if (mode.output == TransferOutput::kDepth) {
|
||||||
|
// When need only depth, not stencil, skipping the red component.
|
||||||
if (source_color_format ==
|
if (source_color_format ==
|
||||||
xenos::ColorRenderTargetFormat::k_8_8_8_8_GAMMA) {
|
xenos::ColorRenderTargetFormat::k_8_8_8_8_GAMMA) {
|
||||||
for (uint32_t i = 1; i < 3; ++i) {
|
for (uint32_t i = shader_uses_stencil_reference_output ? 0 : 1;
|
||||||
|
i < 3; ++i) {
|
||||||
DxbcShaderTranslator::PreSaturatedLinearToPWLGamma(
|
DxbcShaderTranslator::PreSaturatedLinearToPWLGamma(
|
||||||
a, 1, i, 1, i, 2, 0, 2, 1);
|
a, 1, i, 1, i, 2, 0, 2, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// When need only depth, not stencil, skip the red component.
|
a.OpMAd(
|
||||||
a.OpMAd(dxbc::Dest::R(
|
dxbc::Dest::R(
|
||||||
1, osgn_parameter_index_sv_stencil_ref != UINT32_MAX
|
1, shader_uses_stencil_reference_output ? 0b1111 : 0b1110),
|
||||||
? 0b1111
|
dxbc::Src::R(1), dxbc::Src::LF(255.0f), dxbc::Src::LF(0.5f));
|
||||||
: 0b1110),
|
|
||||||
dxbc::Src::R(1), dxbc::Src::LF(255.0f),
|
|
||||||
dxbc::Src::LF(0.5f));
|
|
||||||
a.OpFToU(dxbc::Dest::R(1, 0b1110), dxbc::Src::R(1));
|
a.OpFToU(dxbc::Dest::R(1, 0b1110), dxbc::Src::R(1));
|
||||||
if (osgn_parameter_index_sv_stencil_ref != UINT32_MAX) {
|
if (shader_uses_stencil_reference_output) {
|
||||||
// Write the red component to the stencil reference.
|
// Write the red component to the stencil reference.
|
||||||
a.OpFToU(dxbc::Dest::OStencilRef(),
|
a.OpFToU(dxbc::Dest::OStencilRef(),
|
||||||
dxbc::Src::R(1, dxbc::Src::kXXXX));
|
dxbc::Src::R(1, dxbc::Src::kXXXX));
|
||||||
|
|||||||
Reference in New Issue
Block a user