mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-19 13:51:16 +00:00
gxm: msaa support, fix wrong file path
This commit is contained in:
parent
81c030d379
commit
0d04ba60bf
@ -7,6 +7,6 @@ void VITA_SetupDefaultConfigOverrides(dictionary* p_dictionary)
|
|||||||
{
|
{
|
||||||
SDL_Log("Overriding default config for VITA");
|
SDL_Log("Overriding default config for VITA");
|
||||||
|
|
||||||
iniparser_set(p_dictionary, "isle:diskpath", "ux0:data/isledecompile/DATA/disk");
|
iniparser_set(p_dictionary, "isle:diskpath", "ux0:data/isledecomp/DATA/disk");
|
||||||
iniparser_set(p_dictionary, "isle:cdpath", "ux0:data/isledecompile/");
|
iniparser_set(p_dictionary, "isle:cdpath", "ux0:data/isledecomp/");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,7 +30,7 @@ bool Vita_ShowSimpleMessageBox(SDL_MessageBoxFlags flags, const char* title, con
|
|||||||
if (!gxm) {
|
if (!gxm) {
|
||||||
gxm = (GXMContext*) SDL_malloc(sizeof(GXMContext));
|
gxm = (GXMContext*) SDL_malloc(sizeof(GXMContext));
|
||||||
}
|
}
|
||||||
if (ret = gxm->init(); ret < 0) {
|
if (ret = gxm->init(SCE_GXM_MULTISAMPLE_NONE); ret < 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -76,7 +76,7 @@ typedef struct GXMContext {
|
|||||||
|
|
||||||
void swap_display();
|
void swap_display();
|
||||||
void copy_frontbuffer();
|
void copy_frontbuffer();
|
||||||
int init();
|
int init(SceGxmMultisampleMode msaaMode);
|
||||||
void destroy();
|
void destroy();
|
||||||
void clear(float r, float g, float b, bool new_scene);
|
void clear(float r, float g, float b, bool new_scene);
|
||||||
void* alloc(size_t size, size_t align);
|
void* alloc(size_t size, size_t align);
|
||||||
|
|||||||
@ -36,7 +36,6 @@ extern bool g_dpadRight;
|
|||||||
|
|
||||||
#define VITA_GXM_COLOR_FORMAT SCE_GXM_COLOR_FORMAT_A8B8G8R8
|
#define VITA_GXM_COLOR_FORMAT SCE_GXM_COLOR_FORMAT_A8B8G8R8
|
||||||
#define VITA_GXM_PIXEL_FORMAT SCE_DISPLAY_PIXELFORMAT_A8B8G8R8
|
#define VITA_GXM_PIXEL_FORMAT SCE_DISPLAY_PIXELFORMAT_A8B8G8R8
|
||||||
const SceGxmMultisampleMode msaaMode = SCE_GXM_MULTISAMPLE_NONE;
|
|
||||||
|
|
||||||
#define SCE_GXM_PRECOMPUTED_ALIGNMENT 16
|
#define SCE_GXM_PRECOMPUTED_ALIGNMENT 16
|
||||||
|
|
||||||
@ -181,7 +180,7 @@ int gxm_library_init()
|
|||||||
|
|
||||||
GXMContext* gxm;
|
GXMContext* gxm;
|
||||||
|
|
||||||
int GXMContext::init()
|
int GXMContext::init(SceGxmMultisampleMode msaaMode)
|
||||||
{
|
{
|
||||||
if (this->context) {
|
if (this->context) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -475,7 +474,7 @@ int GXMContext::init()
|
|||||||
this->shaderPatcher,
|
this->shaderPatcher,
|
||||||
this->colorFragmentProgramId,
|
this->colorFragmentProgramId,
|
||||||
SCE_GXM_OUTPUT_REGISTER_FORMAT_UCHAR4,
|
SCE_GXM_OUTPUT_REGISTER_FORMAT_UCHAR4,
|
||||||
SCE_GXM_MULTISAMPLE_NONE,
|
msaaMode,
|
||||||
NULL,
|
NULL,
|
||||||
planeVertexProgramGxp,
|
planeVertexProgramGxp,
|
||||||
&this->colorFragmentProgram
|
&this->colorFragmentProgram
|
||||||
@ -489,7 +488,7 @@ int GXMContext::init()
|
|||||||
this->shaderPatcher,
|
this->shaderPatcher,
|
||||||
this->imageFragmentProgramId,
|
this->imageFragmentProgramId,
|
||||||
SCE_GXM_OUTPUT_REGISTER_FORMAT_UCHAR4,
|
SCE_GXM_OUTPUT_REGISTER_FORMAT_UCHAR4,
|
||||||
SCE_GXM_MULTISAMPLE_NONE,
|
msaaMode,
|
||||||
&blendInfoTransparent,
|
&blendInfoTransparent,
|
||||||
planeVertexProgramGxp,
|
planeVertexProgramGxp,
|
||||||
&this->imageFragmentProgram
|
&this->imageFragmentProgram
|
||||||
@ -669,27 +668,31 @@ void GXMContext::swap_display()
|
|||||||
this->backBufferIndex = (this->backBufferIndex + 1) % GXM_DISPLAY_BUFFER_COUNT;
|
this->backBufferIndex = (this->backBufferIndex + 1) % GXM_DISPLAY_BUFFER_COUNT;
|
||||||
}
|
}
|
||||||
|
|
||||||
Direct3DRMRenderer* GXMRenderer::Create(DWORD width, DWORD height)
|
Direct3DRMRenderer* GXMRenderer::Create(DWORD width, DWORD height, DWORD msaaSamples)
|
||||||
{
|
{
|
||||||
int ret = gxm_library_init();
|
int ret = gxm_library_init();
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
return new GXMRenderer(width, height);
|
return new GXMRenderer(width, height, msaaSamples);
|
||||||
}
|
}
|
||||||
|
|
||||||
GXMRenderer::GXMRenderer(DWORD width, DWORD height)
|
GXMRenderer::GXMRenderer(DWORD width, DWORD height, DWORD msaaSamples)
|
||||||
{
|
{
|
||||||
m_width = VITA_GXM_SCREEN_WIDTH;
|
m_width = VITA_GXM_SCREEN_WIDTH;
|
||||||
m_height = VITA_GXM_SCREEN_HEIGHT;
|
m_height = VITA_GXM_SCREEN_HEIGHT;
|
||||||
m_virtualWidth = width;
|
m_virtualWidth = width;
|
||||||
m_virtualHeight = height;
|
m_virtualHeight = height;
|
||||||
|
|
||||||
|
SceGxmMultisampleMode msaaMode = SCE_GXM_MULTISAMPLE_NONE;
|
||||||
|
if(msaaSamples == 2) msaaSamples = SCE_GXM_MULTISAMPLE_2X;
|
||||||
|
if(msaaSamples == 4) msaaSamples = SCE_GXM_MULTISAMPLE_4X;
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
if (!gxm) {
|
if (!gxm) {
|
||||||
gxm = (GXMContext*) SDL_malloc(sizeof(GXMContext));
|
gxm = (GXMContext*) SDL_malloc(sizeof(GXMContext));
|
||||||
}
|
}
|
||||||
ret = SCE_ERR(gxm->init);
|
ret = SCE_ERR(gxm->init, msaaMode);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,7 +64,7 @@ Direct3DRMRenderer* CreateDirect3DRMRenderer(
|
|||||||
#endif
|
#endif
|
||||||
#ifdef USE_GXM
|
#ifdef USE_GXM
|
||||||
if (SDL_memcmp(guid, &GXM_GUID, sizeof(GUID)) == 0) {
|
if (SDL_memcmp(guid, &GXM_GUID, sizeof(GUID)) == 0) {
|
||||||
return GXMRenderer::Create(DDSDesc.dwWidth, DDSDesc.dwHeight);
|
return GXMRenderer::Create(DDSDesc.dwWidth, DDSDesc.dwHeight, d3d->GetMSAASamples());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|||||||
@ -51,8 +51,8 @@ struct GXMSceneLightUniform {
|
|||||||
|
|
||||||
class GXMRenderer : public Direct3DRMRenderer {
|
class GXMRenderer : public Direct3DRMRenderer {
|
||||||
public:
|
public:
|
||||||
static Direct3DRMRenderer* Create(DWORD width, DWORD height);
|
static Direct3DRMRenderer* Create(DWORD width, DWORD height, DWORD msaaSamples);
|
||||||
GXMRenderer(DWORD width, DWORD height);
|
GXMRenderer(DWORD width, DWORD height, DWORD msaaSamples);
|
||||||
~GXMRenderer() override;
|
~GXMRenderer() override;
|
||||||
|
|
||||||
void PushLights(const SceneLight* lightsArray, size_t count) override;
|
void PushLights(const SceneLight* lightsArray, size_t count) override;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user