From 35a9934cded3a20283150a8d9bdfbefce08d375f Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Sat, 18 Jan 2020 03:10:33 +0000 Subject: [PATCH] [d3d9] Make unbound textures return (0, 0, 0, 1) (fixed func) Fixes sky in Ferentus Herrcot Xiones https://github.com/Joshua-Ashton/d9vk/issues/306 --- src/d3d9/d3d9_fixed_function.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/d3d9/d3d9_fixed_function.cpp b/src/d3d9/d3d9_fixed_function.cpp index 12ad53d4..f45577ae 100644 --- a/src/d3d9/d3d9_fixed_function.cpp +++ b/src/d3d9/d3d9_fixed_function.cpp @@ -1564,6 +1564,8 @@ namespace dxvk { texture = m_module.opImageSampleProjImplicitLod(m_vec4Type, imageVarId, texcoord, imageOperands); else texture = m_module.opImageSampleImplicitLod(m_vec4Type, imageVarId, texcoord, imageOperands); + + texture = m_module.opSelect(m_vec4Type, m_ps.samplers[i].bound, texture, m_module.constvec4f32(0.0f, 0.0f, 0.0f, 1.0f)); } processedTexture = true; @@ -1992,6 +1994,11 @@ namespace dxvk { const uint32_t bindingId = computeResourceSlotId(DxsoProgramType::PixelShader, DxsoBindingType::ColorImage, i); + sampler.bound = m_module.specConstBool(true); + m_module.decorateSpecId(sampler.bound, bindingId); + m_module.setDebugName(sampler.bound, + str::format("s", i, "_bound").c_str()); + m_module.decorateDescriptorSet(sampler.varId, 0); m_module.decorateBinding(sampler.varId, bindingId);