[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:
2026-05-12 12:38:19 +08:00
parent 60199c0323
commit 633b3d3b0a
22 changed files with 489 additions and 126 deletions
@@ -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;