mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
[spline/bezier]Turn off Hardware Tessellation if device is unsupported.
This commit is contained in:
parent
159aa1415d
commit
6adddbbd38
3 changed files with 29 additions and 1 deletions
|
@ -17,6 +17,7 @@
|
|||
|
||||
#include "base/logging.h"
|
||||
#include "profiler/profiler.h"
|
||||
#include "i18n/i18n.h"
|
||||
|
||||
#include "Common/ChunkFile.h"
|
||||
#include "Common/GraphicsContext.h"
|
||||
|
@ -471,6 +472,17 @@ GPU_GLES::GPU_GLES(GraphicsContext *gfxCtx, Draw::DrawContext *draw)
|
|||
shaderCachePath_ = GetSysDirectory(DIRECTORY_APP_CACHE) + "/" + g_paramSFO.GetValueString("DISC_ID") + ".glshadercache";
|
||||
shaderManagerGL_->LoadAndPrecompile(shaderCachePath_);
|
||||
}
|
||||
|
||||
if (g_Config.bHardwareTessellation) {
|
||||
// Disable hardware tessellation if device is unsupported.
|
||||
if (!gstate_c.Supports(GPU_SUPPORTS_INSTANCE_RENDERING | GPU_SUPPORTS_VERTEX_TEXTURE_FETCH | GPU_SUPPORTS_TEXTURE_FLOAT)) {
|
||||
// TODO: Check unsupported device name list.(Above gpu features are supported but it has issues with weak gpu, memory, shader compiler etc...)
|
||||
g_Config.bHardwareTessellation = false;
|
||||
ERROR_LOG(G3D, "Hardware Tessellation is unsupported, falling back to software tessellation");
|
||||
I18NCategory *gr = GetI18NCategory("Graphics");
|
||||
host->NotifyUserMessage(gr->T("Turn off Hardware Tessellation - unsupported"), 2.5f, 0xFF3030FF);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GPU_GLES::~GPU_GLES() {
|
||||
|
|
|
@ -76,6 +76,18 @@ bool GameSettingsScreen::UseVerticalLayout() const {
|
|||
return dp_yres > dp_xres * 1.1f;
|
||||
}
|
||||
|
||||
// This needs before run CheckGPUFeatures()
|
||||
// TODO: Remove this if fix the issue
|
||||
bool CheckSupportInstancedTessellation() {
|
||||
int maxVertexTextureImageUnits;
|
||||
glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &maxVertexTextureImageUnits);
|
||||
bool vertexTexture = maxVertexTextureImageUnits >= 3; // At least 3 for hardware tessellation
|
||||
bool instanceRendering = gl_extensions.EXT_gpu_shader4;
|
||||
bool textureFloat = gl_extensions.ARB_texture_float || gl_extensions.OES_texture_float;
|
||||
|
||||
return instanceRendering && vertexTexture && textureFloat;
|
||||
}
|
||||
|
||||
void GameSettingsScreen::CreateViews() {
|
||||
GameInfo *info = g_gameInfoCache->GetInfo(NULL, gamePath_, GAMEINFO_WANTBG | GAMEINFO_WANTSIZE);
|
||||
|
||||
|
@ -286,7 +298,8 @@ void GameSettingsScreen::CreateViews() {
|
|||
bezierChoiceDisable_ = g_Config.bSoftwareRendering || g_Config.bHardwareTessellation;
|
||||
return UI::EVENT_CONTINUE;
|
||||
});
|
||||
tessellationHW->SetEnabledPtr(&vtxCacheEnable_); // Same as Vertex Cache(!g_Config.bSoftwareRendering && g_Config.bHardwareTransform)
|
||||
tessHWEnable_ = CheckSupportInstancedTessellation() && !g_Config.bSoftwareRendering && g_Config.bHardwareTransform;
|
||||
tessellationHW->SetEnabledPtr(&tessHWEnable_);
|
||||
|
||||
// In case we're going to add few other antialiasing option like MSAA in the future.
|
||||
// graphicsSettings->Add(new CheckBox(&g_Config.bFXAA, gr->T("FXAA")));
|
||||
|
@ -724,11 +737,13 @@ UI::EventReturn GameSettingsScreen::OnSoftwareRendering(UI::EventParams &e) {
|
|||
postProcEnable_ = !g_Config.bSoftwareRendering && (g_Config.iRenderingMode != FB_NON_BUFFERED_MODE);
|
||||
resolutionEnable_ = !g_Config.bSoftwareRendering && (g_Config.iRenderingMode != FB_NON_BUFFERED_MODE);
|
||||
bezierChoiceDisable_ = g_Config.bSoftwareRendering || g_Config.bHardwareTessellation;
|
||||
tessHWEnable_ = CheckSupportInstancedTessellation() && !g_Config.bSoftwareRendering && g_Config.bHardwareTransform;
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnHardwareTransform(UI::EventParams &e) {
|
||||
vtxCacheEnable_ = !g_Config.bSoftwareRendering && g_Config.bHardwareTransform;
|
||||
tessHWEnable_ = CheckSupportInstancedTessellation() && !g_Config.bSoftwareRendering && g_Config.bHardwareTransform;
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
|
|
|
@ -117,6 +117,7 @@ private:
|
|||
bool resolutionEnable_;
|
||||
bool bloomHackEnable_;
|
||||
bool bezierChoiceDisable_;
|
||||
bool tessHWEnable_;
|
||||
};
|
||||
|
||||
class SettingInfoMessage : public UI::TextView {
|
||||
|
|
Loading…
Add table
Reference in a new issue