From 5d4d32c6130322a63af2fec5b33a625f154ddfb4 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sun, 21 Feb 2021 02:20:14 +0100 Subject: [PATCH] [d3d11] Remove explicit spec constant for gamma texture No longer needed. --- src/d3d11/d3d11_swapchain.cpp | 3 --- src/dxgi/shaders/dxgi_presenter_frag.frag | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/d3d11/d3d11_swapchain.cpp b/src/d3d11/d3d11_swapchain.cpp index 2acd1680..1742cf0c 100644 --- a/src/d3d11/d3d11_swapchain.cpp +++ b/src/d3d11/d3d11_swapchain.cpp @@ -348,10 +348,7 @@ namespace dxvk { m_context->bindResourceView(BindingIds::Image, m_swapImageView, nullptr); m_context->bindResourceView(BindingIds::Gamma, m_gammaTextureView, nullptr); - - m_context->setSpecConstant(VK_PIPELINE_BIND_POINT_GRAPHICS, 0, m_gammaTextureView != nullptr); m_context->draw(3, 1, 0, 0); - m_context->setSpecConstant(VK_PIPELINE_BIND_POINT_GRAPHICS, 0, 0); if (m_hud != nullptr) m_hud->render(m_context, info.format, info.imageExtent); diff --git a/src/dxgi/shaders/dxgi_presenter_frag.frag b/src/dxgi/shaders/dxgi_presenter_frag.frag index 0965c412..e52a0d76 100644 --- a/src/dxgi/shaders/dxgi_presenter_frag.frag +++ b/src/dxgi/shaders/dxgi_presenter_frag.frag @@ -1,6 +1,6 @@ #version 450 -layout(constant_id = 1225) const bool c_has_gamma = false; +layout(constant_id = 1) const bool s_gamma_bound = true; layout(binding = 0) uniform sampler2D s_image; layout(binding = 1) uniform sampler1D s_gamma; @@ -11,7 +11,7 @@ layout(location = 0) out vec4 o_color; void main() { o_color = texture(s_image, i_texcoord); - if (c_has_gamma) { + if (s_gamma_bound) { o_color = vec4( texture(s_gamma, o_color.r).r, texture(s_gamma, o_color.g).g,