mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
First a bugfix:
fixed a misbehavior in the clear code that causes depth clear problems in reference hardware (Intel as example). add 6 parameters to optimize Safe Texture Cache: SafeTextureCacheColorSamples, SafeTextureCacheIndexedSamples, SafeTextureCacheTlutSamples: this 3 parameters gives the number of samples taken to calculate the final hash value, less samples = more speed, more samples = more accuracy if 0 is specified the hash is calculated using all the data in the texture. SafeTextureCacheColorMaxSize, SafeTextureCacheIndexedMaxSize, SafeTextureCacheTlutMaxSize: this parameters limits the amount of data used for the hash calculation, it could appear as redundant but in some games is better to make a full hash of the first bytes instead of some samples of all the texture. color, indexed, tlut : define the texture type, full color data, indexed, and the tlut memory. the parameters are available in the config , no GUI at this time, if the test are OK will add it to the GUI. if someone needs it will give more examples on how to configure the values for specific games. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5116 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -41,6 +41,7 @@ const VertexShaderCache::VSCacheEntry *VertexShaderCache::last_entry;
|
||||
static float GC_ALIGNED16(lastVSconstants[C_FOGPARAMS + 8][4]);
|
||||
|
||||
static LPDIRECT3DVERTEXSHADER9 SimpleVertexShader;
|
||||
static LPDIRECT3DVERTEXSHADER9 ClearVertexShader;
|
||||
static LPDIRECT3DVERTEXSHADER9 FSAAVertexShader;
|
||||
|
||||
LinearDiskCache g_vs_disk_cache;
|
||||
@ -50,6 +51,11 @@ LPDIRECT3DVERTEXSHADER9 VertexShaderCache::GetSimpleVertexShader()
|
||||
return SimpleVertexShader;
|
||||
}
|
||||
|
||||
LPDIRECT3DVERTEXSHADER9 VertexShaderCache::GetClearVertexShader()
|
||||
{
|
||||
return ClearVertexShader;
|
||||
}
|
||||
|
||||
LPDIRECT3DVERTEXSHADER9 VertexShaderCache::GetFSAAVertexShader()
|
||||
{
|
||||
return FSAAVertexShader;
|
||||
@ -155,12 +161,12 @@ public:
|
||||
|
||||
void VertexShaderCache::Init()
|
||||
{
|
||||
char *vSimpleProg = new char[2048];
|
||||
sprintf(vSimpleProg,"struct VSOUTPUT\n"
|
||||
char* vProg = new char[2048];
|
||||
sprintf(vProg,"struct VSOUTPUT\n"
|
||||
"{\n"
|
||||
"float4 vPosition : POSITION;\n"
|
||||
"float4 vPosition : POSITION;\n"
|
||||
"float4 vColor0 : COLOR0;\n"
|
||||
"float2 vTexCoord : TEXCOORD0;\n"
|
||||
"float2 vTexCoord : TEXCOORD0;\n"
|
||||
"};\n"
|
||||
"VSOUTPUT main(float4 inPosition : POSITION,float2 inTEX0 : TEXCOORD0,float4 inColor0: COLOR0)\n"
|
||||
"{\n"
|
||||
@ -171,10 +177,24 @@ void VertexShaderCache::Init()
|
||||
"return OUT;\n"
|
||||
"}\n");
|
||||
|
||||
SimpleVertexShader = D3D::CompileAndCreateVertexShader(vSimpleProg, (int)strlen(vSimpleProg));
|
||||
SimpleVertexShader = D3D::CompileAndCreateVertexShader(vProg, (int)strlen(vProg));
|
||||
|
||||
sprintf(vProg,"struct VSOUTPUT\n"
|
||||
"{\n"
|
||||
"float4 vPosition : POSITION;\n"
|
||||
"float4 vColor0 : COLOR0;\n"
|
||||
"};\n"
|
||||
"VSOUTPUT main(float4 inPosition : POSITION,float4 inColor0: COLOR0)\n"
|
||||
"{\n"
|
||||
"VSOUTPUT OUT;\n"
|
||||
"OUT.vPosition = inPosition;\n"
|
||||
"OUT.vColor0 = inColor0;\n"
|
||||
"return OUT;\n"
|
||||
"}\n");
|
||||
|
||||
ClearVertexShader = D3D::CompileAndCreateVertexShader(vProg, (int)strlen(vProg));
|
||||
|
||||
char *vFSAAProg = new char[2048];
|
||||
sprintf(vFSAAProg, "struct VSOUTPUT\n"
|
||||
sprintf(vProg, "struct VSOUTPUT\n"
|
||||
"{\n"
|
||||
"float4 vPosition : POSITION;\n"
|
||||
"float4 vTexCoord : TEXCOORD0;\n"
|
||||
@ -196,12 +216,10 @@ void VertexShaderCache::Init()
|
||||
"OUT.vTexCoord5 = inTEX2;\n"
|
||||
"return OUT;\n"
|
||||
"}\n");
|
||||
FSAAVertexShader = D3D::CompileAndCreateVertexShader(vFSAAProg, (int)strlen(vFSAAProg));
|
||||
|
||||
FSAAVertexShader = D3D::CompileAndCreateVertexShader(vProg, (int)strlen(vProg));
|
||||
|
||||
Clear();
|
||||
delete [] vFSAAProg;
|
||||
delete [] vSimpleProg;
|
||||
delete [] vProg;
|
||||
|
||||
if (!File::Exists(File::GetUserPath(D_SHADERCACHE_IDX)))
|
||||
File::CreateDir(File::GetUserPath(D_SHADERCACHE_IDX));
|
||||
|
Reference in New Issue
Block a user