mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Fix some comments, rename a function.
This commit is contained in:
1 parent
391b8155c5
commit
793e89d2e3
7 files changed
+15
-13
No files matched your search
@@ -906,7 +906,7 @@ static void ApplyLogicOp(BlendFactor &srcBlend, BlendFactor &dstBlend, BlendEq &
|
||||
}
|
||||
|
||||
// Try to simulate some common logic ops.
|
||||
void ApplyStencilReplaceAndLogicOp(ReplaceAlphaType replaceAlphaWithStencil, GenericBlendState &blendState) {
|
||||
void ApplyStencilReplaceAndLogicOpIgnoreBlend(ReplaceAlphaType replaceAlphaWithStencil, GenericBlendState &blendState) {
|
||||
StencilValueType stencilType = STENCIL_VALUE_KEEP;
|
||||
if (replaceAlphaWithStencil == REPLACE_ALPHA_YES) {
|
||||
stencilType = ReplaceAlphaWithStencilType();
|
||||
@@ -982,7 +982,7 @@ void ConvertBlendState(GenericBlendState &blendState, bool allowFramebufferRead)
|
||||
case REPLACE_BLEND_NO:
|
||||
blendState.resetFramebufferRead = true;
|
||||
// We may still want to do something about stencil -> alpha.
|
||||
ApplyStencilReplaceAndLogicOp(replaceAlphaWithStencil, blendState);
|
||||
ApplyStencilReplaceAndLogicOpIgnoreBlend(replaceAlphaWithStencil, blendState);
|
||||
return;
|
||||
|
||||
case REPLACE_BLEND_COPY_FBO:
|
||||
|
||||
@@ -158,7 +158,7 @@ struct GenericBlendState {
|
||||
};
|
||||
|
||||
void ConvertBlendState(GenericBlendState &blendState, bool allowShaderBlend);
|
||||
void ApplyStencilReplaceAndLogicOp(ReplaceAlphaType replaceAlphaWithStencil, GenericBlendState &blendState);
|
||||
void ApplyStencilReplaceAndLogicOpIgnoreBlend(ReplaceAlphaType replaceAlphaWithStencil, GenericBlendState &blendState);
|
||||
|
||||
struct GenericStencilFuncState {
|
||||
bool enabled;
|
||||
|
||||
@@ -240,6 +240,8 @@ void ComputeFragmentShaderID(FShaderID *id_out, const Draw::Bugs &bugs) {
|
||||
bool doFlatShading = gstate.getShadeMode() == GE_SHADE_FLAT;
|
||||
bool useShaderDepal = gstate_c.useShaderDepal;
|
||||
|
||||
// Note how we here recompute some of the work already done in state mapping.
|
||||
// Not ideal! At least we share the code.
|
||||
ReplaceBlendType replaceBlend = ReplaceBlendWithShader(gstate_c.allowFramebufferRead, gstate.FrameBufFormat());
|
||||
ReplaceAlphaType stencilToAlpha = ReplaceAlphaWithStencil(replaceBlend);
|
||||
|
||||
|
||||
@@ -160,14 +160,14 @@ void DrawEngineD3D11::ApplyDrawState(int prim) {
|
||||
ConvertBlendState(blendState, gstate_c.allowFramebufferRead);
|
||||
if (blendState.applyFramebufferRead) {
|
||||
if (ApplyFramebufferRead(&fboTexNeedsBind_)) {
|
||||
// We may still want to do something about stencil -> alpha.
|
||||
ApplyStencilReplaceAndLogicOp(blendState.replaceAlphaWithStencil, blendState);
|
||||
// We take over the responsiblity for blending, so recompute.
|
||||
ApplyStencilReplaceAndLogicOpIgnoreBlend(blendState.replaceAlphaWithStencil, blendState);
|
||||
} else {
|
||||
// Until next time, force it off.
|
||||
ResetFramebufferRead();
|
||||
gstate_c.SetAllowFramebufferRead(false);
|
||||
gstate_c.Dirty(DIRTY_FRAGMENTSHADER_STATE);
|
||||
}
|
||||
gstate_c.Dirty(DIRTY_FRAGMENTSHADER_STATE);
|
||||
} else if (blendState.resetFramebufferRead) {
|
||||
ResetFramebufferRead();
|
||||
}
|
||||
|
||||
@@ -131,8 +131,8 @@ void DrawEngineDX9::ApplyDrawState(int prim) {
|
||||
|
||||
if (blendState.applyFramebufferRead) {
|
||||
if (ApplyFramebufferRead(&fboTexNeedsBind_)) {
|
||||
// We may still want to do something about stencil -> alpha.
|
||||
ApplyStencilReplaceAndLogicOp(blendState.replaceAlphaWithStencil, blendState);
|
||||
// We take over the responsiblity for blending, so recompute.
|
||||
ApplyStencilReplaceAndLogicOpIgnoreBlend(blendState.replaceAlphaWithStencil, blendState);
|
||||
} else {
|
||||
// Until next time, force it off.
|
||||
ResetFramebufferRead();
|
||||
|
||||
@@ -171,8 +171,8 @@ void DrawEngineGLES::ApplyDrawState(int prim) {
|
||||
|
||||
if (blendState.applyFramebufferRead) {
|
||||
if (ApplyFramebufferRead(&fboTexNeedsBind_)) {
|
||||
// We may still want to do something about stencil -> alpha.
|
||||
ApplyStencilReplaceAndLogicOp(blendState.replaceAlphaWithStencil, blendState);
|
||||
// We take over the responsiblity for blending, so recompute.
|
||||
ApplyStencilReplaceAndLogicOpIgnoreBlend(blendState.replaceAlphaWithStencil, blendState);
|
||||
|
||||
// We copy the framebuffer here, as doing so will wipe any blend state if we do it later.
|
||||
if (fboTexNeedsBind_) {
|
||||
|
||||
@@ -167,15 +167,15 @@ void DrawEngineVulkan::ConvertStateToVulkanKey(FramebufferManagerVulkan &fbManag
|
||||
|
||||
if (blendState.applyFramebufferRead) {
|
||||
if (ApplyFramebufferRead(&fboTexNeedsBind_)) {
|
||||
// We may still want to do something about stencil -> alpha.
|
||||
ApplyStencilReplaceAndLogicOp(blendState.replaceAlphaWithStencil, blendState);
|
||||
// We take over the responsiblity for blending, so recompute.
|
||||
ApplyStencilReplaceAndLogicOpIgnoreBlend(blendState.replaceAlphaWithStencil, blendState);
|
||||
} else {
|
||||
// Until next time, force it off.
|
||||
ResetFramebufferRead();
|
||||
gstate_c.SetAllowFramebufferRead(false);
|
||||
// Make sure we recompute the fragment shader ID to one that doesn't try to use shader blending.
|
||||
gstate_c.Dirty(DIRTY_FRAGMENTSHADER_STATE);
|
||||
}
|
||||
gstate_c.Dirty(DIRTY_FRAGMENTSHADER_STATE);
|
||||
} else if (blendState.resetFramebufferRead) {
|
||||
ResetFramebufferRead();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user