From 4f28d57352287e81774944ec42b009f1f88c6c00 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Mon, 25 Jun 2018 16:56:52 +0200 Subject: [PATCH] [dxvk] Remove unused rasterizer discard state flag --- src/d3d11/d3d11_rasterizer.cpp | 8 +------- src/dxgi/dxgi_presenter.cpp | 3 +-- src/dxvk/dxvk_constant_state.h | 3 +-- src/dxvk/dxvk_context.cpp | 5 ++--- src/dxvk/dxvk_graphics.cpp | 4 ++-- src/dxvk/dxvk_graphics.h | 5 ++--- src/dxvk/hud/dxvk_hud.cpp | 3 +-- 7 files changed, 10 insertions(+), 21 deletions(-) diff --git a/src/d3d11/d3d11_rasterizer.cpp b/src/d3d11/d3d11_rasterizer.cpp index 034fd19ca..eef07527e 100644 --- a/src/d3d11/d3d11_rasterizer.cpp +++ b/src/d3d11/d3d11_rasterizer.cpp @@ -8,9 +8,6 @@ namespace dxvk { const D3D11_RASTERIZER_DESC1& desc) : m_device(device), m_desc(desc) { - // State that is not supported in D3D11 - m_state.enableDiscard = VK_FALSE; - // Polygon mode. Determines whether the rasterizer fills // a polygon or renders lines connecting the vertices. m_state.polygonMode = VK_POLYGON_MODE_FILL; @@ -50,10 +47,7 @@ namespace dxvk { m_state.depthBiasConstant = static_cast(desc.DepthBias); m_state.depthBiasClamp = desc.DepthBiasClamp; m_state.depthBiasSlope = desc.SlopeScaledDepthBias; - m_state.enableDepthClamp = desc.DepthClipEnable ? VK_FALSE : VK_TRUE; - - if (!desc.DepthClipEnable) - Logger::warn("D3D11RasterizerState: Depth clamp not properly supported"); + m_state.depthClampEnable = desc.DepthClipEnable ? VK_FALSE : VK_TRUE; if (desc.AntialiasedLineEnable) Logger::err("D3D11RasterizerState: Antialiased lines not supported"); diff --git a/src/dxgi/dxgi_presenter.cpp b/src/dxgi/dxgi_presenter.cpp index b708119d1..b4885b28f 100644 --- a/src/dxgi/dxgi_presenter.cpp +++ b/src/dxgi/dxgi_presenter.cpp @@ -52,11 +52,10 @@ namespace dxvk { 0, nullptr, 0, nullptr); DxvkRasterizerState rsState; - rsState.enableDepthClamp = VK_FALSE; - rsState.enableDiscard = VK_FALSE; rsState.polygonMode = VK_POLYGON_MODE_FILL; rsState.cullMode = VK_CULL_MODE_BACK_BIT; rsState.frontFace = VK_FRONT_FACE_COUNTER_CLOCKWISE; + rsState.depthClampEnable = VK_FALSE; rsState.depthBiasEnable = VK_FALSE; rsState.depthBiasConstant = 0.0f; rsState.depthBiasClamp = 0.0f; diff --git a/src/dxvk/dxvk_constant_state.h b/src/dxvk/dxvk_constant_state.h index 4fed3c48b..13da894c6 100644 --- a/src/dxvk/dxvk_constant_state.h +++ b/src/dxvk/dxvk_constant_state.h @@ -40,11 +40,10 @@ namespace dxvk { * rasterizer, including the depth bias. */ struct DxvkRasterizerState { - VkBool32 enableDepthClamp; - VkBool32 enableDiscard; VkPolygonMode polygonMode; VkCullModeFlags cullMode; VkFrontFace frontFace; + VkBool32 depthClampEnable; VkBool32 depthBiasEnable; float depthBiasConstant; float depthBiasClamp; diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index f39c22ab3..1e169e78a 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -1581,12 +1581,11 @@ namespace dxvk { void DxvkContext::setRasterizerState(const DxvkRasterizerState& rs) { - m_state.gp.state.rsEnableDepthClamp = rs.enableDepthClamp; - m_state.gp.state.rsEnableDiscard = rs.enableDiscard; + m_state.gp.state.rsDepthClampEnable = rs.depthClampEnable; + m_state.gp.state.rsDepthBiasEnable = rs.depthBiasEnable; m_state.gp.state.rsPolygonMode = rs.polygonMode; m_state.gp.state.rsCullMode = rs.cullMode; m_state.gp.state.rsFrontFace = rs.frontFace; - m_state.gp.state.rsDepthBiasEnable = rs.depthBiasEnable; m_state.ds.depthBiasConstant = rs.depthBiasConstant; m_state.ds.depthBiasClamp = rs.depthBiasClamp; diff --git a/src/dxvk/dxvk_graphics.cpp b/src/dxvk/dxvk_graphics.cpp index 015ba2549..b5f41997a 100644 --- a/src/dxvk/dxvk_graphics.cpp +++ b/src/dxvk/dxvk_graphics.cpp @@ -285,8 +285,8 @@ namespace dxvk { rsInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO; rsInfo.pNext = nullptr; rsInfo.flags = 0; - rsInfo.depthClampEnable = state.rsEnableDepthClamp; - rsInfo.rasterizerDiscardEnable= state.rsEnableDiscard; + rsInfo.depthClampEnable = state.rsDepthClampEnable; + rsInfo.rasterizerDiscardEnable= VK_FALSE; rsInfo.polygonMode = state.rsPolygonMode; rsInfo.cullMode = state.rsCullMode; rsInfo.frontFace = state.rsFrontFace; diff --git a/src/dxvk/dxvk_graphics.h b/src/dxvk/dxvk_graphics.h index 0dd8ed2bd..cd860b399 100644 --- a/src/dxvk/dxvk_graphics.h +++ b/src/dxvk/dxvk_graphics.h @@ -47,12 +47,11 @@ namespace dxvk { VkVertexInputBindingDescription ilBindings[DxvkLimits::MaxNumVertexBindings]; uint32_t ilDivisors[DxvkLimits::MaxNumVertexBindings]; - VkBool32 rsEnableDepthClamp; - VkBool32 rsEnableDiscard; + VkBool32 rsDepthClampEnable; + VkBool32 rsDepthBiasEnable; VkPolygonMode rsPolygonMode; VkCullModeFlags rsCullMode; VkFrontFace rsFrontFace; - VkBool32 rsDepthBiasEnable; uint32_t rsViewportCount; VkSampleCountFlagBits msSampleCount; diff --git a/src/dxvk/hud/dxvk_hud.cpp b/src/dxvk/hud/dxvk_hud.cpp index c594cfc67..5b7858fcf 100644 --- a/src/dxvk/hud/dxvk_hud.cpp +++ b/src/dxvk/hud/dxvk_hud.cpp @@ -177,11 +177,10 @@ namespace dxvk::hud { void Hud::setupConstantState() { DxvkRasterizerState rsState; - rsState.enableDepthClamp = VK_FALSE; - rsState.enableDiscard = VK_FALSE; rsState.polygonMode = VK_POLYGON_MODE_FILL; rsState.cullMode = VK_CULL_MODE_BACK_BIT; rsState.frontFace = VK_FRONT_FACE_CLOCKWISE; + rsState.depthClampEnable = VK_FALSE; rsState.depthBiasEnable = VK_FALSE; rsState.depthBiasConstant = 0.0f; rsState.depthBiasClamp = 0.0f;