diff options
| author | Rodolfo Osvaldo Bogado <rodolfoosvaldobogado@gmail.com> | 2009-11-08 20:35:11 +0000 |
|---|---|---|
| committer | Rodolfo Osvaldo Bogado <rodolfoosvaldobogado@gmail.com> | 2009-11-08 20:35:11 +0000 |
| commit | 0ac07e8aa8edfd28c1ca5c357fdd9f17a2a2dbde (patch) | |
| tree | 16eef889bc0ffa56b8b91a5d92fa58d91a4d036a /Source/Core/VideoCommon/Src | |
| parent | 84c6135bfdfdb48455271cf4656481f845143327 (diff) | |
Big Commit this will break a lot, fix a lot, but i thing is a good step:
Implemented all the correct format conversions in efb to texture copy.
replaced all the stretcrect calls with quad draws this must improve speed a bit.
A BIGGGGGGGGGG cleanup in the code and reorganization.
reimplemented zpeek using a secondary render target ( this still is buggy so many issues left)
please a lot off feedback.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4520 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src')
| -rw-r--r-- | Source/Core/VideoCommon/Src/PixelShaderGen.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp index a4acddc40b..0d585aca2d 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp @@ -451,7 +451,9 @@ const char *GeneratePixelShader(u32 texture_mask, bool dstAlphaEnable, bool HLSL WRITE(p, "void main(\n"); - WRITE(p, " out half4 ocol0 : COLOR0,\n"); + WRITE(p, " out float4 ocol0 : COLOR0,\n"); + if (HLSL) + WRITE(p, " out float4 ocol1 : COLOR1,\n"); WRITE(p, " out float depth : DEPTH,\n"); // compute window position if needed because binding semantic WPOS is not widely supported @@ -522,12 +524,20 @@ const char *GeneratePixelShader(u32 texture_mask, bool dstAlphaEnable, bool HLSL // use the texture input of the last texture stage (textemp), hopefully this has been read and is in correct format... if (bpmem.ztex2.op == ZTEXTURE_ADD) - WRITE(p, "depth = frac(dot("I_ZBIAS"[0].xyzw, textemp.xyzw) + "I_ZBIAS"[1].w + zCoord);\n"); + WRITE(p, "zCoord = frac(dot("I_ZBIAS"[0].xyzw, textemp.xyzw) + "I_ZBIAS"[1].w + zCoord);\n"); else if (bpmem.ztex2.op == ZTEXTURE_REPLACE) - WRITE(p, "depth = frac(dot("I_ZBIAS"[0].xyzw, textemp.xyzw) + "I_ZBIAS"[1].w);\n"); - else - WRITE(p, "depth = zCoord;\n"); + WRITE(p, "zCoord = frac(dot("I_ZBIAS"[0].xyzw, textemp.xyzw) + "I_ZBIAS"[1].w);\n"); + + WRITE(p, "depth = zCoord;\n"); + if(HLSL) + { + //WRITE(p, "ocol1 = float4(1.0f/255.0f,2.0f/255.0f,3.0f/255.0f,0.0f);\n"); + WRITE(p, "float4 EncodedDepth = frac(zCoord * float4(254.0f*255.0f,255.0f,254.0f/255.0f,254.0f*255.0f*255.0f));\n"); + //WRITE(p, "EncodedDepth -= EncodedDepth.aarg * float4(1.0f/255.0f,1.0f/255.0f,1.0f/255.0f,0.0f);\n"); + WRITE(p, "ocol1 = EncodedDepth;\n"); + + } //if (bpmem.genMode.numindstages ) WRITE(p, "prev.rg = indtex0.xy;\nprev.b = 0;\n"); if (!WriteAlphaTest(p, HLSL)) |
