mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
big commit, implemented depth textures with hardware support in D3D, so now they will be correct as in opengl. please test a lot because i only tested the ati path, nvidia path is "Theoretical" :).
Also reimplemented screen clearing as a color quad to support alpha blending when clearing as in the original hardware. the funny thing is how is implemented peeking, as locking depth textures is not supported, implemented peeking copying the values form the depth texture to a r32f render target and then reading back the data. please a lot of testing to this commit. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4599 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -35,11 +35,11 @@ const VertexShaderCache::VSCacheEntry *VertexShaderCache::last_entry;
|
||||
|
||||
static float GC_ALIGNED16(lastVSconstants[C_FOGPARAMS+8][4]);
|
||||
|
||||
static LPDIRECT3DVERTEXSHADER9 SimpleVertexSahder;
|
||||
static LPDIRECT3DVERTEXSHADER9 SimpleVertexShader;
|
||||
|
||||
LPDIRECT3DVERTEXSHADER9 VertexShaderCache::GetSimpleVertexSahder()
|
||||
LPDIRECT3DVERTEXSHADER9 VertexShaderCache::GetSimpleVertexShader()
|
||||
{
|
||||
return SimpleVertexSahder;
|
||||
return SimpleVertexShader;
|
||||
}
|
||||
|
||||
void SetVSConstant4f(int const_number, float f1, float f2, float f3, float f4)
|
||||
@ -132,17 +132,21 @@ void VertexShaderCache::Init()
|
||||
sprintf(vSimpleProg,"struct VSOUTPUT\n"
|
||||
"{\n"
|
||||
"float4 vPosition : POSITION;\n"
|
||||
"float4 Color : COLOR0;\n"
|
||||
"float4 vTexCoord : TEXCOORD0;\n"
|
||||
"float4 vTexCoord1 : TEXCOORD1;\n"
|
||||
"};\n"
|
||||
"VSOUTPUT main( float4 inPosition : POSITION, float4 inUV : TEXCOORD0)\n"
|
||||
"VSOUTPUT main( float4 inPosition : POSITION, float4 inUV : TEXCOORD0,float4 inColor : COLOR0)\n"
|
||||
"{\n"
|
||||
"VSOUTPUT OUT = (VSOUTPUT)0;\n"
|
||||
"OUT.vPosition = inPosition;\n"
|
||||
"OUT.Color = inColor;\n"
|
||||
"OUT.vTexCoord = inUV;\n"
|
||||
"OUT.vTexCoord1 = inPosition.zzzz;\n"
|
||||
"return OUT;\n"
|
||||
"}\n");
|
||||
|
||||
SimpleVertexSahder = D3D::CompileVertexShader(vSimpleProg, (int)strlen(vSimpleProg));
|
||||
SimpleVertexShader = D3D::CompileVertexShader(vSimpleProg, (int)strlen(vSimpleProg));
|
||||
Clear();
|
||||
}
|
||||
|
||||
@ -160,8 +164,8 @@ void VertexShaderCache::Clear()
|
||||
|
||||
void VertexShaderCache::Shutdown()
|
||||
{
|
||||
if(SimpleVertexSahder)
|
||||
SimpleVertexSahder->Release();
|
||||
if(SimpleVertexShader)
|
||||
SimpleVertexShader->Release();
|
||||
Clear();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user