Some optimization on the pixel and vertex shader generators. As tested on Zelda TP, these changes should be able to reduce the number of lines in the compiled pixel shader program by 20% to 30%, for example, from 38 lines to 28 lines after the generated cg/HLSL pixel shader compiled by the cg/HLSL compiler. These could means slightly faster rasterization on slower video cards.

Also fixed shader compilation errors for DX9 plugin by using correct pixel/vertex attribute names that are compatibile with DX9 HLSL shader compiler. Now the generated vertex or pixel shader programs will compile correctly in either OGL or DX9. 

However, DX9 plugin is still not fixed, even though the shader programs can be compiled now.



git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4113 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
rice1964
2009-08-31 04:23:30 +00:00
parent 63786d5438
commit 718c88ff6a
5 changed files with 104 additions and 53 deletions

View File

@ -84,7 +84,7 @@ void PixelShaderCache::SetShader()
return;
}
bool HLSL = false;
bool HLSL = true;
const char *code = GeneratePixelShader(PixelShaderManager::GetTextureMask(), false, HLSL);
LPDIRECT3DPIXELSHADER9 shader = HLSL ? D3D::CompilePixelShader(code, (int)strlen(code), false) : CompileCgShader(code);
if (shader)