summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends
diff options
context:
space:
mode:
authorPokechu22 <Pokechu022@gmail.com>2023-03-05 21:50:00 -0800
committerPokechu22 <Pokechu022@gmail.com>2023-04-08 15:32:27 -0700
commitc68d484a6572fbf5a992d738ea9a4491f1cdcaab (patch)
tree33a1f79cfbc911132db84b9b31ac2b5bba819945 /Source/Core/VideoBackends
parent79b8e136b7d603aaa966dd39598ba136f028cd95 (diff)
OGL: Convert SupportedESPointSize to an enum class
Diffstat (limited to 'Source/Core/VideoBackends')
-rw-r--r--Source/Core/VideoBackends/OGL/OGLConfig.cpp13
-rw-r--r--Source/Core/VideoBackends/OGL/OGLConfig.h10
-rw-r--r--Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp5
3 files changed, 20 insertions, 8 deletions
diff --git a/Source/Core/VideoBackends/OGL/OGLConfig.cpp b/Source/Core/VideoBackends/OGL/OGLConfig.cpp
index ab31592bd2..9d426c2ff6 100644
--- a/Source/Core/VideoBackends/OGL/OGLConfig.cpp
+++ b/Source/Core/VideoBackends/OGL/OGLConfig.cpp
@@ -368,9 +368,10 @@ bool PopulateConfig(GLContext* m_main_gl_context)
if (m_main_gl_context->IsGLES())
{
- g_ogl_config.SupportedESPointSize = GLExtensions::Supports("GL_OES_geometry_point_size") ? 1 :
- GLExtensions::Supports("GL_EXT_geometry_point_size") ? 2 :
- 0;
+ g_ogl_config.SupportedESPointSize =
+ GLExtensions::Supports("GL_OES_geometry_point_size") ? EsPointSizeType::PointSizeOes :
+ GLExtensions::Supports("GL_EXT_geometry_point_size") ? EsPointSizeType::PointSizeExt :
+ EsPointSizeType::PointSizeNone;
g_ogl_config.SupportedESTextureBuffer =
GLExtensions::Supports("VERSION_GLES_3_2") ? EsTexbufType::TexbufCore :
GLExtensions::Supports("GL_OES_texture_buffer") ? EsTexbufType::TexbufOes :
@@ -410,7 +411,8 @@ bool PopulateConfig(GLContext* m_main_gl_context)
g_Config.backend_info.bSupportsGeometryShaders = g_ogl_config.bSupportsAEP;
g_Config.backend_info.bSupportsComputeShaders = true;
g_Config.backend_info.bSupportsGSInstancing =
- g_Config.backend_info.bSupportsGeometryShaders && g_ogl_config.SupportedESPointSize > 0;
+ g_Config.backend_info.bSupportsGeometryShaders &&
+ g_ogl_config.SupportedESPointSize != EsPointSizeType::PointSizeNone;
g_Config.backend_info.bSupportsSSAA = g_ogl_config.bSupportsAEP;
g_Config.backend_info.bSupportsFragmentStoresAndAtomics = true;
g_ogl_config.bSupportsMSAA = true;
@@ -434,7 +436,8 @@ bool PopulateConfig(GLContext* m_main_gl_context)
g_ogl_config.bSupportsImageLoadStore = true;
g_Config.backend_info.bSupportsGeometryShaders = true;
g_Config.backend_info.bSupportsComputeShaders = true;
- g_Config.backend_info.bSupportsGSInstancing = g_ogl_config.SupportedESPointSize > 0;
+ g_Config.backend_info.bSupportsGSInstancing =
+ g_ogl_config.SupportedESPointSize != EsPointSizeType::PointSizeNone;
g_Config.backend_info.bSupportsPaletteConversion = true;
g_Config.backend_info.bSupportsSSAA = true;
g_Config.backend_info.bSupportsFragmentStoresAndAtomics = true;
diff --git a/Source/Core/VideoBackends/OGL/OGLConfig.h b/Source/Core/VideoBackends/OGL/OGLConfig.h
index 570e1954eb..6e8946bc50 100644
--- a/Source/Core/VideoBackends/OGL/OGLConfig.h
+++ b/Source/Core/VideoBackends/OGL/OGLConfig.h
@@ -22,6 +22,14 @@ enum GlslVersion
GlslEs310, // GLES 3.1
GlslEs320, // GLES 3.2
};
+
+enum class EsPointSizeType
+{
+ PointSizeNone,
+ PointSizeOes,
+ PointSizeExt,
+};
+
enum class EsTexbufType
{
TexbufNone,
@@ -51,7 +59,7 @@ struct VideoConfig
bool bSupportsAEP;
bool bSupportsDebug;
bool bSupportsCopySubImage;
- u8 SupportedESPointSize;
+ EsPointSizeType SupportedESPointSize;
EsTexbufType SupportedESTextureBuffer;
bool bSupportsTextureStorage;
bool bSupports2DTextureStorageMultisample;
diff --git a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp
index eff1497e7f..b7dba51cf2 100644
--- a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp
+++ b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp
@@ -664,12 +664,13 @@ void ProgramShaderCache::CreateHeader()
std::string SupportedESTextureBuffer;
switch (g_ogl_config.SupportedESPointSize)
{
- case 1:
+ case EsPointSizeType::PointSizeOes:
SupportedESPointSize = "#extension GL_OES_geometry_point_size : enable";
break;
- case 2:
+ case EsPointSizeType::PointSizeExt:
SupportedESPointSize = "#extension GL_EXT_geometry_point_size : enable";
break;
+ case EsPointSizeType::PointSizeNone:
default:
SupportedESPointSize = "";
break;