From abbab23814b06dbf0f9a21cb2b43bcce6e9faaa7 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 6 May 2018 08:58:54 -0700 Subject: [PATCH] D3D11: Use a dedicated slot for the depal texture. Otherwise it affects shader blending. --- GPU/Common/DepalettizeShaderCommon.cpp | 2 +- GPU/D3D11/TextureCacheD3D11.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/GPU/Common/DepalettizeShaderCommon.cpp b/GPU/Common/DepalettizeShaderCommon.cpp index 0ff61cc995..c65db54599 100644 --- a/GPU/Common/DepalettizeShaderCommon.cpp +++ b/GPU/Common/DepalettizeShaderCommon.cpp @@ -36,7 +36,7 @@ void GenerateDepalShader300(char *buffer, GEBufferFormat pixelFormat, ShaderLang if (language == HLSL_D3D11) { WRITE(p, "SamplerState texSamp : register(s0);\n"); WRITE(p, "Texture2D tex : register(t0);\n"); - WRITE(p, "Texture2D pal : register(t1);\n"); + WRITE(p, "Texture2D pal : register(t3);\n"); } else if (language == GLSL_VULKAN) { WRITE(p, "#version 140\n"); WRITE(p, "#extension GL_ARB_separate_shader_objects : enable\n"); diff --git a/GPU/D3D11/TextureCacheD3D11.cpp b/GPU/D3D11/TextureCacheD3D11.cpp index 4c9cc96575..3759e9c758 100644 --- a/GPU/D3D11/TextureCacheD3D11.cpp +++ b/GPU/D3D11/TextureCacheD3D11.cpp @@ -398,7 +398,8 @@ void TextureCacheD3D11::ApplyTextureFramebuffer(TexCacheEntry *entry, VirtualFra shaderApply.ApplyBounds(gstate_c.vertBounds, gstate_c.curTextureXOffset, gstate_c.curTextureYOffset, xoff, yoff); shaderApply.Use(depalShaderCache_->GetDepalettizeVertexShader(), depalShaderCache_->GetInputLayout()); - context_->PSSetShaderResources(1, 1, &clutTexture); + context_->PSSetShaderResources(3, 1, &clutTexture); + context_->PSSetSamplers(3, 1, &stockD3D11.samplerPoint2DWrap); framebufferManagerD3D11_->BindFramebufferAsColorTexture(0, framebuffer, BINDFBCOLOR_SKIP_COPY); context_->PSSetSamplers(0, 1, &stockD3D11.samplerPoint2DWrap); draw_->BindFramebufferAsRenderTarget(depalFBO, { Draw::RPAction::DONT_CARE, Draw::RPAction::DONT_CARE, Draw::RPAction::DONT_CARE });