reduced frequency of dx9 ps_2_0 pixel generation errors, and made dx9 efb depth peek of 16-bit depth buffer not use 24-bit adjustment factor. shouldn't affect other the plugins.

(probably nobody else cares, but I need at least one video plugin that actually works on this computer)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6618 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nitsuja-
2010-12-19 20:59:23 +00:00
parent 47454a4ed9
commit 98fe8437ae
12 changed files with 200 additions and 166 deletions

View File

@ -52,6 +52,7 @@ static LPDIRECT3DPIXELSHADER9 s_yuyvToRgbProgram = NULL;
// Not all slots are taken - but who cares.
const u32 NUM_ENCODING_PROGRAMS = 64;
static LPDIRECT3DPIXELSHADER9 s_encodingPrograms[NUM_ENCODING_PROGRAMS];
static bool s_encodingProgramsFailed[NUM_ENCODING_PROGRAMS];
void CreateRgbToYuyvProgram()
{
@ -121,6 +122,13 @@ LPDIRECT3DPIXELSHADER9 GetOrCreateEncodingShader(u32 format)
if (!s_encodingPrograms[format])
{
if(s_encodingProgramsFailed[format])
{
// we already failed to create a shader for this format,
// so instead of re-trying and showing the same error message every frame, just return.
return NULL;
}
const char* shader = TextureConversionShader::GenerateEncodingShader(format,API_D3D9);
#if defined(_DEBUG) || defined(DEBUGFAST)
@ -135,6 +143,7 @@ LPDIRECT3DPIXELSHADER9 GetOrCreateEncodingShader(u32 format)
s_encodingPrograms[format] = D3D::CompileAndCreatePixelShader(shader, (int)strlen(shader));
if (!s_encodingPrograms[format]) {
ERROR_LOG(VIDEO, "Failed to create encoding fragment program");
s_encodingProgramsFailed[format] = true;
}
}
return s_encodingPrograms[format];
@ -145,6 +154,7 @@ void Init()
for (unsigned int i = 0; i < NUM_ENCODING_PROGRAMS; i++)
{
s_encodingPrograms[i] = NULL;
s_encodingProgramsFailed[i] = false;
}
for (unsigned int i = 0; i < NUM_TRANSFORM_BUFFERS; i++)
{