Make sure to disable scissor when doing the initial clear of a new FBO.

Minor cleanups.
This commit is contained in:
Henrik Rydgard 2013-12-06 23:08:37 +01:00
parent 4cd57b68d4
commit c738364f67
3 changed files with 7 additions and 4 deletions

View File

@ -239,7 +239,7 @@ void ComputeFragmentShaderID(FragmentShaderID *id) {
id->d[0] |= (enableColorDoubling & 1) << 17;
id->d[0] |= (enableAlphaDoubling & 1) << 18;
if (stencilToAlpha) {
// 2 bits
// 3 bits
id->d[0] |= ReplaceAlphaWithStencilType() << 19;
}
if (enableAlphaTest)

View File

@ -150,9 +150,12 @@ void CenterRect(float *x, float *y, float *w, float *h,
}
static void ClearBuffer() {
glstate.scissorTest.disable();
glstate.depthWrite.set(GL_TRUE);
glstate.colorMask.set(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glClearColor(0,0,0,1);
glstate.stencilFunc.set(GL_ALWAYS, 0xFF, 0xFF);
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClearStencil(0xFF);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
}
@ -763,7 +766,7 @@ void FramebufferManager::SetRenderFrameBuffer() {
frameLastFramebufUsed = gpuStats.numFlips;
vfbs_.push_back(vfb);
ClearBuffer();
glEnable(GL_DITHER);
glEnable(GL_DITHER); // why?
currentRenderVfb_ = vfb;
INFO_LOG(SCEGE, "Creating FBO for %08x : %i x %i x %i", vfb->fb_address, vfb->width, vfb->height, vfb->format);

View File

@ -344,7 +344,7 @@ void TransformDrawEngine::ApplyDrawState(int prim) {
if (!gstate.isStencilTestEnabled()) {
amask = false;
} else {
// If the stencil value is set to KEEP, we shouldn't write to the stencil/alpha channel.1
// If the stencil type is set to KEEP, we shouldn't write to the stencil/alpha channel.
if (ReplaceAlphaWithStencilType() == STENCIL_VALUE_KEEP) {
amask = false;
}