mirror of
https://github.com/xenia-project/xenia.git
synced 2025-12-06 07:12:03 +01:00
[D3D12] Added workaround for broken Geometry Shader in AMD 7900 Series GPU
This commit is contained in:
parent
26415cb8b1
commit
2afd2cc4d6
|
|
@ -61,6 +61,10 @@ DEFINE_int32(
|
||||||
DEFINE_bool(d3d12_tessellation_wireframe, false,
|
DEFINE_bool(d3d12_tessellation_wireframe, false,
|
||||||
"Display tessellated surfaces as wireframe for debugging.",
|
"Display tessellated surfaces as wireframe for debugging.",
|
||||||
"D3D12");
|
"D3D12");
|
||||||
|
DEFINE_bool(d3d12_remove_retc_from_geometry_shader, false,
|
||||||
|
"[ONLY FOR AMD 7900 Series GPU] Workaround for broken Geometry "
|
||||||
|
"Shader. Warning! Might cause issues and hardlocks!",
|
||||||
|
"D3D12");
|
||||||
|
|
||||||
namespace xe {
|
namespace xe {
|
||||||
namespace gpu {
|
namespace gpu {
|
||||||
|
|
@ -2404,8 +2408,10 @@ void PipelineCache::CreateDxbcGeometryShader(
|
||||||
dxbc::Src::R(0, 0b1110));
|
dxbc::Src::R(0, 0b1110));
|
||||||
a.OpOr(dxbc::Dest::R(0, 0b0001), dxbc::Src::R(0, dxbc::Src::kXXXX),
|
a.OpOr(dxbc::Dest::R(0, 0b0001), dxbc::Src::R(0, dxbc::Src::kXXXX),
|
||||||
dxbc::Src::R(0, dxbc::Src::kYYYY));
|
dxbc::Src::R(0, dxbc::Src::kYYYY));
|
||||||
|
if (!cvars::d3d12_remove_retc_from_geometry_shader) {
|
||||||
a.OpRetC(true, dxbc::Src::R(0, dxbc::Src::kXXXX));
|
a.OpRetC(true, dxbc::Src::R(0, dxbc::Src::kXXXX));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Cull the whole primitive if any cull distance for all vertices in the
|
// Cull the whole primitive if any cull distance for all vertices in the
|
||||||
// primitive is < 0.
|
// primitive is < 0.
|
||||||
|
|
@ -2430,9 +2436,11 @@ void PipelineCache::CreateDxbcGeometryShader(
|
||||||
a.OpAnd(dxbc::Dest::R(0, 0b0001), dxbc::Src::R(0, dxbc::Src::kXXXX),
|
a.OpAnd(dxbc::Dest::R(0, 0b0001), dxbc::Src::R(0, dxbc::Src::kXXXX),
|
||||||
dxbc::Src::R(0, dxbc::Src::kYYYY));
|
dxbc::Src::R(0, dxbc::Src::kYYYY));
|
||||||
}
|
}
|
||||||
|
if (!cvars::d3d12_remove_retc_from_geometry_shader) {
|
||||||
a.OpRetC(true, dxbc::Src::R(0, dxbc::Src::kXXXX));
|
a.OpRetC(true, dxbc::Src::R(0, dxbc::Src::kXXXX));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch (key.type) {
|
switch (key.type) {
|
||||||
case PipelineGeometryShader::kPointList: {
|
case PipelineGeometryShader::kPointList: {
|
||||||
|
|
@ -2473,8 +2481,10 @@ void PipelineCache::CreateDxbcGeometryShader(
|
||||||
for (uint32_t i = 0; i < 2; ++i) {
|
for (uint32_t i = 0; i < 2; ++i) {
|
||||||
a.OpLT(dxbc::Dest::R(0, 0b0100), dxbc::Src::LF(0.0f),
|
a.OpLT(dxbc::Dest::R(0, 0b0100), dxbc::Src::LF(0.0f),
|
||||||
point_size_src.SelectFromSwizzled(i));
|
point_size_src.SelectFromSwizzled(i));
|
||||||
|
if (!cvars::d3d12_remove_retc_from_geometry_shader) {
|
||||||
a.OpRetC(false, dxbc::Src::R(0, dxbc::Src::kZZZZ));
|
a.OpRetC(false, dxbc::Src::R(0, dxbc::Src::kZZZZ));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Transform the diameter in the guest screen coordinates to radius in the
|
// Transform the diameter in the guest screen coordinates to radius in the
|
||||||
// normalized device coordinates, and then to the clip space by
|
// normalized device coordinates, and then to the clip space by
|
||||||
// multiplying by W.
|
// multiplying by W.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue