1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 20:52:10 +01:00

[d3d11] Use explicit spec constant for gamma texture

With null descriptors, the "bound" spec constants would always be 1.
This commit is contained in:
Philip Rebohle 2020-04-27 11:09:41 +02:00 committed by Philip Rebohle
parent 7b8a65589e
commit 80009831d4
2 changed files with 4 additions and 2 deletions

View File

@ -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);

View File

@ -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,