diff options
| author | Rodolfo Osvaldo Bogado <rodolfoosvaldobogado@gmail.com> | 2009-12-07 18:48:31 +0000 |
|---|---|---|
| committer | Rodolfo Osvaldo Bogado <rodolfoosvaldobogado@gmail.com> | 2009-12-07 18:48:31 +0000 |
| commit | d02426a8e9c6a0815e033aa48a9506151aaf5c86 (patch) | |
| tree | f65d4098b99366ccd2cdcc974b052fc36acc72ee /Source/Core/VideoCommon/Src/TextureConversionShader.cpp | |
| parent | 85a9b3dc2c51a08911c48ff9741b378336081a93 (diff) | |
mixed commit:
in D3D and Opengl:
fixed one nasty bug in texture loading where if a dynamic texture keeps his format but the tlut format is changed, the try or reloading the texture in the same texture could cause a hang if the size of the resulting texture is different than the original (size in bytes)
Applied a ugly temporal hack to the texture conversor to solve efb to ram misalignments and effect distortions.
in D3D:
Pseudo implementation of logic ops using basic blending: the first 8 operations are "good approximations", the remaining 8 are bullshit :) if someone have a better approximation to emulate this logic please let me know.
please test if i don't break anything in the process and test Mario kart wee you will get a nice surprise.:)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4656 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/TextureConversionShader.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Src/TextureConversionShader.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/Source/Core/VideoCommon/Src/TextureConversionShader.cpp b/Source/Core/VideoCommon/Src/TextureConversionShader.cpp index 4db14bdeaa..eb6b83e234 100644 --- a/Source/Core/VideoCommon/Src/TextureConversionShader.cpp +++ b/Source/Core/VideoCommon/Src/TextureConversionShader.cpp @@ -107,12 +107,16 @@ void WriteSwizzler(char*& p, u32 format,bool HLSL) if(!HLSL) WRITE(p," sampleUv.y = textureDims.y - sampleUv.y;\n"); - WRITE(p, " sampleUv.x = sampleUv.x + textureDims.z;\n" - " sampleUv.y = sampleUv.y + textureDims.w;\n"); + WRITE(p, " sampleUv = sampleUv + textureDims.zw;\n"); + if(HLSL) { - WRITE(p, " sampleUv.x = sampleUv.x / blkDims.z;\n" - " sampleUv.y = sampleUv.y / blkDims.w;\n"); + WRITE(p, " sampleUv = sampleUv + float2(1.0f,1.0f);\n" + " sampleUv = sampleUv / blkDims.zw;\n"); + } + else + { + WRITE(p, " sampleUv = sampleUv + float2(1.0f,-1.0f);\n"); } } @@ -158,15 +162,18 @@ void Write32BitSwizzler(char*& p, u32 format, bool HLSL) WRITE(p, " sampleUv = sampleUv * blkDims.xy;\n"); if(!HLSL) - WRITE(p, " sampleUv.y = textureDims.y - sampleUv.y;\n"); + WRITE(p," sampleUv.y = textureDims.y - sampleUv.y;\n"); - WRITE(p, " sampleUv.x = sampleUv.x + textureDims.z;\n"); - WRITE(p, " sampleUv.y = sampleUv.y + textureDims.w;\n"); + WRITE(p, " sampleUv = sampleUv + textureDims.zw;\n"); if(HLSL) { - WRITE(p, " sampleUv.x = sampleUv.x / blkDims.z;\n" - " sampleUv.y = sampleUv.y / blkDims.w;\n"); + WRITE(p, " sampleUv = sampleUv + float2(1.0f,1.0f);\n" + " sampleUv = sampleUv / blkDims.zw;\n"); + } + else + { + WRITE(p, " sampleUv = sampleUv + float2(1.0f,-1.0f);\n"); } } |
