Commit fa04c66f authored by m4xw's avatar m4xw
Browse files

[GLN64] Fixes after rebase & support for c++11

Potentially amend later
parent f82a1039
Pipeline #79181 failed with stages
in 4 minutes and 3 seconds
#include <algorithm>
#include <Revision.h>
#include "assert.h"
#include "math.h"
#include "Platform.h"
......
......@@ -11,6 +11,12 @@
#define GRAPHICS_CONTEXT
// Fix for C++11 Support
template<typename T, typename... Args>
std::unique_ptr<T> make_unique(Args&&... args) {
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}
struct CachedTexture;
namespace graphics {
......
#include <Config.h>
#include <Graphics/Context.h>
#include "glsl_CombinerProgramBuilderAccurate.h"
#include "glsl_CombinerProgramUniformFactoryAccurate.h"
......@@ -1194,7 +1195,7 @@ public:
namespace glsl {
CombinerProgramBuilderAccurate::CombinerProgramBuilderAccurate(const opengl::GLInfo & _glinfo, opengl::CachedUseProgram * _useProgram)
: CombinerProgramBuilderCommon(_glinfo, _useProgram, std::make_unique<CombinerProgramUniformFactoryAccurate>(_glinfo))
: CombinerProgramBuilderCommon(_glinfo, _useProgram, ::make_unique<CombinerProgramUniformFactoryAccurate>(_glinfo))
, m_vertexTexturedTriangle(new VertexShaderTexturedTriangle(_glinfo))
, m_vertexTexturedRect(new VertexShaderTexturedRect(_glinfo))
, m_fragmentCorrectTexCoords(new ShaderFragmentCorrectTexCoords())
......
#include <Config.h>
#include <Graphics/Context.h>
#include "glsl_CombinerProgramBuilderFast.h"
#include "glsl_CombinerProgramUniformFactoryFast.h"
......@@ -1140,7 +1141,7 @@ public:
namespace glsl {
CombinerProgramBuilderFast::CombinerProgramBuilderFast(const opengl::GLInfo & _glinfo, opengl::CachedUseProgram * _useProgram)
: CombinerProgramBuilderCommon(_glinfo, _useProgram, std::make_unique<CombinerProgramUniformFactoryFast>(_glinfo))
: CombinerProgramBuilderCommon(_glinfo, _useProgram, ::make_unique<CombinerProgramUniformFactoryFast>(_glinfo))
, m_vertexTexturedTriangle(new VertexShaderTexturedTriangleFast(_glinfo))
, m_vertexTexturedRect(new VertexShaderTexturedRectFast(_glinfo))
, m_fragmentGlobalVariablesTex(new ShaderFragmentGlobalVariablesTexFast(_glinfo))
......
......@@ -342,9 +342,9 @@ bool ShaderStorage::loadShadersStorage(graphics::Combiners & _combiners)
std::unique_ptr<CombinerProgramUniformFactory> uniformFactory;
if (config.generalEmulation.enableInaccurateTextureCoordinates) {
uniformFactory = std::make_unique<CombinerProgramUniformFactoryFast>(m_glinfo);
uniformFactory = ::make_unique<CombinerProgramUniformFactoryFast>(m_glinfo);
} else {
uniformFactory = std::make_unique<CombinerProgramUniformFactoryAccurate>(m_glinfo);
uniformFactory = ::make_unique<CombinerProgramUniformFactoryAccurate>(m_glinfo);
}
fin.read((char*)&len, sizeof(len));
......
......@@ -418,9 +418,9 @@ void ContextImpl::resetCombinerProgramBuilder()
return;
if (config.generalEmulation.enableInaccurateTextureCoordinates) {
m_combinerProgramBuilder = std::make_unique<glsl::CombinerProgramBuilderFast>(m_glInfo, m_cachedFunctions->getCachedUseProgram());
m_combinerProgramBuilder = ::make_unique<glsl::CombinerProgramBuilderFast>(m_glInfo, m_cachedFunctions->getCachedUseProgram());
} else {
m_combinerProgramBuilder = std::make_unique<glsl::CombinerProgramBuilderAccurate>(m_glInfo, m_cachedFunctions->getCachedUseProgram());
m_combinerProgramBuilder = ::make_unique<glsl::CombinerProgramBuilderAccurate>(m_glInfo, m_cachedFunctions->getCachedUseProgram());
}
m_specialShadersFactory.reset(new glsl::SpecialShadersFactory(m_glInfo,
......
......@@ -329,6 +329,12 @@ SOURCES_CXX += \
$(VIDEODIR_GLIDEN64)/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramBuilder.cpp \
$(VIDEODIR_GLIDEN64)/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramImpl.cpp \
$(VIDEODIR_GLIDEN64)/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramUniformFactory.cpp \
$(VIDEODIR_GLIDEN64)/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramUniformFactoryAccurate.cpp \
$(VIDEODIR_GLIDEN64)/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramUniformFactoryFast.cpp \
$(VIDEODIR_GLIDEN64)/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramUniformFactoryCommon.cpp \
$(VIDEODIR_GLIDEN64)/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramBuilderCommon.cpp \
$(VIDEODIR_GLIDEN64)/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramBuilderAccurate.cpp \
$(VIDEODIR_GLIDEN64)/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramBuilderFast.cpp \
$(VIDEODIR_GLIDEN64)/src/Graphics/OpenGLContext/GLSL/glsl_FXAA.cpp \
$(VIDEODIR_GLIDEN64)/src/Graphics/OpenGLContext/GLSL/glsl_ShaderStorage.cpp \
$(VIDEODIR_GLIDEN64)/src/Graphics/OpenGLContext/GLSL/glsl_SpecialShadersFactory.cpp \
......@@ -382,6 +388,8 @@ SOURCES_CXX += \
$(VIDEODIR_GLIDEN64)/src/GLideNHQ/TxFilter.cpp \
$(VIDEODIR_GLIDEN64)/src/GLideNHQ/TxFilterExport.cpp \
$(VIDEODIR_GLIDEN64)/src/GLideNHQ/TxHiResCache.cpp \
$(VIDEODIR_GLIDEN64)/src/GLideNHQ/TxHiResNoCache.cpp \
$(VIDEODIR_GLIDEN64)/src/GLideNHQ/TxHiResLoader.cpp \
$(VIDEODIR_GLIDEN64)/src/GLideNHQ/TxImage.cpp \
$(VIDEODIR_GLIDEN64)/src/GLideNHQ/TxQuantize.cpp \
$(VIDEODIR_GLIDEN64)/src/GLideNHQ/TxReSample.cpp \
......
......@@ -319,3 +319,4 @@ char customini[] =
"frameBufferEmulation\\bufferSwapMode=1\n";
#endif
......@@ -149,6 +149,7 @@ extern "C" void Config_LoadConfig()
config.texture.bilinearMode = bilinearMode;
config.generalEmulation.enableHybridFilter = EnableHybridFilter;
config.generalEmulation.enableInaccurateTextureCoordinates = EnableInaccurateTextureCoordinates;
config.generalEmulation.enableDitheringPattern = EnableDitheringPattern;
config.generalEmulation.enableDitheringQuantization = EnableDitheringQuantization;
config.generalEmulation.rdramImageDitheringMode = RDRAMImageDitheringMode;
......
......@@ -18064,3 +18064,4 @@ char inifile[] =
"\n";
#endif
......@@ -94,6 +94,7 @@ extern uint32_t RDRAMImageDitheringMode;
extern uint32_t EnableHWLighting;
extern uint32_t CorrectTexrectCoords;
extern uint32_t EnableTexCoordBounds;
extern uint32_t EnableInaccurateTextureCoordinates;
extern uint32_t enableNativeResTexrects;
extern uint32_t enableLegacyBlending;
extern uint32_t EnableCopyColorToRDRAM;
......
......@@ -166,6 +166,7 @@ uint32_t EnableDitheringQuantization = 0;
uint32_t EnableHWLighting = 0;
uint32_t CorrectTexrectCoords = 0;
uint32_t EnableTexCoordBounds = 0;
uint32_t EnableInaccurateTextureCoordinates = 0;
uint32_t enableNativeResTexrects = 0;
uint32_t enableLegacyBlending = 0;
uint32_t EnableCopyColorToRDRAM = 0;
......@@ -1030,6 +1031,13 @@ static void update_variables(bool startup)
EnableTexCoordBounds = !strcmp(var.value, "False") ? 0 : 1;
}
var.key = CORE_NAME "-EnableInaccurateTextureCoordinates";
var.value = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
EnableInaccurateTextureCoordinates = !strcmp(var.value, "False") ? 0 : 1;
}
var.key = CORE_NAME "-BackgroundMode";
var.value = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
......
......@@ -398,6 +398,20 @@ struct retro_core_option_v2_definition option_defs_us[] = {
},
"Off"
},
{
CORE_NAME "-EnableInaccurateTextureCoordinates",
"Enable inaccurate texture coordinates",
NULL,
"(GLN64) Enables inaccurate texture coordinate calculations. This can improve performance and texture pack compatibity at the cost of accuracy.",
"Enables inaccurate texture coordinate calculations. This can improve performance and texture pack compatibity at the cost of accuracy.",
"gliden64",
{
{"False", NULL},
{"True", NULL},
{ NULL, NULL },
},
"False"
},
{
CORE_NAME "-EnableTexCoordBounds",
"Enable native-res boundaries for texture coordinates",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment