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_BONE_UNIFORMS = 0xFF000000ULL,
DIRTY_ALL_UNIFORMS = 0x1FFFFFFFFFULL,
// Now we can add further dirty flags that are not uniforms.
DIRTY_ALL = 0xFFFFFFFFFFFFFFFF
};

View File

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

View File

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