Skip to content

Commit

Permalink
Move late state apply after sw transform decode.
Browse files Browse the repository at this point in the history
Need this so ApplyDrawStateLate() can use data from the decode.
  • Loading branch information
unknownbrackets committed Sep 13, 2015
1 parent 5360422 commit a3078a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions GPU/Directx9/TransformPipelineDX9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,9 +811,6 @@ void TransformDrawEngineDX9::DoFlush() {
gstate_c.vertexFullAlpha = gstate_c.vertexFullAlpha && ((hasColor && (gstate.materialupdate & 1)) || gstate.getMaterialAmbientA() == 255) && (!gstate.isLightingEnabled() || gstate.getAmbientA() == 255);
}

ApplyDrawStateLate();
vshader = shaderManager_->ApplyShader(prim, lastVType_);

gpuStats.numUncachedVertsDrawn += indexGen.VertexCount();
prim = indexGen.Prim();
// Undo the strip optimization, not supported by the SW code yet.
Expand All @@ -834,6 +831,9 @@ void TransformDrawEngineDX9::DoFlush() {
dec_->VertexType(), inds, GE_VTYPE_IDX_16BIT, dec_->GetDecVtxFmt(),
maxIndex, framebufferManager_, textureCache_, transformed, transformedExpanded, drawBuffer, numTrans, drawIndexed, &result, -1.0f);

ApplyDrawStateLate();
vshader = shaderManager_->ApplyShader(prim, lastVType_);

if (result.action == SW_DRAW_PRIMITIVES) {
if (result.setStencil) {
dxstate.stencilFunc.set(D3DCMP_ALWAYS, result.stencilValue, 255);
Expand Down
5 changes: 3 additions & 2 deletions GPU/GLES/TransformPipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -787,8 +787,6 @@ void TransformDrawEngine::DoFlush() {
gstate_c.vertexFullAlpha = gstate_c.vertexFullAlpha && ((hasColor && (gstate.materialupdate & 1)) || gstate.getMaterialAmbientA() == 255) && (!gstate.isLightingEnabled() || gstate.getAmbientA() == 255);
}

ApplyDrawStateLate();
LinkedShader *program = shaderManager_->ApplyFragmentShader(vshader, prim, lastVType_);
gpuStats.numUncachedVertsDrawn += indexGen.VertexCount();
prim = indexGen.Prim();
// Undo the strip optimization, not supported by the SW code yet.
Expand All @@ -808,6 +806,9 @@ void TransformDrawEngine::DoFlush() {
dec_->VertexType(), inds, GE_VTYPE_IDX_16BIT, dec_->GetDecVtxFmt(),
maxIndex, framebufferManager_, textureCache_, transformed, transformedExpanded, drawBuffer, numTrans, drawIndexed, &result, 1.0);

ApplyDrawStateLate();
LinkedShader *program = shaderManager_->ApplyFragmentShader(vshader, prim, lastVType_);

if (result.action == SW_DRAW_PRIMITIVES) {
if (result.setStencil) {
glstate.stencilFunc.set(GL_ALWAYS, result.stencilValue, 255);
Expand Down

0 comments on commit a3078a6

Please sign in to comment.