Add more gfx backend flags (available features)

This commit is contained in:
2026-09-13 01:24:55 +02:00
parent 6284ff885d
commit ec49f70c0b
6 changed files with 22 additions and 3 deletions
+3
View File
@@ -141,6 +141,9 @@ void GfxCitro3D::SysInit() {
PDLOG("GfxCitro3D::SysInit();"); PDLOG("GfxCitro3D::SysInit();");
impl = new Impl(); impl = new Impl();
Flags |= PDGfxBackendFlags_FlipUV_Y; Flags |= PDGfxBackendFlags_FlipUV_Y;
Flags |= PDGfxBackendFlags_HasClipRect;
Flags |= PDGfxBackendFlags_ReqPow2;
Flags |= PDGfxBackendFlags_ApproxSDF;
impl->pShaderRaw = Pica::AssembleCode(LIShaderCTR); impl->pShaderRaw = Pica::AssembleCode(LIShaderCTR);
impl->pCode = DVLB_ParseFile((uint32_t*)impl->pShaderRaw.data(), impl->pCode = DVLB_ParseFile((uint32_t*)impl->pShaderRaw.data(),
impl->pShaderRaw.size()); impl->pShaderRaw.size());
+1
View File
@@ -112,6 +112,7 @@ void GfxDirectX9::SysInit() {
} }
if (psBlob) psBlob->Release(); if (psBlob) psBlob->Release();
if (errBlob) errBlob->Release(); if (errBlob) errBlob->Release();
Flags |= PDGfxBackendFlags_HasClipRect;
} else { } else {
PDERR( PDERR(
"GfxDirectX9::SysInit Error: pDevice is not set!\nYOu need to include " "GfxDirectX9::SysInit Error: pDevice is not set!\nYOu need to include "
+1
View File
@@ -73,6 +73,7 @@ void GfxOpenGL2::pSetupShaderAttribs(u32 shader) {
} }
void GfxOpenGL2::SysInit() { void GfxOpenGL2::SysInit() {
Flags |= PDGfxBackendFlags_HasClipRect;
pShader = CreateShaderProgram(pVertCode, pFragCode); pShader = CreateShaderProgram(pVertCode, pFragCode);
glUseProgram(pShader); glUseProgram(pShader);
glGenBuffers(1, &VBO); glGenBuffers(1, &VBO);
+1
View File
@@ -11,6 +11,7 @@
namespace PD { namespace PD {
void GfxOpenGL3::SysInit() { void GfxOpenGL3::SysInit() {
Flags |= PDGfxBackendFlags_HasClipRect;
std::string vcode = SpirvHelper::SPV2GLSL( std::string vcode = SpirvHelper::SPV2GLSL(
std::vector<unsigned int>( std::vector<unsigned int>(
Shaders::VertexShader, Shaders::VertexShader,
+5 -2
View File
@@ -9,8 +9,11 @@
using PDGfxBackendFlags = PD::u32; using PDGfxBackendFlags = PD::u32;
enum PDGfxBackendFlags_ { enum PDGfxBackendFlags_ {
PDGfxBackendFlags_None = 0, PDGfxBackendFlags_None = 0,
PDGfxBackendFlags_FlipUV_Y = 1 << 0, // Essential for font loading PDGfxBackendFlags_FlipUV_Y = 1 << 0, // Essential for font loading
PDGfxBackendFlags_WindingCW = 1 << 0, // Use CW instead of CCW winding 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 { namespace PD {
+11 -1
View File
@@ -207,7 +207,17 @@ PD_API void Context::MetricsMenu(bool* show) {
} }
m->SeparatorText("Palladium Info"); m->SeparatorText("Palladium Info");
m->Label("Os Driver: {}", PD::Os::GetDriverName()); 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( if (m->BeginTreeNode(
std::string(std::string("Input: ") + PD::Hid::GetDriverName()))) { std::string(std::string("Input: ") + PD::Hid::GetDriverName()))) {
/* if (pIO.pCtx.Hid()->Flags & PD::HidDriver::Flags_HasKeyboard) { /* if (pIO.pCtx.Hid()->Flags & PD::HidDriver::Flags_HasKeyboard) {