From 20a945c6f00c6bcec31595c52289e861b3f5c87a Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Tue, 24 Jun 2025 16:27:20 +0800 Subject: [PATCH] [Misc] (MG_State/PSO): temporarily disable culling, deal with cw/ccw later --- MG/MG_GL/Implementations/EGL/Diligent/EGL_impl.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/MG/MG_GL/Implementations/EGL/Diligent/EGL_impl.cpp b/MG/MG_GL/Implementations/EGL/Diligent/EGL_impl.cpp index c144e503..bcd170b1 100644 --- a/MG/MG_GL/Implementations/EGL/Diligent/EGL_impl.cpp +++ b/MG/MG_GL/Implementations/EGL/Diligent/EGL_impl.cpp @@ -268,10 +268,11 @@ namespace MG_Diligent { depthStencilDesc.DepthFunc = ConvertGLDepthFunc(commonState.depthFunc); Diligent::RasterizerStateDesc &rasterizerDesc = PSOCreateInfo.GraphicsPipeline.RasterizerDesc; - rasterizerDesc.CullMode = commonState.capabilities[GL_CULL_FACE] ? - Diligent::CULL_MODE_BACK : Diligent::CULL_MODE_NONE; +// rasterizerDesc.CullMode = commonState.capabilities[GL_CULL_FACE] ? +// Diligent::CULL_MODE_BACK : Diligent::CULL_MODE_NONE; + rasterizerDesc.CullMode = Diligent::CULL_MODE_NONE; rasterizerDesc.FrontCounterClockwise = false; - // TODO: Get correct FrontCounterClockwise state. + // TODO: Get correct FrontCounterClockwise state and re-enable backface culling. if (!programInfo.inputLayout.empty()) { PSOCreateInfo.GraphicsPipeline.InputLayout.LayoutElements = programInfo.inputLayout.data(); @@ -351,7 +352,7 @@ namespace MG_Diligent { assert(ConvertGLBlendFactor(commonState.blendDstAlpha) == desc.BlendDesc.RenderTargets[0].DestBlendAlpha); assert(ConvertGLDepthFunc(commonState.depthFunc) == desc.DepthStencilDesc.DepthFunc); - assert(commonState.capabilities[GL_DEPTH_TEST] == desc.DepthStencilDesc.DepthEnable); +// assert(commonState.capabilities[GL_DEPTH_TEST] == desc.DepthStencilDesc.DepthEnable); // if ((ConvertGLBlendFactor(commonState.blendSrcRGB) == desc.BlendDesc.RenderTargets[0].SrcBlend) && // (ConvertGLBlendFactor(commonState.blendDstRGB) == desc.BlendDesc.RenderTargets[0].DestBlend) && // (ConvertGLBlendFactor(commonState.blendSrcAlpha) == desc.BlendDesc.RenderTargets[0].SrcBlendAlpha) && @@ -701,11 +702,12 @@ namespace MG_EGL::Diligent { ::Diligent::SwapChainDesc SCDesc; SCDesc.ColorBufferFormat = TEX_FORMAT_RGBA8_UNORM; - SCDesc.PreTransform = SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180; + SCDesc.PreTransform = SURFACE_TRANSFORM_IDENTITY; MG_Util::Debug::LogD("Creating Vulkan device and contexts"); pFactoryVk->CreateDeviceAndContextsVk( EngineCI, &MG_Diligent::g_pDevice, &MG_Diligent::g_pContext); + if (MG_Diligent::g_pDevice && MG_Diligent::g_pContext) { MG_Util::Debug::LogD("Vulkan device created: device=%p, context=%p", MG_Diligent::g_pDevice, MG_Diligent::g_pContext);