summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTriang3l <triang3l@yandex.ru>2020-11-20 23:12:12 +0300
committerTriang3l <triang3l@yandex.ru>2020-11-20 23:12:12 +0300
commit00a7d1a067793ce230572117759531ab33ee74a2 (patch)
treede89e6da792314ace06b382891aac9cf492b45f7
parent44a3f200c38abbb8fda7c0af02aae22399130d09 (diff)
[D3D12] Cleanup rasterizer state
-rw-r--r--src/xenia/gpu/d3d12/pipeline_cache.cc24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/xenia/gpu/d3d12/pipeline_cache.cc b/src/xenia/gpu/d3d12/pipeline_cache.cc
index e69299f3d..b36ecfea8 100644
--- a/src/xenia/gpu/d3d12/pipeline_cache.cc
+++ b/src/xenia/gpu/d3d12/pipeline_cache.cc
@@ -1305,17 +1305,11 @@ bool PipelineCache::GetCurrentStateDescription(
// Here we also assume that only one side is culled - if two sides are culled,
// the D3D12 command processor will drop such draw early.
bool cull_front, cull_back;
- if (primitive_polygonal) {
- cull_front = pa_su_sc_mode_cntl.cull_front != 0;
- cull_back = pa_su_sc_mode_cntl.cull_back != 0;
- } else {
- // Non-polygonal primitives are never culled.
- cull_front = false;
- cull_back = false;
- }
float poly_offset = 0.0f, poly_offset_scale = 0.0f;
if (primitive_polygonal) {
description_out.front_counter_clockwise = pa_su_sc_mode_cntl.face == 0;
+ cull_front = pa_su_sc_mode_cntl.cull_front != 0;
+ cull_back = pa_su_sc_mode_cntl.cull_back != 0;
if (cull_front) {
description_out.cull_mode = PipelineCullMode::kFront;
} else if (cull_back) {
@@ -1328,8 +1322,8 @@ bool PipelineCache::GetCurrentStateDescription(
if (!cull_front) {
// Front faces aren't culled.
// Direct3D 12, unfortunately, doesn't support point fill mode.
- if (primitive_polygonal && pa_su_sc_mode_cntl.polymode_front_ptype !=
- xenos::PolygonType::kTriangles) {
+ if (pa_su_sc_mode_cntl.polymode_front_ptype !=
+ xenos::PolygonType::kTriangles) {
description_out.fill_mode_wireframe = 1;
}
if (!edram_rov_used_ && pa_su_sc_mode_cntl.poly_offset_front_enable) {
@@ -1339,8 +1333,8 @@ bool PipelineCache::GetCurrentStateDescription(
}
if (!cull_back) {
// Back faces aren't culled.
- if (primitive_polygonal && pa_su_sc_mode_cntl.polymode_back_ptype !=
- xenos::PolygonType::kTriangles) {
+ if (pa_su_sc_mode_cntl.polymode_back_ptype !=
+ xenos::PolygonType::kTriangles) {
description_out.fill_mode_wireframe = 1;
}
// Prefer front depth bias because in general, front faces are the ones
@@ -1355,9 +1349,9 @@ bool PipelineCache::GetCurrentStateDescription(
description_out.fill_mode_wireframe = 0;
}
} else {
- // Filled front faces only.
- // Use front depth bias if POLY_OFFSET_PARA_ENABLED
- // (POLY_OFFSET_FRONT_ENABLED is for two-sided primitives).
+ // Filled front faces only, without culling.
+ cull_front = false;
+ cull_back = false;
if (!edram_rov_used_ && pa_su_sc_mode_cntl.poly_offset_para_enable) {
poly_offset = regs[XE_GPU_REG_PA_SU_POLY_OFFSET_FRONT_OFFSET].f32;
poly_offset_scale = regs[XE_GPU_REG_PA_SU_POLY_OFFSET_FRONT_SCALE].f32;