Minor D3D changes
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2625 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
d60c1b139a
commit
05d06090fd
|
@ -286,7 +286,7 @@ void VertexShaderManager::SetConstants(bool proj_hax_1)
|
|||
}
|
||||
|
||||
PRIM_LOG("Projection: %f %f %f %f %f %f\n", xfregs.rawProjection[0], xfregs.rawProjection[1], xfregs.rawProjection[2], xfregs.rawProjection[3], xfregs.rawProjection[4], xfregs.rawProjection[5]);
|
||||
SetVSConstant4fv(C_PROJECTION, &g_fProjectionMatrix[0]);
|
||||
SetVSConstant4fv(C_PROJECTION, &g_fProjectionMatrix[0]);
|
||||
SetVSConstant4fv(C_PROJECTION+1, &g_fProjectionMatrix[4]);
|
||||
SetVSConstant4fv(C_PROJECTION+2, &g_fProjectionMatrix[8]);
|
||||
SetVSConstant4fv(C_PROJECTION+3, &g_fProjectionMatrix[12]);
|
||||
|
|
|
@ -95,7 +95,7 @@ void PixelShaderCache::SetShader()
|
|||
newentry.frameCount = frameCount;
|
||||
PixelShaders[uid] = newentry;
|
||||
|
||||
D3D::dev->SetFVF(NULL);
|
||||
Renderer::SetFVF(NULL);
|
||||
D3D::dev->SetPixelShader(shader);
|
||||
|
||||
INCSTAT(stats.numPixelShadersCreated);
|
||||
|
@ -134,7 +134,7 @@ void PixelShaderCache::Cleanup()
|
|||
while (iter != PixelShaders.end())
|
||||
{
|
||||
PSCacheEntry &entry = iter->second;
|
||||
if (entry.frameCount < frameCount-30)
|
||||
if (entry.frameCount < frameCount-400)
|
||||
{
|
||||
entry.Destroy();
|
||||
iter = PixelShaders.erase(iter);
|
||||
|
|
|
@ -232,6 +232,7 @@ void Renderer::SwapBuffers()
|
|||
p+=sprintf(p,"CP loads (DL): %i\n",stats.thisFrame.numCPLoadsInDL);
|
||||
p+=sprintf(p,"BP loads: %i\n",stats.thisFrame.numBPLoads);
|
||||
p+=sprintf(p,"BP loads (DL): %i\n",stats.thisFrame.numBPLoadsInDL);
|
||||
p+=sprintf(p,"Vertex Loaders: %i\n",stats.numVertexLoaders);
|
||||
|
||||
D3D::font.DrawTextScaled(0,30,20,20,0.0f,0xFF00FFFF,st,false);
|
||||
|
||||
|
|
|
@ -182,6 +182,10 @@ void Flush()
|
|||
DVSTARTPROFILE();
|
||||
if (collection != C_NOTHING)
|
||||
{
|
||||
// setup the pointers
|
||||
if(g_nativeVertexFmt)
|
||||
g_nativeVertexFmt->SetupVertexPointers();
|
||||
|
||||
u32 usedtextures = 0;
|
||||
for (u32 i = 0; i < (u32)bpmem.genMode.numtevstages + 1; ++i) {
|
||||
if (bpmem.tevorders[i/2].getEnable(i & 1))
|
||||
|
@ -232,8 +236,8 @@ void Flush()
|
|||
int numVertices = indexGen.GetNumVerts();
|
||||
if (numVertices)
|
||||
{
|
||||
PixelShaderCache::SetShader(); // TODO(ector): only do this if shader has changed
|
||||
VertexShaderCache::SetShader(g_nativeVertexFmt->m_components); // TODO(ector): only do this if shader has changed
|
||||
PixelShaderCache::SetShader();
|
||||
VertexShaderCache::SetShader(g_nativeVertexFmt->m_components);
|
||||
|
||||
// set global constants
|
||||
VertexShaderManager::SetConstants(false);
|
||||
|
|
|
@ -105,7 +105,7 @@ void VertexShaderCache::SetShader(u32 components)
|
|||
{
|
||||
PanicAlert("Failed to compile Vertex Shader:\n\n%s", code);
|
||||
}
|
||||
D3D::dev->SetFVF(NULL);
|
||||
Renderer::SetFVF(NULL);
|
||||
D3D::dev->SetVertexShader(shader);
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,6 @@ void SetVSConstant4fv(int const_number, const float *f)
|
|||
glProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB, const_number, f);
|
||||
}
|
||||
|
||||
|
||||
void VertexShaderCache::Init()
|
||||
{
|
||||
s_displayCompileAlert = true;
|
||||
|
|
Loading…
Reference in New Issue