Minor optimizations

This commit is contained in:
Henrik Rydgard 2017-01-23 21:08:16 +01:00
parent ae37df0a8c
commit 69267d4cd6
3 changed files with 16 additions and 5 deletions

View File

@ -84,6 +84,11 @@ enum : uint64_t {
DIRTY_SPLINETYPEV = 1ULL << 36, DIRTY_SPLINETYPEV = 1ULL << 36,
DIRTY_BONE_UNIFORMS = 0xFF000000ULL, DIRTY_BONE_UNIFORMS = 0xFF000000ULL,
DIRTY_ALL_UNIFORMS = 0x1FFFFFFFFFULL,
// Now we can add further dirty flags that are not uniforms.
DIRTY_ALL = 0xFFFFFFFFFFFFFFFF DIRTY_ALL = 0xFFFFFFFFFFFFFFFF
}; };

View File

@ -1290,6 +1290,7 @@ void GPU_DX9::Execute_Generic(u32 op, u32 diff) {
case GE_CMD_LAC0: case GE_CMD_LAC0:
case GE_CMD_LDC0: case GE_CMD_LDC0:
case GE_CMD_LSC0: case GE_CMD_LSC0:
if (diff)
shaderManager_->DirtyUniform(DIRTY_LIGHT0); shaderManager_->DirtyUniform(DIRTY_LIGHT0);
break; break;
@ -1301,6 +1302,7 @@ void GPU_DX9::Execute_Generic(u32 op, u32 diff) {
case GE_CMD_LAC1: case GE_CMD_LAC1:
case GE_CMD_LDC1: case GE_CMD_LDC1:
case GE_CMD_LSC1: case GE_CMD_LSC1:
if (diff)
shaderManager_->DirtyUniform(DIRTY_LIGHT1); shaderManager_->DirtyUniform(DIRTY_LIGHT1);
break; break;
case GE_CMD_LX2:case GE_CMD_LY2:case GE_CMD_LZ2: case GE_CMD_LX2:case GE_CMD_LY2:case GE_CMD_LZ2:
@ -1311,6 +1313,7 @@ void GPU_DX9::Execute_Generic(u32 op, u32 diff) {
case GE_CMD_LAC2: case GE_CMD_LAC2:
case GE_CMD_LDC2: case GE_CMD_LDC2:
case GE_CMD_LSC2: case GE_CMD_LSC2:
if (diff)
shaderManager_->DirtyUniform(DIRTY_LIGHT2); shaderManager_->DirtyUniform(DIRTY_LIGHT2);
break; break;
case GE_CMD_LX3:case GE_CMD_LY3:case GE_CMD_LZ3: case GE_CMD_LX3:case GE_CMD_LY3:case GE_CMD_LZ3:
@ -1321,6 +1324,7 @@ void GPU_DX9::Execute_Generic(u32 op, u32 diff) {
case GE_CMD_LAC3: case GE_CMD_LAC3:
case GE_CMD_LDC3: case GE_CMD_LDC3:
case GE_CMD_LSC3: case GE_CMD_LSC3:
if (diff)
shaderManager_->DirtyUniform(DIRTY_LIGHT3); shaderManager_->DirtyUniform(DIRTY_LIGHT3);
break; break;
@ -1330,6 +1334,7 @@ void GPU_DX9::Execute_Generic(u32 op, u32 diff) {
case GE_CMD_VIEWPORTYCENTER: case GE_CMD_VIEWPORTYCENTER:
case GE_CMD_VIEWPORTZSCALE: case GE_CMD_VIEWPORTZSCALE:
case GE_CMD_VIEWPORTZCENTER: case GE_CMD_VIEWPORTZCENTER:
if (diff)
Execute_ViewportType(op, diff); Execute_ViewportType(op, diff);
break; break;

View File

@ -408,6 +408,7 @@ GPU_GLES::GPU_GLES(GraphicsContext *ctx)
textureCache_ = textureCacheGL_; textureCache_ = textureCacheGL_;
drawEngineCommon_ = &drawEngine_; drawEngineCommon_ = &drawEngine_;
shaderManager_ = shaderManagerGL_; shaderManager_ = shaderManagerGL_;
drawEngineCommon_ = &drawEngine_;
drawEngine_.SetShaderManager(shaderManagerGL_); drawEngine_.SetShaderManager(shaderManagerGL_);
drawEngine_.SetTextureCache(textureCacheGL_); drawEngine_.SetTextureCache(textureCacheGL_);