diff --git a/src/d3d11/d3d11_swapchain.cpp b/src/d3d11/d3d11_swapchain.cpp index d12a251c4..9b3f39ade 100644 --- a/src/d3d11/d3d11_swapchain.cpp +++ b/src/d3d11/d3d11_swapchain.cpp @@ -348,7 +348,9 @@ 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 e52a0d765..b014d51d3 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 = 1) const bool s_gamma_bound = true; +layout(constant_id = 1249) const bool c_has_gamma = false; 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 (s_gamma_bound) { + if (c_has_gamma) { o_color = vec4( texture(s_gamma, o_color.r).r, texture(s_gamma, o_color.g).g,