From 1b70144c80440ec730fad570de4c724c62746a88 Mon Sep 17 00:00:00 2001 From: Benau Date: Fri, 20 Oct 2017 14:00:38 +0800 Subject: [PATCH] Reserve a graphics restriction for hardware skinning --- src/graphics/central_settings.cpp | 11 ++++- src/graphics/graphics_restrictions.cpp | 66 ++++++++++++++------------ src/graphics/graphics_restrictions.hpp | 1 + 3 files changed, 46 insertions(+), 32 deletions(-) diff --git a/src/graphics/central_settings.cpp b/src/graphics/central_settings.cpp index 26c566d96..3331f04e0 100644 --- a/src/graphics/central_settings.cpp +++ b/src/graphics/central_settings.cpp @@ -246,6 +246,11 @@ void CentralVideoSettings::init() hasSRGBFramebuffer = false; } } + if (!GraphicsRestrictions::isDisabled(GraphicsRestrictions::GR_HARDWARE_SKINNING)) + { + Log::info("GLDriver", "Hardware Skinning enabled, method: %s", + isARBShaderStorageBufferObjectUsable() ? "SSBO" : "TBO"); + } #else if (m_glsl == true) { @@ -286,6 +291,10 @@ void CentralVideoSettings::init() { m_need_vertex_id_workaround = true; } + if (!GraphicsRestrictions::isDisabled(GraphicsRestrictions::GR_HARDWARE_SKINNING)) + { + Log::info("GLDriver", "Hardware Skinning enabled, method: 1024 * 16 RGBA float texture"); + } #endif // Only unset the high def textures if they are set as default. If the @@ -527,7 +536,7 @@ bool CentralVideoSettings::isDefferedEnabled() const bool CentralVideoSettings::supportsHardwareSkinning() const { - return true; + return !GraphicsRestrictions::isDisabled(GraphicsRestrictions::GR_HARDWARE_SKINNING); } bool CentralVideoSettings::isARBTextureSwizzleUsable() const diff --git a/src/graphics/graphics_restrictions.cpp b/src/graphics/graphics_restrictions.cpp index 790af82cf..176d8b16c 100644 --- a/src/graphics/graphics_restrictions.cpp +++ b/src/graphics/graphics_restrictions.cpp @@ -44,37 +44,41 @@ namespace GraphicsRestrictions /** The list of names used in the XML file for the graphics * restriction types. They must be in the same order as the types. */ - std::array m_names_of_restrictions = { - "UniformBufferObject", - "GeometryShader", - "DrawIndirect", - "TextureView", - "TextureStorage", - "ImageLoadStore", - "BaseInstance", - "ComputeShader", - "ArraysOfArrays", - "ShaderStorageBufferObject", - "MultiDrawIndirect", - "ShaderAtomicCounters", - "BufferStorage", - "BindlessTexture", - "TextureCompressionS3TC", - "AMDVertexShaderLayer", - "ExplicitAttribLocation", - "TextureFilterAnisotropic", - "TextureFormatBGRA8888", - "ColorBufferFloat", - "DriverRecentEnough", - "HighDefinitionTextures", - "HighDefinitionTextures256", - "AdvancedPipeline", - "FramebufferSRGB", - "FramebufferSRGBWorkaround1", - "FramebufferSRGBWorkaround2", - "GI", - "ForceLegacyDevice", - "VertexIdWorking" + std::array m_names_of_restrictions = + { + { + "UniformBufferObject", + "GeometryShader", + "DrawIndirect", + "TextureView", + "TextureStorage", + "ImageLoadStore", + "BaseInstance", + "ComputeShader", + "ArraysOfArrays", + "ShaderStorageBufferObject", + "MultiDrawIndirect", + "ShaderAtomicCounters", + "BufferStorage", + "BindlessTexture", + "TextureCompressionS3TC", + "AMDVertexShaderLayer", + "ExplicitAttribLocation", + "TextureFilterAnisotropic", + "TextureFormatBGRA8888", + "ColorBufferFloat", + "DriverRecentEnough", + "HighDefinitionTextures", + "HighDefinitionTextures256", + "AdvancedPipeline", + "FramebufferSRGB", + "FramebufferSRGBWorkaround1", + "FramebufferSRGBWorkaround2", + "GI", + "ForceLegacyDevice", + "VertexIdWorking", + "HardwareSkinning" + } }; } // namespace Private using namespace Private; diff --git a/src/graphics/graphics_restrictions.hpp b/src/graphics/graphics_restrictions.hpp index ef1d6dbae..2d73c1578 100644 --- a/src/graphics/graphics_restrictions.hpp +++ b/src/graphics/graphics_restrictions.hpp @@ -64,6 +64,7 @@ namespace GraphicsRestrictions GR_GI, GR_FORCE_LEGACY_DEVICE, GR_VERTEX_ID_WORKING, + GR_HARDWARE_SKINNING, GR_COUNT /** MUST be last entry. */ } ;