[spline/bezier]Add support for unsupported device about HW tess.

This commit is contained in:
xebra committed 2017-02-25 19:28:13 +09:00
1 parent 0172bbe8aa
commit 7b72f87308
3 files changed
+25 -1

No files matched your search

+9
View File
@@ -41,6 +41,7 @@
#include "base/NativeApp.h"
#include "base/logging.h"
#include "profiler/profiler.h"
#include "i18n/i18n.h"
#include "Core/Debugger/Breakpoints.h"
#include "Core/MemMapHelpers.h"
#include "Core/MIPS/MIPS.h"
@@ -474,6 +475,14 @@ GPU_D3D11::GPU_D3D11(GraphicsContext *gfxCtx, Draw::DrawContext *draw)
// Some of our defaults are different from hw defaults, let's assert them.
// We restore each frame anyway, but here is convenient for tests.
textureCache_->NotifyConfigChanged();
if (g_Config.bHardwareTessellation) {
// Disable hardware tessellation bacause DX11 is still unsupported.
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_D3D11::~GPU_D3D11() {
+9
View File
@@ -22,6 +22,7 @@
#include "base/NativeApp.h"
#include "base/logging.h"
#include "profiler/profiler.h"
#include "i18n/i18n.h"
#include "Core/Debugger/Breakpoints.h"
#include "Core/MemMapHelpers.h"
#include "Core/MIPS/MIPS.h"
@@ -456,6 +457,14 @@ GPU_DX9::GPU_DX9(GraphicsContext *gfxCtx, Draw::DrawContext *draw)
// We restore each frame anyway, but here is convenient for tests.
dxstate.Restore();
textureCache_->NotifyConfigChanged();
if (g_Config.bHardwareTessellation) {
// Disable hardware tessellation bacause DX9 is still unsupported.
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);
}
}
void GPU_DX9::UpdateCmdInfo() {
+7 -1
View File
@@ -83,11 +83,15 @@ bool GameSettingsScreen::UseVerticalLayout() const {
// This needs before run CheckGPUFeatures()
// TODO: Remove this if fix the issue
<<<<<<< HEAD
bool CheckSupportInstancedTessellation() {
#if PPSSPP_PLATFORM(UWP)
return true;
#else
// TODO: Make work with non-GL backends
=======
bool CheckSupportInstancedTessellationGLES() {
>>>>>>> 4a6e0c9... [spline/bezier]Add support for unsupported device about HW tess.
int maxVertexTextureImageUnits;
glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &maxVertexTextureImageUnits);
bool vertexTexture = maxVertexTextureImageUnits >= 3; // At least 3 for hardware tessellation
@@ -312,7 +316,9 @@ void GameSettingsScreen::CreateViews() {
bezierChoiceDisable_ = g_Config.bSoftwareRendering || g_Config.bHardwareTessellation;
return UI::EVENT_CONTINUE;
});
tessHWEnable_ = CheckSupportInstancedTessellation() && !g_Config.bSoftwareRendering && g_Config.bHardwareTransform;
bool isBackendSupportHWTess = g_Config.iGPUBackend == GPU_BACKEND_OPENGL || g_Config.iGPUBackend == GPU_BACKEND_VULKAN;
bool isDeviceSupportInstTess = g_Config.iGPUBackend == GPU_BACKEND_OPENGL ? CheckSupportInstancedTessellationGLES() : isBackendSupportHWTess;
tessHWEnable_ = isDeviceSupportInstTess && !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.