diff --git a/backends/source/gfx_citro3d.cpp b/backends/source/gfx_citro3d.cpp index 7701e72..48a0cff 100644 --- a/backends/source/gfx_citro3d.cpp +++ b/backends/source/gfx_citro3d.cpp @@ -141,6 +141,9 @@ void GfxCitro3D::SysInit() { PDLOG("GfxCitro3D::SysInit();"); impl = new Impl(); Flags |= PDGfxBackendFlags_FlipUV_Y; + Flags |= PDGfxBackendFlags_HasClipRect; + Flags |= PDGfxBackendFlags_ReqPow2; + Flags |= PDGfxBackendFlags_ApproxSDF; impl->pShaderRaw = Pica::AssembleCode(LIShaderCTR); impl->pCode = DVLB_ParseFile((uint32_t*)impl->pShaderRaw.data(), impl->pShaderRaw.size()); diff --git a/backends/source/gfx_directx9.cpp b/backends/source/gfx_directx9.cpp index 8b40d01..ce0395e 100644 --- a/backends/source/gfx_directx9.cpp +++ b/backends/source/gfx_directx9.cpp @@ -112,6 +112,7 @@ void GfxDirectX9::SysInit() { } if (psBlob) psBlob->Release(); if (errBlob) errBlob->Release(); + Flags |= PDGfxBackendFlags_HasClipRect; } else { PDERR( "GfxDirectX9::SysInit Error: pDevice is not set!\nYOu need to include " diff --git a/backends/source/gfx_opengl2.cpp b/backends/source/gfx_opengl2.cpp index 97ecfdf..3570ce0 100644 --- a/backends/source/gfx_opengl2.cpp +++ b/backends/source/gfx_opengl2.cpp @@ -73,6 +73,7 @@ void GfxOpenGL2::pSetupShaderAttribs(u32 shader) { } void GfxOpenGL2::SysInit() { + Flags |= PDGfxBackendFlags_HasClipRect; pShader = CreateShaderProgram(pVertCode, pFragCode); glUseProgram(pShader); glGenBuffers(1, &VBO); diff --git a/backends/source/gfx_opengl3.cpp b/backends/source/gfx_opengl3.cpp index e7a5aae..a9a4a84 100644 --- a/backends/source/gfx_opengl3.cpp +++ b/backends/source/gfx_opengl3.cpp @@ -11,6 +11,7 @@ namespace PD { void GfxOpenGL3::SysInit() { + Flags |= PDGfxBackendFlags_HasClipRect; std::string vcode = SpirvHelper::SPV2GLSL( std::vector( Shaders::VertexShader, diff --git a/include/pd/drivers/gfx.hpp b/include/pd/drivers/gfx.hpp index 86f60ad..9c999ba 100755 --- a/include/pd/drivers/gfx.hpp +++ b/include/pd/drivers/gfx.hpp @@ -9,8 +9,11 @@ using PDGfxBackendFlags = PD::u32; enum PDGfxBackendFlags_ { PDGfxBackendFlags_None = 0, - PDGfxBackendFlags_FlipUV_Y = 1 << 0, // Essential for font loading - PDGfxBackendFlags_WindingCW = 1 << 0, // Use CW instead of CCW winding + PDGfxBackendFlags_FlipUV_Y = 1 << 0, // Essential for font loading + PDGfxBackendFlags_WindingCW = 1 << 1, // Use CW instead of CCW winding + PDGfxBackendFlags_HasClipRect = 1 << 2, // Clip rects supported + PDGfxBackendFlags_ReqPow2 = 1 << 3, // Tex size must be pow of 2 + PDGfxBackendFlags_ApproxSDF = 1 << 4, // Fake SDF for non smoothstep systems }; namespace PD { diff --git a/source/ui7/ui7.cpp b/source/ui7/ui7.cpp index cd7f73e..e116f45 100644 --- a/source/ui7/ui7.cpp +++ b/source/ui7/ui7.cpp @@ -207,7 +207,17 @@ PD_API void Context::MetricsMenu(bool* show) { } m->SeparatorText("Palladium Info"); m->Label("Os Driver: {}", PD::Os::GetDriverName()); - m->Label("Renderer: {}", PD::Gfx::GetDriverName()); + if (m->BeginTreeNode( + std::format("Gfx Driver: {}", PD::Gfx::GetDriverName()))) { + m->SeparatorText("Features"); + if (PD::Gfx::GetFlags() & PDGfxBackendFlags_HasClipRect) + m->Label("ClipRects"); + if (PD::Gfx::GetFlags() & PDGfxBackendFlags_ReqPow2) + m->Label("Texture As Pow of 2"); + if (PD::Gfx::GetFlags() & PDGfxBackendFlags_ApproxSDF) + m->Label("SDF Approximation"); + m->EndTreeNode(); + } if (m->BeginTreeNode( std::string(std::string("Input: ") + PD::Hid::GetDriverName()))) { /* if (pIO.pCtx.Hid()->Flags & PD::HidDriver::Flags_HasKeyboard) {