Merge pull request #17332 from hrydgard/socom-texcoord-issue

Fix texcoord issue with SOCOM post effect
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2023-04-27 08:41:28 +02:00
commit 26d0128896
3 files changed
+11 -5

No files matched your search

+1 -1
View File
@@ -2613,7 +2613,7 @@ static SceUID sceKernelLoadModuleBufferUsbWlan(u32 size, u32 bufPtr, u32 flags,
static u32 sceKernelQueryModuleInfo(u32 uid, u32 infoAddr)
{
INFO_LOG(SCEMODULE, "sceKernelQueryModuleInfo(%i, %08x)", uid, infoAddr);
DEBUG_LOG(SCEMODULE, "sceKernelQueryModuleInfo(%i, %08x)", uid, infoAddr);
u32 error;
PSPModule *module = kernelObjects.Get<PSPModule>(uid, error);
if (!module)
+8 -2
View File
@@ -249,7 +249,8 @@ void GenerateDepalShaderFloat(ShaderWriter &writer, const DepalConfig &config) {
break;
case GE_FORMAT_5551:
if (config.textureFormat == GE_TFMT_CLUT8 && mask == 0xFF && shift == 0) {
sprintf(lookupMethod, "(index.a * 128.0 + index.b * 64.0 + index.g * 4.0)"); // we just skip A.
// Follow the intent here, and ignore g (and let's not round unnecessarily).
sprintf(lookupMethod, "floor(floor(index.a) * 128.0 + index.b * 64.0)"); // we just skip A.
index_multiplier = 1.0f / 256.0f;
// SOCOM case. #16210
} else if ((mask & (mask + 1)) == 0 && shift < 16) {
@@ -373,7 +374,12 @@ void GenerateDepalFs(ShaderWriter &writer, const DepalConfig &config) {
case GLSL_VULKAN:
case GLSL_3xx:
case HLSL_D3D11:
GenerateDepalShader300(writer, config);
// Use the float shader for the SOCOM special.
if (config.bufferFormat == GE_FORMAT_5551 && config.textureFormat == GE_TFMT_CLUT8) {
GenerateDepalShaderFloat(writer, config);
} else {
GenerateDepalShader300(writer, config);
}
break;
default:
_assert_msg_(false, "Shader language not supported for depal: %d", (int)writer.Lang().shaderLanguage);
+2 -2
View File
@@ -2315,9 +2315,9 @@ void TextureCacheCommon::ApplyTextureFramebuffer(VirtualFramebuffer *framebuffer
bool needsDepthXSwizzle = depthUpperBits == 2;
int depalWidth = framebuffer->renderWidth;
int texWidth = framebuffer->width;
int texWidth = framebuffer->bufferWidth;
if (needsDepthXSwizzle) {
texWidth = RoundUpToPowerOf2(framebuffer->width);
texWidth = RoundUpToPowerOf2(framebuffer->bufferWidth);
depalWidth = texWidth * framebuffer->renderScaleFactor;
gstate_c.Dirty(DIRTY_UVSCALEOFFSET);
}