Vita: modern-librw render path + enable Neo pipelines
This commit is contained in:
@@ -33,7 +33,7 @@ jobs:
|
|||||||
- name: Build vitaGL
|
- name: Build vitaGL
|
||||||
run: |
|
run: |
|
||||||
git clone --depth 1 https://github.com/Rinnegatamante/vitaGL.git
|
git clone --depth 1 https://github.com/Rinnegatamante/vitaGL.git
|
||||||
make -C vitaGL NO_DEBUG=1 PHYCONT_ON_DEMAND=1 ENABLE_LEGACY_PIPELINE=1 -j"$(nproc)" install
|
make -C vitaGL NO_DEBUG=1 PHYCONT_ON_DEMAND=1 ENABLE_LEGACY_PIPELINE=1 HAVE_SHADER_CACHE=1 NO_SPLASHSCREEN=1 -j"$(nproc)" install
|
||||||
|
|
||||||
- name: Build librw-vita (fork, kept building against current vitaGL)
|
- name: Build librw-vita (fork, kept building against current vitaGL)
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -244,14 +244,6 @@ CGame::InitialiseRenderWare(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef LIBRW
|
#ifdef LIBRW
|
||||||
// librw-vita predates the envMap* knobs and only exposes modulateEnvMap.
|
|
||||||
#ifdef PSP2
|
|
||||||
#ifdef PS2_MATFX
|
|
||||||
rw::MatFX::modulateEnvMap = true;
|
|
||||||
#else
|
|
||||||
rw::MatFX::modulateEnvMap = false;
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#ifdef PS2_MATFX
|
#ifdef PS2_MATFX
|
||||||
rw::MatFX::envMapApplyLight = true;
|
rw::MatFX::envMapApplyLight = true;
|
||||||
rw::MatFX::envMapUseMatColor = true;
|
rw::MatFX::envMapUseMatColor = true;
|
||||||
@@ -263,7 +255,6 @@ CGame::InitialiseRenderWare(void)
|
|||||||
#endif
|
#endif
|
||||||
rw::RGBA envcol = { 128, 128, 128, 255 };
|
rw::RGBA envcol = { 128, 128, 128, 255 };
|
||||||
rw::MatFX::envMapColor = envcol;
|
rw::MatFX::envMapColor = envcol;
|
||||||
#endif
|
|
||||||
#else
|
#else
|
||||||
#ifdef PS2_MATFX
|
#ifdef PS2_MATFX
|
||||||
ReplaceMatFxCallback();
|
ReplaceMatFxCallback();
|
||||||
|
|||||||
@@ -66,9 +66,10 @@ extern bool useRearpad; // touch input: front panel or rear, see crossplatform.c
|
|||||||
#define FREE_CAM_TOGGLE
|
#define FREE_CAM_TOGGLE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PS2_ALPHA_TEST
|
#if defined(PS2_ALPHA_TEST) && !defined(PSP2)
|
||||||
#define DUALPASS_SELECTOR MENUACTION_CFO_SELECT, "FEM_2PR", { new CCFOSelect((int8*)&gPS2alphaTest, "Graphics", "PS2AlphaTest", off_on, 2, false) },
|
#define DUALPASS_SELECTOR MENUACTION_CFO_SELECT, "FEM_2PR", { new CCFOSelect((int8*)&gPS2alphaTest, "Graphics", "PS2AlphaTest", off_on, 2, false) },
|
||||||
#else
|
#else
|
||||||
|
// PSP2: PS2 alpha test is forced on with no menu row (gPS2alphaTest defaults to true).
|
||||||
#define DUALPASS_SELECTOR
|
#define DUALPASS_SELECTOR
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -114,8 +115,8 @@ void RestoreDefGraphics(int8 action) {
|
|||||||
if (action != FEOPTION_ACTION_SELECT)
|
if (action != FEOPTION_ACTION_SELECT)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef PS2_ALPHA_TEST
|
#if defined(PS2_ALPHA_TEST) && !defined(PSP2)
|
||||||
gPS2alphaTest = false;
|
gPS2alphaTest = false; // PSP2: kept forced-on, no menu toggle
|
||||||
#endif
|
#endif
|
||||||
#ifdef MULTISAMPLING
|
#ifdef MULTISAMPLING
|
||||||
FrontEndMenuManager.m_nPrefsMSAALevel = FrontEndMenuManager.m_nDisplayMSAALevel = 0;
|
FrontEndMenuManager.m_nPrefsMSAALevel = FrontEndMenuManager.m_nDisplayMSAALevel = 0;
|
||||||
|
|||||||
+3
-5
@@ -342,15 +342,13 @@ enum Config {
|
|||||||
//#define USE_TEXTURE_POOL
|
//#define USE_TEXTURE_POOL
|
||||||
#ifdef LIBRW
|
#ifdef LIBRW
|
||||||
#define EXTENDED_COLOURFILTER // more options for colour filter (replaces mblur)
|
#define EXTENDED_COLOURFILTER // more options for colour filter (replaces mblur)
|
||||||
// Not on PSP2: librw-vita is an old fork with no setupVertexInput, no three-argument
|
// librw-vita is now the modern fork, so these build on PSP2 as well. Runtime defaults:
|
||||||
// Shader::create and no UNIFORM_VEC4, so the Neo pipelines and the droplets cannot
|
// NEW_RENDERER is on (gbNewRenderer, PSP2), the Neo pipeline stays MATFX (stock look,
|
||||||
// build against it. They would also need Cg versions of every shader.
|
// opt-in via the graphics menu), and SCREEN_DROPLETS only shows in rain.
|
||||||
#ifndef PSP2
|
|
||||||
#define EXTENDED_PIPELINES // custom render pipelines (includes Neo)
|
#define EXTENDED_PIPELINES // custom render pipelines (includes Neo)
|
||||||
#define SCREEN_DROPLETS // neo water droplets
|
#define SCREEN_DROPLETS // neo water droplets
|
||||||
#define NEW_RENDERER // leeds-like world rendering, needs librw
|
#define NEW_RENDERER // leeds-like world rendering, needs librw
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#define FIX_SPRITES // fix sprites aspect ratio(moon, coronas, particle etc)
|
#define FIX_SPRITES // fix sprites aspect ratio(moon, coronas, particle etc)
|
||||||
|
|
||||||
|
|||||||
+19
-21
@@ -136,7 +136,13 @@ bool gbPrintMemoryUsage;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef NEW_RENDERER
|
#ifdef NEW_RENDERER
|
||||||
|
#ifdef PSP2
|
||||||
|
// On by default on Vita: the Leeds-like renderer's culling/batching boosts perf on
|
||||||
|
// the weak CPU (measurable in dense/moving scenes). INI/debug menu can still toggle it.
|
||||||
|
bool gbNewRenderer = true;
|
||||||
|
#else
|
||||||
bool gbNewRenderer;
|
bool gbNewRenderer;
|
||||||
|
#endif
|
||||||
#define CLEARMODE (rwCAMERACLEARZ | rwCAMERACLEARSTENCIL)
|
#define CLEARMODE (rwCAMERACLEARZ | rwCAMERACLEARSTENCIL)
|
||||||
#else
|
#else
|
||||||
#define CLEARMODE (rwCAMERACLEARZ)
|
#define CLEARMODE (rwCAMERACLEARZ)
|
||||||
@@ -378,11 +384,6 @@ RwGrabScreen(RwCamera *camera, RwChar *filename)
|
|||||||
#define TILE_WIDTH 576
|
#define TILE_WIDTH 576
|
||||||
#define TILE_HEIGHT 432
|
#define TILE_HEIGHT 432
|
||||||
|
|
||||||
#ifdef PSP2
|
|
||||||
extern GLuint fxfb;
|
|
||||||
bool using_fbo = false;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DoRWStuffEndOfFrame(void)
|
DoRWStuffEndOfFrame(void)
|
||||||
{
|
{
|
||||||
@@ -391,18 +392,6 @@ DoRWStuffEndOfFrame(void)
|
|||||||
FlushObrsPrintfs();
|
FlushObrsPrintfs();
|
||||||
RwCameraEndUpdate(Scene.camera);
|
RwCameraEndUpdate(Scene.camera);
|
||||||
|
|
||||||
#if defined(PSP2) && defined(EXTENDED_COLOURFILTER)
|
|
||||||
// Arm the next frame's capture: bind our FBO once CPostFX has asked for it, so
|
|
||||||
// the scene renders into fxraster and the colour filter can sample it.
|
|
||||||
if(CPostFX::NeedBackBuffer()){
|
|
||||||
if (using_fbo) {
|
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, fxfb);
|
|
||||||
using_fbo = false;
|
|
||||||
} else
|
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
RsCameraShowRaster(Scene.camera);
|
RsCameraShowRaster(Scene.camera);
|
||||||
#ifndef MASTER
|
#ifndef MASTER
|
||||||
char s[48];
|
char s[48];
|
||||||
@@ -1706,14 +1695,23 @@ Idle(void *arg)
|
|||||||
RwCameraSetFogDistance(Scene.camera, CTimeCycle::GetFogStart());
|
RwCameraSetFogDistance(Scene.camera, CTimeCycle::GetFogStart());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef EXTENDED_PIPELINES
|
||||||
|
// Render the env-map reflection BEFORE the main scene, not after. On the Vita
|
||||||
|
// tile-based GPU the env-map RTT (a render-target switch with its own depth)
|
||||||
|
// left the depth-dependent late passes (coronas, shadows, glints) rendering
|
||||||
|
// against a disturbed state, so they showed through geometry. Doing it first
|
||||||
|
// makes RenderScene the last thing to touch the display + depth, so those
|
||||||
|
// passes see a clean scene. Also removes the one-frame lag on car reflections.
|
||||||
|
CustomPipes::EnvMapRender();
|
||||||
|
// EnvMapRender leaves render state from the reflection pass; reset it so the
|
||||||
|
// main scene (and the depth-dependent passes after it) start clean.
|
||||||
|
DefinedState();
|
||||||
|
#endif
|
||||||
|
|
||||||
tbStartTimer(0, "RenderScene");
|
tbStartTimer(0, "RenderScene");
|
||||||
RenderScene();
|
RenderScene();
|
||||||
tbEndTimer("RenderScene");
|
tbEndTimer("RenderScene");
|
||||||
|
|
||||||
#ifdef EXTENDED_PIPELINES
|
|
||||||
CustomPipes::EnvMapRender();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
RenderDebugShit();
|
RenderDebugShit();
|
||||||
RenderEffects();
|
RenderEffects();
|
||||||
|
|
||||||
|
|||||||
@@ -135,13 +135,17 @@ CustomFrontendOptionsPopulate(void)
|
|||||||
FrontendOptionSetCursor(MENUPAGE_GRAPHICS_SETTINGS, -3, false);
|
FrontendOptionSetCursor(MENUPAGE_GRAPHICS_SETTINGS, -3, false);
|
||||||
FrontendOptionAddSelect("FED_VPL", vehPipelineNames, ARRAY_SIZE(vehPipelineNames), (int8*)&CustomPipes::VehiclePipeSwitch, false, nil, "Graphics", "VehiclePipeline");
|
FrontendOptionAddSelect("FED_VPL", vehPipelineNames, ARRAY_SIZE(vehPipelineNames), (int8*)&CustomPipes::VehiclePipeSwitch, false, nil, "Graphics", "VehiclePipeline");
|
||||||
FrontendOptionAddSelect("FED_PRM", off_on, 2, (int8*)&CustomPipes::RimlightEnable, false, nil, "Graphics", "NeoRimLight");
|
FrontendOptionAddSelect("FED_PRM", off_on, 2, (int8*)&CustomPipes::RimlightEnable, false, nil, "Graphics", "NeoRimLight");
|
||||||
|
#ifndef PSP2
|
||||||
FrontendOptionAddSelect("FED_WLM", off_on, 2, (int8*)&CustomPipes::LightmapEnable, false, nil, "Graphics", "NeoLightMaps");
|
FrontendOptionAddSelect("FED_WLM", off_on, 2, (int8*)&CustomPipes::LightmapEnable, false, nil, "Graphics", "NeoLightMaps");
|
||||||
|
#endif
|
||||||
FrontendOptionAddSelect("FED_RGL", off_on, 2, (int8*)&CustomPipes::GlossEnable, false, nil, "Graphics", "NeoRoadGloss");
|
FrontendOptionAddSelect("FED_RGL", off_on, 2, (int8*)&CustomPipes::GlossEnable, false, nil, "Graphics", "NeoRoadGloss");
|
||||||
#else
|
#else
|
||||||
FrontendOptionSetCursor(MENUPAGE_DISPLAY_SETTINGS, -3, false);
|
FrontendOptionSetCursor(MENUPAGE_DISPLAY_SETTINGS, -3, false);
|
||||||
FrontendOptionAddSelect("FED_VPL", vehPipelineNames, ARRAY_SIZE(vehPipelineNames), (int8*)&CustomPipes::VehiclePipeSwitch, false, nil, "Graphics", "VehiclePipeline");
|
FrontendOptionAddSelect("FED_VPL", vehPipelineNames, ARRAY_SIZE(vehPipelineNames), (int8*)&CustomPipes::VehiclePipeSwitch, false, nil, "Graphics", "VehiclePipeline");
|
||||||
FrontendOptionAddSelect("FED_PRM", off_on, 2, (int8*)&CustomPipes::RimlightEnable, false, nil, "Graphics", "NeoRimLight");
|
FrontendOptionAddSelect("FED_PRM", off_on, 2, (int8*)&CustomPipes::RimlightEnable, false, nil, "Graphics", "NeoRimLight");
|
||||||
|
#ifndef PSP2
|
||||||
FrontendOptionAddSelect("FED_WLM", off_on, 2, (int8*)&CustomPipes::LightmapEnable, false, nil, "Graphics", "NeoLightMaps");
|
FrontendOptionAddSelect("FED_WLM", off_on, 2, (int8*)&CustomPipes::LightmapEnable, false, nil, "Graphics", "NeoLightMaps");
|
||||||
|
#endif
|
||||||
FrontendOptionAddSelect("FED_RGL", off_on, 2, (int8*)&CustomPipes::GlossEnable, false, nil, "Graphics", "NeoRoadGloss");
|
FrontendOptionAddSelect("FED_RGL", off_on, 2, (int8*)&CustomPipes::GlossEnable, false, nil, "Graphics", "NeoRoadGloss");
|
||||||
#endif
|
#endif
|
||||||
CFileMgr::CloseFile(fd);
|
CFileMgr::CloseFile(fd);
|
||||||
|
|||||||
+2
-47
@@ -13,11 +13,6 @@
|
|||||||
#include "MBlur.h"
|
#include "MBlur.h"
|
||||||
#include "postfx.h"
|
#include "postfx.h"
|
||||||
|
|
||||||
#ifdef PSP2
|
|
||||||
GLuint fxraster = 0xDEADBEEF, fxfb;
|
|
||||||
extern bool using_fbo;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
RwRaster *CPostFX::pFrontBuffer;
|
RwRaster *CPostFX::pFrontBuffer;
|
||||||
RwRaster *CPostFX::pBackBuffer;
|
RwRaster *CPostFX::pBackBuffer;
|
||||||
bool CPostFX::bJustInitialised;
|
bool CPostFX::bJustInitialised;
|
||||||
@@ -160,39 +155,22 @@ CPostFX::Open(RwCamera *cam)
|
|||||||
contrast_PS = rw::d3d::createPixelShader(contrastPS_cso);
|
contrast_PS = rw::d3d::createPixelShader(contrastPS_cso);
|
||||||
#endif
|
#endif
|
||||||
#ifdef RW_OPENGL
|
#ifdef RW_OPENGL
|
||||||
#ifdef PSP2
|
|
||||||
#include "shaders/im2d_v_cg.inc"
|
|
||||||
#endif
|
|
||||||
using namespace rw::gl3;
|
using namespace rw::gl3;
|
||||||
{
|
{
|
||||||
#ifdef PSP2
|
|
||||||
#include "shaders/colourfilterIII_f_cg.inc"
|
|
||||||
const char *vs[] = { im2d_v_cg_src, nil };
|
|
||||||
const char *fs[] = { colourfilterIII_f_cg_src, nil };
|
|
||||||
colourFilterIII = Shader::create(vs, fs, true);
|
|
||||||
#else
|
|
||||||
#include "shaders/obj/im2d_vert.inc"
|
#include "shaders/obj/im2d_vert.inc"
|
||||||
#include "shaders/obj/colourfilterIII_frag.inc"
|
#include "shaders/obj/colourfilterIII_frag.inc"
|
||||||
const char *vs[] = { shaderDecl, header_vert_src, im2d_vert_src, nil };
|
const char *vs[] = { shaderDecl, header_vert_src, im2d_vert_src, nil };
|
||||||
const char *fs[] = { shaderDecl, header_frag_src, colourfilterIII_frag_src, nil };
|
const char *fs[] = { shaderDecl, header_frag_src, colourfilterIII_frag_src, nil };
|
||||||
colourFilterIII = Shader::create(vs, fs);
|
colourFilterIII = Shader::create(vs, fs);
|
||||||
#endif
|
|
||||||
assert(colourFilterIII);
|
assert(colourFilterIII);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
#ifdef PSP2
|
|
||||||
#include "shaders/contrast_f_cg.inc"
|
|
||||||
const char *vs[] = { im2d_v_cg_src, nil };
|
|
||||||
const char *fs[] = { contrast_f_cg_src, nil };
|
|
||||||
contrast = Shader::create(vs, fs, true);
|
|
||||||
#else
|
|
||||||
#include "shaders/obj/im2d_vert.inc"
|
#include "shaders/obj/im2d_vert.inc"
|
||||||
#include "shaders/obj/contrast_frag.inc"
|
#include "shaders/obj/contrast_frag.inc"
|
||||||
const char *vs[] = { shaderDecl, header_vert_src, im2d_vert_src, nil };
|
const char *vs[] = { shaderDecl, header_vert_src, im2d_vert_src, nil };
|
||||||
const char *fs[] = { shaderDecl, header_frag_src, contrast_frag_src, nil };
|
const char *fs[] = { shaderDecl, header_frag_src, contrast_frag_src, nil };
|
||||||
contrast = Shader::create(vs, fs);
|
contrast = Shader::create(vs, fs);
|
||||||
#endif
|
|
||||||
assert(contrast);
|
assert(contrast);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -331,14 +309,8 @@ CPostFX::RenderOverlayShader(RwCamera *cam, int32 r, int32 g, int32 b, int32 a)
|
|||||||
glUniform4fv(colourFilterIII->uniformLocations[u_blurcolor], 1, blurcolors);
|
glUniform4fv(colourFilterIII->uniformLocations[u_blurcolor], 1, blurcolors);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#ifdef PSP2
|
// Vita now captures via GetBackBuffer (glBlitFramebuffer in librw's
|
||||||
// The scene lives in our own FBO texture here, not in pBackBuffer.
|
// rasterRenderFast) into pBackBuffer, sampled through the texture raster set above.
|
||||||
glBindTexture(GL_TEXTURE_2D, fxraster);
|
|
||||||
RwIm2DVertexSetIntRGBA(&Vertex[0], 255, 255, 255, 255);
|
|
||||||
RwIm2DVertexSetIntRGBA(&Vertex[1], 255, 255, 255, 255);
|
|
||||||
RwIm2DVertexSetIntRGBA(&Vertex[2], 255, 255, 255, 255);
|
|
||||||
RwIm2DVertexSetIntRGBA(&Vertex[3], 255, 255, 255, 255);
|
|
||||||
#endif
|
|
||||||
RwIm2DRenderIndexedPrimitive(rwPRIMTYPETRILIST, Vertex, 4, Index, 6);
|
RwIm2DRenderIndexedPrimitive(rwPRIMTYPETRILIST, Vertex, 4, Index, 6);
|
||||||
#ifdef RW_D3D9
|
#ifdef RW_D3D9
|
||||||
rw::d3d::im2dOverridePS = nil;
|
rw::d3d::im2dOverridePS = nil;
|
||||||
@@ -466,11 +438,8 @@ CPostFX::Render(RwCamera *cam, uint32 red, uint32 green, uint32 blue, uint32 blu
|
|||||||
assert(pFrontBuffer);
|
assert(pFrontBuffer);
|
||||||
assert(pBackBuffer);
|
assert(pBackBuffer);
|
||||||
|
|
||||||
// PSP2 captures the scene through its own FBO a frame ahead instead.
|
|
||||||
#ifndef PSP2
|
|
||||||
if(NeedBackBuffer())
|
if(NeedBackBuffer())
|
||||||
GetBackBuffer(cam);
|
GetBackBuffer(cam);
|
||||||
#endif
|
|
||||||
|
|
||||||
DefinedState();
|
DefinedState();
|
||||||
|
|
||||||
@@ -483,20 +452,6 @@ CPostFX::Render(RwCamera *cam, uint32 red, uint32 green, uint32 blue, uint32 blu
|
|||||||
if(!bJustInitialised)
|
if(!bJustInitialised)
|
||||||
RenderOverlaySniper(cam, red, green, blue, blur);
|
RenderOverlaySniper(cam, red, green, blue, blur);
|
||||||
}else{
|
}else{
|
||||||
#if defined(PSP2) && defined(EXTENDED_COLOURFILTER)
|
|
||||||
if (NeedBackBuffer()) {
|
|
||||||
if(fxraster == 0xDEADBEEF){
|
|
||||||
glGenTextures(1, &fxraster);
|
|
||||||
glBindTexture(GL_TEXTURE_2D, fxraster);
|
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 960, 544, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
|
|
||||||
glGenFramebuffers(1, &fxfb);
|
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, fxfb);
|
|
||||||
glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, fxraster, 0);
|
|
||||||
}
|
|
||||||
using_fbo = true;
|
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
switch(EffectSwitch){
|
switch(EffectSwitch){
|
||||||
case POSTFX_OFF:
|
case POSTFX_OFF:
|
||||||
// no actual rendering here
|
// no actual rendering here
|
||||||
|
|||||||
@@ -299,40 +299,12 @@ RwTextureAddressMode RwTextureGetAddressingV(const RwTexture *texture);
|
|||||||
// TODO
|
// TODO
|
||||||
void _rwD3D8TexDictionaryEnableRasterFormatConversion(bool enable) { }
|
void _rwD3D8TexDictionaryEnableRasterFormatConversion(bool enable) { }
|
||||||
|
|
||||||
#ifdef PSP2
|
|
||||||
// librw-vita predates Raster::convertTexToCurrentPlatform, so do it by hand:
|
|
||||||
// round-trip through an Image, which also drops the palette the Vita cannot use.
|
|
||||||
static rw::Raster*
|
|
||||||
ConvertTexRaster(rw::Raster *ras)
|
|
||||||
{
|
|
||||||
using namespace rw;
|
|
||||||
|
|
||||||
if(ras->platform == rw::platform)
|
|
||||||
return ras;
|
|
||||||
// compatible platforms
|
|
||||||
if(ras->platform == PLATFORM_D3D8 && rw::platform == PLATFORM_D3D9 ||
|
|
||||||
ras->platform == PLATFORM_D3D9 && rw::platform == PLATFORM_D3D8)
|
|
||||||
return ras;
|
|
||||||
|
|
||||||
Image *img = ras->toImage();
|
|
||||||
ras->destroy();
|
|
||||||
img->unpalettize();
|
|
||||||
ras = Raster::createFromImage(img);
|
|
||||||
img->destroy();
|
|
||||||
return ras;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// hack for reading native textures
|
// hack for reading native textures
|
||||||
RwBool rwNativeTextureHackRead(RwStream *stream, RwTexture **tex, RwInt32 size)
|
RwBool rwNativeTextureHackRead(RwStream *stream, RwTexture **tex, RwInt32 size)
|
||||||
{
|
{
|
||||||
*tex = Texture::streamReadNative(stream);
|
*tex = Texture::streamReadNative(stream);
|
||||||
#ifdef LIBRW
|
#ifdef LIBRW
|
||||||
#ifdef PSP2
|
|
||||||
(*tex)->raster = ConvertTexRaster((*tex)->raster);
|
|
||||||
#else
|
|
||||||
(*tex)->raster = rw::Raster::convertTexToCurrentPlatform((*tex)->raster);
|
(*tex)->raster = rw::Raster::convertTexToCurrentPlatform((*tex)->raster);
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
return *tex != nil;
|
return *tex != nil;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-4
@@ -182,8 +182,7 @@ GetGPUcaps(GPUcaps *caps)
|
|||||||
caps->subplatform = 0;
|
caps->subplatform = 0;
|
||||||
caps->dxtSupport = 0;
|
caps->dxtSupport = 0;
|
||||||
// TODO: more later
|
// TODO: more later
|
||||||
// librw-vita has no gl3Caps.
|
#ifdef RW_GL3
|
||||||
#if defined(RW_GL3) && !defined(PSP2)
|
|
||||||
caps->subplatform = rw::gl3::gl3Caps.gles;
|
caps->subplatform = rw::gl3::gl3Caps.gles;
|
||||||
caps->dxtSupport = rw::gl3::gl3Caps.dxtSupported;
|
caps->dxtSupport = rw::gl3::gl3Caps.dxtSupported;
|
||||||
#endif
|
#endif
|
||||||
@@ -401,8 +400,7 @@ CreateTxdImageForVideoCard()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// librw-vita has no needToReadBackTextures - it always keeps texture data around.
|
#ifdef RW_GL3
|
||||||
#if defined(RW_GL3) && !defined(PSP2)
|
|
||||||
// so we can read back DXT with GLES
|
// so we can read back DXT with GLES
|
||||||
// only works for textures that are not yet loaded
|
// only works for textures that are not yet loaded
|
||||||
// so let's hope that is the case for all
|
// so let's hope that is the case for all
|
||||||
|
|||||||
@@ -816,6 +816,7 @@ void movie_player_draw(void) {
|
|||||||
sceAvPlayerClose(movie_player);
|
sceAvPlayerClose(movie_player);
|
||||||
movie_player_audio_shutdown();
|
movie_player_audio_shutdown();
|
||||||
player_state = PLAYER_INACTIVE;
|
player_state = PLAYER_INACTIVE;
|
||||||
|
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
vglSwapBuffers(GL_FALSE);
|
vglSwapBuffers(GL_FALSE);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user