Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec49f70c0b
|
||
|
|
6284ff885d
|
||
|
|
91c245c1a6
|
@@ -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());
|
||||
@@ -265,7 +268,13 @@ void GfxCitro3D::UploadPools() {
|
||||
BufInfo_Add(buf, GetVertexBufPtr(0), sizeof(Li::Vertex), 3, 0x210);
|
||||
}
|
||||
|
||||
void GfxCitro3D::ClipRect() {}
|
||||
void GfxCitro3D::ClipRect() {
|
||||
// This is so cursed but it works
|
||||
C3D_SetScissor(CurrentHasClip ? GPU_SCISSOR_NORMAL : GPU_SCISSOR_DISABLE,
|
||||
ViewPort.y - CurrentClip.w - CurrentClip.y,
|
||||
ViewPort.x - CurrentClip.z - CurrentClip.x,
|
||||
ViewPort.y - CurrentClip.y, ViewPort.x - CurrentClip.x);
|
||||
}
|
||||
} // namespace PD
|
||||
#else
|
||||
namespace PD {
|
||||
|
||||
@@ -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 "
|
||||
@@ -286,7 +287,20 @@ void GfxDirectX9::UploadPools() {
|
||||
impl->IBO->Unlock();
|
||||
}
|
||||
|
||||
void GfxDirectX9::ClipRect() {}
|
||||
void GfxDirectX9::ClipRect() {
|
||||
if (CurrentHasClip) {
|
||||
RECT r;
|
||||
r.left = CurrentClip.x;
|
||||
r.top = CurrentClip.y;
|
||||
r.right = CurrentClip.x + CurrentClip.z;
|
||||
r.bottom = CurrentClip.y + CurrentClip.w;
|
||||
|
||||
impl->Device->SetScissorRect(&r);
|
||||
impl->Device->SetRenderState(D3DRS_SCISSORTESTENABLE, TRUE);
|
||||
} else {
|
||||
impl->Device->SetRenderState(D3DRS_SCISSORTESTENABLE, FALSE);
|
||||
}
|
||||
}
|
||||
} // namespace PD
|
||||
#else
|
||||
namespace PD {
|
||||
|
||||
@@ -73,6 +73,7 @@ void GfxOpenGL2::pSetupShaderAttribs(u32 shader) {
|
||||
}
|
||||
|
||||
void GfxOpenGL2::SysInit() {
|
||||
Flags |= PDGfxBackendFlags_HasClipRect;
|
||||
pShader = CreateShaderProgram(pVertCode, pFragCode);
|
||||
glUseProgram(pShader);
|
||||
glGenBuffers(1, &VBO);
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace PD {
|
||||
void GfxOpenGL3::SysInit() {
|
||||
Flags |= PDGfxBackendFlags_HasClipRect;
|
||||
std::string vcode = SpirvHelper::SPV2GLSL(
|
||||
std::vector<unsigned int>(
|
||||
Shaders::VertexShader,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
+11
-1
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user