mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 05:38:31 +09:00
[Feat] (MG_State/RenderState, MG_Backend/DirectVulkan): make Distant
Horizon work - Implement BlendEquation/CullFaceMode/PointSize/PolygonMode - Implement GetFramebufferAttachmentParameter* - Downgrade some color attachment resolve failure - Downgrade some overly-strict shader stage linkage check (don't check on unused input var)
This commit is contained in:
@@ -164,6 +164,48 @@ namespace MobileGL {
|
||||
dstAlpha = m_parameters.BlendStates[index].DstFactorAlpha;
|
||||
}
|
||||
|
||||
void RenderState::SetBlendEquation(BlendEquation color, BlendEquation alpha) {
|
||||
Bool stateChanged = false;
|
||||
for (auto& blendState : m_parameters.BlendStates) {
|
||||
if (blendState.ColorEquation == color && blendState.AlphaEquation == alpha) {
|
||||
continue;
|
||||
}
|
||||
blendState.ColorEquation = color;
|
||||
blendState.AlphaEquation = alpha;
|
||||
stateChanged = true;
|
||||
}
|
||||
if (!stateChanged) return;
|
||||
++m_version;
|
||||
}
|
||||
|
||||
void RenderState::GetBlendEquation(BlendEquation& color, BlendEquation& alpha) const {
|
||||
color = m_parameters.BlendStates[0].ColorEquation;
|
||||
alpha = m_parameters.BlendStates[0].AlphaEquation;
|
||||
}
|
||||
|
||||
void RenderState::SetBlendEquationIndexed(Uint index, BlendEquation color, BlendEquation alpha) {
|
||||
if (index >= MG_State::GLState::FramebufferObject::MAX_DRAW_BUFFERS) {
|
||||
MOBILEGL_ASSERT(false, "Blend equation index out of range: %d", index);
|
||||
return;
|
||||
}
|
||||
PerBufferBlendState& blendState = m_parameters.BlendStates[index];
|
||||
if (blendState.ColorEquation == color && blendState.AlphaEquation == alpha) {
|
||||
return;
|
||||
}
|
||||
blendState.ColorEquation = color;
|
||||
blendState.AlphaEquation = alpha;
|
||||
++m_version;
|
||||
}
|
||||
|
||||
void RenderState::GetBlendEquationIndexed(Uint index, BlendEquation& color, BlendEquation& alpha) const {
|
||||
if (index >= MG_State::GLState::FramebufferObject::MAX_DRAW_BUFFERS) {
|
||||
MOBILEGL_ASSERT(false, "Blend equation index out of range: %d", index);
|
||||
return;
|
||||
}
|
||||
color = m_parameters.BlendStates[index].ColorEquation;
|
||||
alpha = m_parameters.BlendStates[index].AlphaEquation;
|
||||
}
|
||||
|
||||
// -------------------- Depth --------------------
|
||||
void RenderState::SetDepthFunc(DepthTestFunc func) {
|
||||
if (m_parameters.DepthFunc == func) return;
|
||||
|
||||
Reference in New Issue
Block a user