From 8b631d486c294771ad96000efa235e52da163bd1 Mon Sep 17 00:00:00 2001 From: vlj Date: Mon, 8 Jun 2015 16:59:11 +0200 Subject: [PATCH] d3d12: Fix build --- rpcs3/Emu/RSX/D3D12/D3D12.h | 8 ++++++++ rpcs3/Emu/RSX/D3D12/D3D12PipelineState.cpp | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/rpcs3/Emu/RSX/D3D12/D3D12.h b/rpcs3/Emu/RSX/D3D12/D3D12.h index d1598b7502..4538ca4b35 100644 --- a/rpcs3/Emu/RSX/D3D12/D3D12.h +++ b/rpcs3/Emu/RSX/D3D12/D3D12.h @@ -4,6 +4,8 @@ #include #include #include "utilities/Log.h" +#include "Emu/Memory/vm.h" +#include "Emu/RSX/GCM.h" inline void check(HRESULT hr) @@ -119,6 +121,7 @@ inline D3D12_BLEND_OP getBlendOp(u16 op) case CELL_GCM_FUNC_REVERSE_SUBTRACT: return D3D12_BLEND_OP_REV_SUBTRACT; case CELL_GCM_MIN: return D3D12_BLEND_OP_MIN; case CELL_GCM_MAX: return D3D12_BLEND_OP_MAX; + default: case CELL_GCM_FUNC_ADD_SIGNED: case CELL_GCM_FUNC_REVERSE_ADD_SIGNED: case CELL_GCM_FUNC_REVERSE_SUBTRACT_SIGNED: @@ -145,6 +148,7 @@ inline D3D12_BLEND getBlendFactor(u16 factor) case CELL_GCM_DST_COLOR: return D3D12_BLEND_DEST_COLOR; case CELL_GCM_ONE_MINUS_DST_COLOR: return D3D12_BLEND_INV_DEST_COLOR; case CELL_GCM_SRC_ALPHA_SATURATE: return D3D12_BLEND_SRC_ALPHA_SAT; + default: case CELL_GCM_CONSTANT_COLOR: case CELL_GCM_ONE_MINUS_CONSTANT_COLOR: case CELL_GCM_CONSTANT_ALPHA: @@ -194,6 +198,7 @@ inline D3D12_STENCIL_OP getStencilOp(u32 op) case CELL_GCM_REPLACE: return D3D12_STENCIL_OP_REPLACE; case CELL_GCM_INCR: return D3D12_STENCIL_OP_INCR; case CELL_GCM_DECR: return D3D12_STENCIL_OP_DECR; + default: case CELL_GCM_INCR_WRAP: case CELL_GCM_DECR_WRAP: LOG_WARNING(RSX, "Unsupported Stencil Op %d", op); @@ -216,6 +221,9 @@ inline D3D12_COMPARISON_FUNC getCompareFunc(u32 op) case CELL_GCM_NOTEQUAL: return D3D12_COMPARISON_FUNC_NOT_EQUAL; case CELL_GCM_GEQUAL: return D3D12_COMPARISON_FUNC_GREATER_EQUAL; case CELL_GCM_ALWAYS: return D3D12_COMPARISON_FUNC_ALWAYS; + default: + LOG_WARNING(RSX, "Unsupported Compare Op %d", op); + return D3D12_COMPARISON_FUNC(); } } diff --git a/rpcs3/Emu/RSX/D3D12/D3D12PipelineState.cpp b/rpcs3/Emu/RSX/D3D12/D3D12PipelineState.cpp index f6e2446015..06e76db2c7 100644 --- a/rpcs3/Emu/RSX/D3D12/D3D12PipelineState.cpp +++ b/rpcs3/Emu/RSX/D3D12/D3D12PipelineState.cpp @@ -211,19 +211,19 @@ bool D3D12GSRender::LoadProgram() prop.DepthStencil.DepthEnable = m_set_depth_test; prop.DepthStencil.DepthWriteMask = m_depth_mask ? D3D12_DEPTH_WRITE_MASK_ALL : D3D12_DEPTH_WRITE_MASK_ZERO; - prop.DepthStencil.DepthFunc = getDepthFunc(m_depth_func); + prop.DepthStencil.DepthFunc = getCompareFunc(m_depth_func); prop.DepthStencil.StencilEnable = m_set_stencil_test; prop.DepthStencil.StencilReadMask = m_stencil_func_mask; prop.DepthStencil.StencilWriteMask = m_stencil_mask; prop.DepthStencil.FrontFace.StencilPassOp = getStencilOp(m_stencil_zpass); prop.DepthStencil.FrontFace.StencilDepthFailOp = getStencilOp(m_stencil_zfail); prop.DepthStencil.FrontFace.StencilFailOp = getStencilOp(m_stencil_fail); - prop.DepthStencil.FrontFace.StencilFunc = getStencilFunc(m_stencil_func); + prop.DepthStencil.FrontFace.StencilFunc = getCompareFunc(m_stencil_func); if (m_set_two_sided_stencil_test_enable) { prop.DepthStencil.BackFace.StencilFailOp = getStencilOp(m_back_stencil_fail); - prop.DepthStencil.BackFace.StencilFunc = getStencilFunc(m_back_stencil_func); + prop.DepthStencil.BackFace.StencilFunc = getCompareFunc(m_back_stencil_func); prop.DepthStencil.BackFace.StencilPassOp = getStencilOp(m_back_stencil_zpass); prop.DepthStencil.BackFace.StencilDepthFailOp = getStencilOp(m_back_stencil_zfail); } @@ -232,7 +232,7 @@ bool D3D12GSRender::LoadProgram() prop.DepthStencil.BackFace.StencilPassOp = getStencilOp(m_stencil_zpass); prop.DepthStencil.BackFace.StencilDepthFailOp = getStencilOp(m_stencil_zfail); prop.DepthStencil.BackFace.StencilFailOp = getStencilOp(m_stencil_fail); - prop.DepthStencil.BackFace.StencilFunc = getStencilFunc(m_stencil_func); + prop.DepthStencil.BackFace.StencilFunc = getCompareFunc(m_stencil_func); } // Sensible default value