mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Allow changing software skinning at runtime.
This commit is contained in:
parent
b379109380
commit
1c3b60a8ee
8 changed files with 43 additions and 14 deletions
|
@ -1862,7 +1862,7 @@ Thread *__KernelNextThread() {
|
||||||
|
|
||||||
void __KernelReSchedule(const char *reason)
|
void __KernelReSchedule(const char *reason)
|
||||||
{
|
{
|
||||||
// First, let's check if there are any pending callback to trigger.
|
// First, let's check if there are any pending callbacks to trigger.
|
||||||
// TODO: Could probably take this out of __KernelReSchedule() which is a bit hot.
|
// TODO: Could probably take this out of __KernelReSchedule() which is a bit hot.
|
||||||
__KernelCheckCallbacks();
|
__KernelCheckCallbacks();
|
||||||
|
|
||||||
|
|
|
@ -445,6 +445,7 @@ GLES_GPU::GLES_GPU()
|
||||||
|
|
||||||
if (g_Config.bSoftwareSkinning) {
|
if (g_Config.bSoftwareSkinning) {
|
||||||
cmdInfo_[GE_CMD_VERTEXTYPE].flags &= ~FLAG_FLUSHBEFOREONCHANGE;
|
cmdInfo_[GE_CMD_VERTEXTYPE].flags &= ~FLAG_FLUSHBEFOREONCHANGE;
|
||||||
|
cmdInfo_[GE_CMD_VERTEXTYPE].func = &GLES_GPU::Execute_VertexTypeSkinning;
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildReportingInfo();
|
BuildReportingInfo();
|
||||||
|
@ -562,6 +563,16 @@ inline void GLES_GPU::UpdateVsyncInterval(bool force) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLES_GPU::BeginFrameInternal() {
|
void GLES_GPU::BeginFrameInternal() {
|
||||||
|
if (resized_) {
|
||||||
|
if (g_Config.bSoftwareSkinning) {
|
||||||
|
cmdInfo_[GE_CMD_VERTEXTYPE].flags &= ~FLAG_FLUSHBEFOREONCHANGE;
|
||||||
|
cmdInfo_[GE_CMD_VERTEXTYPE].func = &GLES_GPU::Execute_VertexTypeSkinning;
|
||||||
|
} else {
|
||||||
|
cmdInfo_[GE_CMD_VERTEXTYPE].flags |= FLAG_FLUSHBEFOREONCHANGE;
|
||||||
|
cmdInfo_[GE_CMD_VERTEXTYPE].func = &GLES_GPU::Execute_VertexType;
|
||||||
|
}
|
||||||
|
transformDraw_.Resized();
|
||||||
|
}
|
||||||
UpdateVsyncInterval(resized_);
|
UpdateVsyncInterval(resized_);
|
||||||
resized_ = false;
|
resized_ = false;
|
||||||
|
|
||||||
|
@ -817,19 +828,20 @@ void GLES_GPU::Execute_Prim(u32 op, u32 diff) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLES_GPU::Execute_VertexType(u32 op, u32 diff) {
|
void GLES_GPU::Execute_VertexType(u32 op, u32 diff) {
|
||||||
if (!g_Config.bSoftwareSkinning) {
|
if (diff & (GE_VTYPE_TC_MASK | GE_VTYPE_THROUGH_MASK)) {
|
||||||
|
shaderManager_->DirtyUniform(DIRTY_UVSCALEOFFSET);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void GLES_GPU::Execute_VertexTypeSkinning(u32 op, u32 diff) {
|
||||||
|
// Don't flush when weight count changes, unless morph is enabled.
|
||||||
|
if ((diff & ~GE_VTYPE_WEIGHTCOUNT_MASK) || (op & GE_VTYPE_MORPHCOUNT_MASK) != 0) {
|
||||||
|
// Restore and flush
|
||||||
|
gstate.vertType ^= diff;
|
||||||
|
Flush();
|
||||||
|
gstate.vertType ^= diff;
|
||||||
if (diff & (GE_VTYPE_TC_MASK | GE_VTYPE_THROUGH_MASK))
|
if (diff & (GE_VTYPE_TC_MASK | GE_VTYPE_THROUGH_MASK))
|
||||||
shaderManager_->DirtyUniform(DIRTY_UVSCALEOFFSET);
|
shaderManager_->DirtyUniform(DIRTY_UVSCALEOFFSET);
|
||||||
} else {
|
|
||||||
// Don't flush when weight count changes, unless morph is enabled.
|
|
||||||
if ((diff & ~GE_VTYPE_WEIGHTCOUNT_MASK) || (op & GE_VTYPE_MORPHCOUNT_MASK) != 0) {
|
|
||||||
// Restore and flush
|
|
||||||
gstate.vertType ^= diff;
|
|
||||||
Flush();
|
|
||||||
gstate.vertType ^= diff;
|
|
||||||
if (diff & (GE_VTYPE_TC_MASK | GE_VTYPE_THROUGH_MASK))
|
|
||||||
shaderManager_->DirtyUniform(DIRTY_UVSCALEOFFSET);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -94,6 +94,7 @@ public:
|
||||||
void Execute_Spline(u32 op, u32 diff);
|
void Execute_Spline(u32 op, u32 diff);
|
||||||
void Execute_BoundingBox(u32 op, u32 diff);
|
void Execute_BoundingBox(u32 op, u32 diff);
|
||||||
void Execute_VertexType(u32 op, u32 diff);
|
void Execute_VertexType(u32 op, u32 diff);
|
||||||
|
void Execute_VertexTypeSkinning(u32 op, u32 diff);
|
||||||
void Execute_Region(u32 op, u32 diff);
|
void Execute_Region(u32 op, u32 diff);
|
||||||
void Execute_Scissor(u32 op, u32 diff);
|
void Execute_Scissor(u32 op, u32 diff);
|
||||||
void Execute_FramebufType(u32 op, u32 diff);
|
void Execute_FramebufType(u32 op, u32 diff);
|
||||||
|
|
|
@ -772,6 +772,16 @@ rotateVBO:
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TransformDrawEngine::Resized() {
|
||||||
|
decJitCache_->Clear();
|
||||||
|
lastVType_ = -1;
|
||||||
|
dec_ = NULL;
|
||||||
|
for (auto iter = decoderMap_.begin(); iter != decoderMap_.end(); iter++) {
|
||||||
|
delete iter->second;
|
||||||
|
}
|
||||||
|
decoderMap_.clear();
|
||||||
|
}
|
||||||
|
|
||||||
struct Plane {
|
struct Plane {
|
||||||
float x, y, z, w;
|
float x, y, z, w;
|
||||||
void Set(float _x, float _y, float _z, float _w) { x = _x; y = _y; z = _z; w = _w; }
|
void Set(float _x, float _y, float _z, float _w) { x = _x; y = _y; z = _z; w = _w; }
|
||||||
|
|
|
@ -119,6 +119,7 @@ public:
|
||||||
void InitDeviceObjects();
|
void InitDeviceObjects();
|
||||||
void DestroyDeviceObjects();
|
void DestroyDeviceObjects();
|
||||||
void GLLost();
|
void GLLost();
|
||||||
|
void Resized();
|
||||||
|
|
||||||
void DecimateTrackedVertexArrays();
|
void DecimateTrackedVertexArrays();
|
||||||
void ClearTrackedVertexArrays();
|
void ClearTrackedVertexArrays();
|
||||||
|
|
|
@ -905,6 +905,10 @@ VertexDecoderJitCache::VertexDecoderJitCache() {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VertexDecoderJitCache::Clear() {
|
||||||
|
ClearCodeSpace();
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(PPC)
|
#if defined(PPC)
|
||||||
|
|
||||||
#error This should not be built for PowerPC, at least not yet.
|
#error This should not be built for PowerPC, at least not yet.
|
||||||
|
|
|
@ -197,6 +197,7 @@ public:
|
||||||
|
|
||||||
// Returns a pointer to the code to run.
|
// Returns a pointer to the code to run.
|
||||||
JittedVertexDecoder Compile(const VertexDecoder &dec);
|
JittedVertexDecoder Compile(const VertexDecoder &dec);
|
||||||
|
void Clear();
|
||||||
|
|
||||||
void Jit_WeightsU8();
|
void Jit_WeightsU8();
|
||||||
void Jit_WeightsU16();
|
void Jit_WeightsU16();
|
||||||
|
|
|
@ -156,7 +156,7 @@ void GameSettingsScreen::CreateViews() {
|
||||||
hwTransform->SetEnabledPtr(&hwTransformEnable);
|
hwTransform->SetEnabledPtr(&hwTransformEnable);
|
||||||
|
|
||||||
CheckBox *swSkin = graphicsSettings->Add(new CheckBox(&g_Config.bSoftwareSkinning, gs->T("Software Skinning")));
|
CheckBox *swSkin = graphicsSettings->Add(new CheckBox(&g_Config.bSoftwareSkinning, gs->T("Software Skinning")));
|
||||||
swSkinningEnable = !PSP_IsInited() && !g_Config.bSoftwareRendering;
|
swSkinningEnable = !g_Config.bSoftwareRendering;
|
||||||
swSkin->SetEnabledPtr(&swSkinningEnable);
|
swSkin->SetEnabledPtr(&swSkinningEnable);
|
||||||
|
|
||||||
CheckBox *vtxCache = graphicsSettings->Add(new CheckBox(&g_Config.bVertexCache, gs->T("Vertex Cache")));
|
CheckBox *vtxCache = graphicsSettings->Add(new CheckBox(&g_Config.bVertexCache, gs->T("Vertex Cache")));
|
||||||
|
@ -427,7 +427,7 @@ UI::EventReturn GameSettingsScreen::OnSoftwareRendering(UI::EventParams &e) {
|
||||||
stencilTestEnable = !g_Config.bSoftwareRendering;
|
stencilTestEnable = !g_Config.bSoftwareRendering;
|
||||||
beziersEnable = !g_Config.bSoftwareRendering;
|
beziersEnable = !g_Config.bSoftwareRendering;
|
||||||
texSecondaryEnable = !g_Config.bSoftwareRendering;
|
texSecondaryEnable = !g_Config.bSoftwareRendering;
|
||||||
swSkinningEnable = !PSP_IsInited() && !g_Config.bSoftwareRendering;
|
swSkinningEnable = !g_Config.bSoftwareRendering;
|
||||||
hwTransformEnable = !g_Config.bSoftwareRendering;
|
hwTransformEnable = !g_Config.bSoftwareRendering;
|
||||||
vtxCacheEnable = hwTransformEnable && g_Config.bHardwareTransform;
|
vtxCacheEnable = hwTransformEnable && g_Config.bHardwareTransform;
|
||||||
texBackoffEnable = !g_Config.bSoftwareRendering;
|
texBackoffEnable = !g_Config.bSoftwareRendering;
|
||||||
|
|
Loading…
Add table
Reference in a new issue