diff options
| author | donkopunchstania <donkopunchstania@gmail.com> | 2009-03-01 00:57:39 +0000 |
|---|---|---|
| committer | donkopunchstania <donkopunchstania@gmail.com> | 2009-03-01 00:57:39 +0000 |
| commit | e004800e684d9aab16b1e9eb5f58c9e2b6146cee (patch) | |
| tree | 0d95b103e159ca06d5def03063aee417c005b147 /Source/Core/VideoCommon/Src/PixelShaderGen.cpp | |
| parent | 5b033732b8baf15f07e363d7b6fbeea24a0387df (diff) | |
An alert is displayed once per run if pixel shaders or vertex shaders fail to compile. Resources are cleaned up if shader compilation fails. Tev coords are zeroed in the pixel shader if there are no tex gens.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2493 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/PixelShaderGen.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Src/PixelShaderGen.cpp | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp index c1e68f2279..c13d580106 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp @@ -712,25 +712,24 @@ static void WriteStage(char *&p, int n, u32 texture_mask) if(!bHasIndStage) { // calc tevcord //tevcoord.xy = texdim[1].xy * uv1.xy / uv1.z; - int OurTexCoord = 0; - if(bpmem.genMode.numtexgens) - OurTexCoord = texcoord; - else - OurTexCoord = 0; - if (texture_mask & (1<<texmap)) { - // nonpow2 - if (texfun == XF_TEXPROJ_STQ ) - WRITE(p, "tevcoord.xy = uv%d.xy / uv%d.z;\n", texcoord, OurTexCoord); - else - WRITE(p, "tevcoord.xy = uv%d.xy;\n", OurTexCoord); - WrapNonPow2Tex(p, "tevcoord", texmap, texture_mask); - } - else { - if (texfun == XF_TEXPROJ_STQ ) - WRITE(p, "tevcoord.xy = "I_TEXDIMS"[%d].xy * uv%d.xy / uv%d.z;\n", texmap, OurTexCoord , OurTexCoord ); - else - WRITE(p, "tevcoord.xy = "I_TEXDIMS"[%d].xy * uv%d.xy;\n", texmap, OurTexCoord); - + if(bpmem.genMode.numtexgens) { + if (texture_mask & (1<<texmap)) { + // nonpow2 + if (texfun == XF_TEXPROJ_STQ ) + WRITE(p, "tevcoord.xy = uv%d.xy / uv%d.z;\n", texcoord, texcoord); + else + WRITE(p, "tevcoord.xy = uv%d.xy;\n", texcoord); + WrapNonPow2Tex(p, "tevcoord", texmap, texture_mask); + } + else { + if (texfun == XF_TEXPROJ_STQ ) + WRITE(p, "tevcoord.xy = "I_TEXDIMS"[%d].xy * uv%d.xy / uv%d.z;\n", texmap, texcoord , texcoord ); + else + WRITE(p, "tevcoord.xy = "I_TEXDIMS"[%d].xy * uv%d.xy;\n", texmap, texcoord); + } + } else { + // donkopunchstania - check that this is correct when there are no tex gens + WRITE(p, "tevcoord.xy = float2(0.0f,0.0f);\n"); } } else if (texture_mask & (1<<texmap)) { |
