mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 06:08:30 +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:
@@ -45,6 +45,23 @@ namespace MobileGL {
|
||||
}
|
||||
}
|
||||
|
||||
BlendEquation ConvertGLEnumToBlendEquation(GLenum v) {
|
||||
switch (v) {
|
||||
case GL_FUNC_ADD:
|
||||
return BlendEquation::Add;
|
||||
case GL_FUNC_SUBTRACT:
|
||||
return BlendEquation::Subtract;
|
||||
case GL_FUNC_REVERSE_SUBTRACT:
|
||||
return BlendEquation::ReverseSubtract;
|
||||
case GL_MIN:
|
||||
return BlendEquation::Min;
|
||||
case GL_MAX:
|
||||
return BlendEquation::Max;
|
||||
default:
|
||||
return BlendEquation::Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
DepthTestFunc ConvertGLEnumToDepthTestFunc(GLenum v) {
|
||||
switch (v) {
|
||||
case GL_NEVER:
|
||||
@@ -197,4 +214,4 @@ namespace MobileGL {
|
||||
}
|
||||
}
|
||||
} // namespace MG_Util
|
||||
} // namespace MobileGL
|
||||
} // namespace MobileGL
|
||||
|
||||
@@ -13,9 +13,10 @@
|
||||
namespace MobileGL {
|
||||
namespace MG_Util {
|
||||
BlendFactor ConvertGLEnumToBlendFactor(GLenum value);
|
||||
BlendEquation ConvertGLEnumToBlendEquation(GLenum value);
|
||||
DepthTestFunc ConvertGLEnumToDepthTestFunc(GLenum value);
|
||||
PixelStoreParam ConvertGLEnumToPixelStoreParam(GLenum value);
|
||||
CullFaceMode ConvertGLEnumToCullFaceMode(GLenum value);
|
||||
CapabilityInput ConvertGLEnumToCapabilityInput(GLenum value);
|
||||
} // namespace MG_Util
|
||||
} // namespace MobileGL
|
||||
} // namespace MobileGL
|
||||
|
||||
@@ -46,6 +46,23 @@ namespace MobileGL {
|
||||
}
|
||||
}
|
||||
|
||||
GLenum ConvertBlendEquationToGLEnum(BlendEquation v) {
|
||||
switch (v) {
|
||||
case BlendEquation::Add:
|
||||
return GL_FUNC_ADD;
|
||||
case BlendEquation::Subtract:
|
||||
return GL_FUNC_SUBTRACT;
|
||||
case BlendEquation::ReverseSubtract:
|
||||
return GL_FUNC_REVERSE_SUBTRACT;
|
||||
case BlendEquation::Min:
|
||||
return GL_MIN;
|
||||
case BlendEquation::Max:
|
||||
return GL_MAX;
|
||||
default:
|
||||
return GL_UNKNOWN_MGL;
|
||||
}
|
||||
}
|
||||
|
||||
GLenum ConvertDepthTestFuncToGLEnum(DepthTestFunc v) {
|
||||
switch (v) {
|
||||
case DepthTestFunc::Never:
|
||||
@@ -198,4 +215,4 @@ namespace MobileGL {
|
||||
}
|
||||
}
|
||||
} // namespace MG_Util
|
||||
} // namespace MobileGL
|
||||
} // namespace MobileGL
|
||||
|
||||
@@ -13,9 +13,10 @@
|
||||
namespace MobileGL {
|
||||
namespace MG_Util {
|
||||
GLenum ConvertBlendFactorToGLEnum(BlendFactor value);
|
||||
GLenum ConvertBlendEquationToGLEnum(BlendEquation value);
|
||||
GLenum ConvertDepthTestFuncToGLEnum(DepthTestFunc value);
|
||||
GLenum ConvertPixelStoreParamToGLEnum(PixelStoreParam value);
|
||||
GLenum ConvertCullFaceModeToGLEnum(CullFaceMode value);
|
||||
GLenum ConvertCapabilityInputToGLEnum(CapabilityInput value);
|
||||
} // namespace MG_Util
|
||||
} // namespace MobileGL
|
||||
} // namespace MobileGL
|
||||
|
||||
@@ -103,5 +103,22 @@ namespace MobileGL {
|
||||
return VK_BLEND_FACTOR_ONE;
|
||||
}
|
||||
}
|
||||
|
||||
VkBlendOp ConvertBlendEquationToVkEnum(BlendEquation v) {
|
||||
switch (v) {
|
||||
case BlendEquation::Add:
|
||||
return VK_BLEND_OP_ADD;
|
||||
case BlendEquation::Subtract:
|
||||
return VK_BLEND_OP_SUBTRACT;
|
||||
case BlendEquation::ReverseSubtract:
|
||||
return VK_BLEND_OP_REVERSE_SUBTRACT;
|
||||
case BlendEquation::Min:
|
||||
return VK_BLEND_OP_MIN;
|
||||
case BlendEquation::Max:
|
||||
return VK_BLEND_OP_MAX;
|
||||
default:
|
||||
return VK_BLEND_OP_ADD;
|
||||
}
|
||||
}
|
||||
} // namespace MG_Util
|
||||
} // namespace MobileGL
|
||||
|
||||
@@ -16,5 +16,6 @@ namespace MobileGL {
|
||||
VkCullModeFlags ConvertCullFaceModeToVkEnum(CullFaceMode value, Bool invertClockwise = false);
|
||||
VkCompareOp ConvertDepthTestFuncToVkEnum(DepthTestFunc value);
|
||||
VkBlendFactor ConvertBlendFactorToVkEnum(BlendFactor value);
|
||||
VkBlendOp ConvertBlendEquationToVkEnum(BlendEquation value);
|
||||
} // namespace MG_Util
|
||||
} // namespace MobileGL
|
||||
|
||||
Reference in New Issue
Block a user