mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-28 10:21:48 +00:00
Extend GL extension check with GLES versions and compatible extensions
This commit is contained in:
committed by
Baldur Karlsson
parent
6bc0851121
commit
a73c456a80
@@ -42,7 +42,7 @@ bool CheckReplayContext(PFNGLGETSTRINGPROC getStr, PFNGLGETINTEGERVPROC getInt,
|
||||
// as they should have minimal or no hardware requirement. They were present on mesa 10.6
|
||||
// for all drivers which dates to mid 2015.
|
||||
#undef EXT_TO_CHECK
|
||||
#define EXT_TO_CHECK(ver, ext) ext,
|
||||
#define EXT_TO_CHECK(ver, glesver, ext) ext,
|
||||
enum
|
||||
{
|
||||
EXTENSION_CHECKS() ext_count,
|
||||
@@ -73,8 +73,9 @@ bool CheckReplayContext(PFNGLGETSTRINGPROC getStr, PFNGLGETINTEGERVPROC getInt,
|
||||
ext += 3;
|
||||
|
||||
#undef EXT_TO_CHECK
|
||||
#define EXT_TO_CHECK(ver, extname) \
|
||||
if(GLCoreVersion >= ver || !strcmp(ext, STRINGIZE(extname))) \
|
||||
#define EXT_TO_CHECK(ver, glesver, extname) \
|
||||
if((!IsGLES && GLCoreVersion >= ver) || (IsGLES && GLCoreVersion >= glesver) || \
|
||||
!strcmp(ext, STRINGIZE(extname))) \
|
||||
exts[extname] = true;
|
||||
|
||||
EXTENSION_CHECKS()
|
||||
@@ -404,11 +405,21 @@ void CheckExtensions(const GLHookSet &gl)
|
||||
ext += 3;
|
||||
|
||||
#undef EXT_TO_CHECK
|
||||
#define EXT_TO_CHECK(ver, extname) \
|
||||
if(GLCoreVersion >= ver || !strcmp(ext, STRINGIZE(extname))) \
|
||||
#define EXT_TO_CHECK(ver, glesver, extname) \
|
||||
if((!IsGLES && GLCoreVersion >= ver) || (IsGLES && GLCoreVersion >= glesver) || \
|
||||
!strcmp(ext, STRINGIZE(extname))) \
|
||||
HasExt[extname] = true;
|
||||
|
||||
EXTENSION_CHECKS()
|
||||
|
||||
if(IsGLES)
|
||||
{
|
||||
#define EXT_COMP_CHECK(extname, glesextname) \
|
||||
if(!strcmp(ext, STRINGIZE(glesextname))) \
|
||||
HasExt[extname] = true;
|
||||
|
||||
EXTENSION_COMPATIBILITY_CHECKS()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -266,65 +266,89 @@ extern int GLCoreVersion;
|
||||
extern bool GLIsCore;
|
||||
extern bool IsGLES;
|
||||
|
||||
// list of extensions and the version when they became core
|
||||
// 99 means the extension never became core, so you can easily
|
||||
// just do a check of CoreVersion >= NN and they will always fail.
|
||||
#define EXTENSION_CHECKS() \
|
||||
EXT_TO_CHECK(33, ARB_explicit_attrib_location) \
|
||||
EXT_TO_CHECK(33, ARB_sampler_objects) \
|
||||
EXT_TO_CHECK(33, ARB_texture_swizzle) \
|
||||
EXT_TO_CHECK(40, ARB_draw_buffers_blend) \
|
||||
EXT_TO_CHECK(40, ARB_draw_indirect) \
|
||||
EXT_TO_CHECK(40, ARB_gpu_shader5) \
|
||||
EXT_TO_CHECK(40, ARB_sample_shading) \
|
||||
EXT_TO_CHECK(40, ARB_shader_subroutine) \
|
||||
EXT_TO_CHECK(40, ARB_tessellation_shader) \
|
||||
EXT_TO_CHECK(40, ARB_texture_cube_map_array) \
|
||||
EXT_TO_CHECK(40, ARB_transform_feedback2) \
|
||||
EXT_TO_CHECK(41, ARB_separate_shader_objects) \
|
||||
EXT_TO_CHECK(41, ARB_viewport_array) \
|
||||
EXT_TO_CHECK(42, ARB_base_instance) \
|
||||
EXT_TO_CHECK(42, ARB_shader_atomic_counters) \
|
||||
EXT_TO_CHECK(42, ARB_shader_image_load_store) \
|
||||
EXT_TO_CHECK(42, ARB_shading_language_420pack) \
|
||||
EXT_TO_CHECK(42, ARB_texture_storage) \
|
||||
EXT_TO_CHECK(43, ARB_clear_buffer_object) \
|
||||
EXT_TO_CHECK(43, ARB_compute_shader) \
|
||||
EXT_TO_CHECK(43, ARB_copy_image) \
|
||||
EXT_TO_CHECK(43, ARB_ES3_compatibility) \
|
||||
EXT_TO_CHECK(43, ARB_internalformat_query2) \
|
||||
EXT_TO_CHECK(43, ARB_program_interface_query) \
|
||||
EXT_TO_CHECK(43, ARB_shader_storage_buffer_object) \
|
||||
EXT_TO_CHECK(43, ARB_stencil_texturing) \
|
||||
EXT_TO_CHECK(43, ARB_texture_storage_multisample) \
|
||||
EXT_TO_CHECK(43, ARB_texture_view) \
|
||||
EXT_TO_CHECK(43, ARB_vertex_attrib_binding) \
|
||||
EXT_TO_CHECK(43, KHR_debug) \
|
||||
EXT_TO_CHECK(44, ARB_enhanced_layouts) \
|
||||
EXT_TO_CHECK(44, ARB_query_buffer_object) \
|
||||
EXT_TO_CHECK(45, ARB_clip_control) \
|
||||
EXT_TO_CHECK(99, ARB_indirect_parameters) \
|
||||
EXT_TO_CHECK(99, ARB_seamless_cubemap_per_texture) \
|
||||
EXT_TO_CHECK(99, EXT_depth_bounds_test) \
|
||||
EXT_TO_CHECK(99, EXT_direct_state_access) \
|
||||
EXT_TO_CHECK(99, EXT_polygon_offset_clamp) \
|
||||
EXT_TO_CHECK(99, EXT_raster_multisample) \
|
||||
EXT_TO_CHECK(99, EXT_texture_swizzle) \
|
||||
EXT_TO_CHECK(99, KHR_blend_equation_advanced_coherent) \
|
||||
/* OpenGL ES extensions */ \
|
||||
EXT_TO_CHECK(99, EXT_clip_cull_distance) \
|
||||
EXT_TO_CHECK(99, EXT_multisample_compatibility) \
|
||||
EXT_TO_CHECK(99, NV_polygon_mode) \
|
||||
EXT_TO_CHECK(99, NV_read_depth) \
|
||||
EXT_TO_CHECK(99, NV_read_stencil) \
|
||||
EXT_TO_CHECK(99, NV_read_depth_stencil) \
|
||||
EXT_TO_CHECK(99, OES_sample_shading)
|
||||
// List of extensions and the versions when they became core (first column for GL, second column for
|
||||
// GLES). In case of GLES compatible extensions and new features of the different versions are also
|
||||
// taken into account.
|
||||
// 99 means the extension never became core, so you can easily just do a check of CoreVersion >= NN
|
||||
// and they will always fail.
|
||||
#define EXTENSION_CHECKS() \
|
||||
EXT_TO_CHECK(33, 30, ARB_explicit_attrib_location) \
|
||||
EXT_TO_CHECK(33, 30, ARB_sampler_objects) \
|
||||
EXT_TO_CHECK(33, 30, ARB_texture_swizzle) \
|
||||
EXT_TO_CHECK(40, 32, ARB_draw_buffers_blend) \
|
||||
EXT_TO_CHECK(40, 31, ARB_draw_indirect) \
|
||||
EXT_TO_CHECK(40, 32, ARB_gpu_shader5) \
|
||||
EXT_TO_CHECK(40, 32, ARB_sample_shading) \
|
||||
EXT_TO_CHECK(40, 99, ARB_shader_subroutine) \
|
||||
EXT_TO_CHECK(40, 32, ARB_tessellation_shader) \
|
||||
EXT_TO_CHECK(40, 32, ARB_texture_cube_map_array) \
|
||||
EXT_TO_CHECK(40, 30, ARB_transform_feedback2) \
|
||||
EXT_TO_CHECK(41, 31, ARB_separate_shader_objects) \
|
||||
EXT_TO_CHECK(41, 99, ARB_viewport_array) \
|
||||
EXT_TO_CHECK(42, 99, ARB_base_instance) \
|
||||
EXT_TO_CHECK(42, 31, ARB_shader_atomic_counters) \
|
||||
EXT_TO_CHECK(42, 31, ARB_shader_image_load_store) \
|
||||
EXT_TO_CHECK(42, 31, ARB_shading_language_420pack) \
|
||||
EXT_TO_CHECK(42, 30, ARB_texture_storage) \
|
||||
EXT_TO_CHECK(43, 99, ARB_clear_buffer_object) \
|
||||
EXT_TO_CHECK(43, 31, ARB_compute_shader) \
|
||||
EXT_TO_CHECK(43, 32, ARB_copy_image) \
|
||||
EXT_TO_CHECK(43, 30, ARB_ES3_compatibility) \
|
||||
EXT_TO_CHECK(43, 99, ARB_internalformat_query2) \
|
||||
EXT_TO_CHECK(43, 31, ARB_program_interface_query) \
|
||||
EXT_TO_CHECK(43, 31, ARB_shader_storage_buffer_object) \
|
||||
EXT_TO_CHECK(43, 31, ARB_stencil_texturing) \
|
||||
EXT_TO_CHECK(43, 32, ARB_texture_storage_multisample) \
|
||||
EXT_TO_CHECK(43, 99, ARB_texture_view) \
|
||||
EXT_TO_CHECK(43, 31, ARB_vertex_attrib_binding) \
|
||||
EXT_TO_CHECK(43, 32, KHR_debug) \
|
||||
EXT_TO_CHECK(44, 99, ARB_enhanced_layouts) \
|
||||
EXT_TO_CHECK(44, 99, ARB_query_buffer_object) \
|
||||
EXT_TO_CHECK(45, 99, ARB_clip_control) \
|
||||
EXT_TO_CHECK(99, 99, ARB_indirect_parameters) \
|
||||
EXT_TO_CHECK(99, 99, ARB_seamless_cubemap_per_texture) \
|
||||
EXT_TO_CHECK(99, 99, EXT_depth_bounds_test) \
|
||||
EXT_TO_CHECK(99, 99, EXT_direct_state_access) \
|
||||
EXT_TO_CHECK(99, 99, EXT_polygon_offset_clamp) \
|
||||
EXT_TO_CHECK(99, 99, EXT_raster_multisample) \
|
||||
EXT_TO_CHECK(99, 30, EXT_texture_swizzle) \
|
||||
EXT_TO_CHECK(99, 32, KHR_blend_equation_advanced_coherent) \
|
||||
/* OpenGL ES extensions */ \
|
||||
EXT_TO_CHECK(99, 99, EXT_clip_cull_distance) \
|
||||
EXT_TO_CHECK(99, 99, EXT_multisample_compatibility) \
|
||||
EXT_TO_CHECK(99, 99, NV_polygon_mode) \
|
||||
EXT_TO_CHECK(99, 99, NV_read_depth) \
|
||||
EXT_TO_CHECK(99, 99, NV_read_stencil) \
|
||||
EXT_TO_CHECK(99, 99, NV_read_depth_stencil) \
|
||||
EXT_TO_CHECK(99, 32, OES_texture_storage_multisample_2d_array)
|
||||
|
||||
// GL extensions and their roughly equivalent GLES alternatives
|
||||
#define EXTENSION_COMPATIBILITY_CHECKS() \
|
||||
EXT_COMP_CHECK(ARB_base_instance, EXT_base_instance) \
|
||||
EXT_COMP_CHECK(ARB_copy_image, EXT_copy_image) \
|
||||
EXT_COMP_CHECK(ARB_copy_image, OES_copy_image) \
|
||||
EXT_COMP_CHECK(ARB_draw_buffers_blend, EXT_draw_buffers_indexed) \
|
||||
EXT_COMP_CHECK(ARB_draw_buffers_blend, OES_draw_buffers_indexed) \
|
||||
EXT_COMP_CHECK(ARB_gpu_shader5, EXT_gpu_shader5) \
|
||||
EXT_COMP_CHECK(ARB_gpu_shader5, OES_gpu_shader5) \
|
||||
EXT_COMP_CHECK(ARB_sample_shading, OES_sample_shading) \
|
||||
EXT_COMP_CHECK(ARB_separate_shader_objects, EXT_separate_shader_objects) \
|
||||
EXT_COMP_CHECK(ARB_tessellation_shader, EXT_tessellation_shader) \
|
||||
EXT_COMP_CHECK(ARB_tessellation_shader, OES_tessellation_shader) \
|
||||
EXT_COMP_CHECK(ARB_texture_cube_map_array, EXT_texture_cube_map_array) \
|
||||
EXT_COMP_CHECK(ARB_texture_cube_map_array, OES_texture_cube_map_array) \
|
||||
EXT_COMP_CHECK(ARB_texture_storage, EXT_texture_storage) \
|
||||
EXT_COMP_CHECK(ARB_texture_storage_multisample, OES_texture_storage_multisample_2d_array) \
|
||||
EXT_COMP_CHECK(ARB_texture_view, EXT_texture_view) \
|
||||
EXT_COMP_CHECK(ARB_texture_view, OES_texture_view) \
|
||||
EXT_COMP_CHECK(ARB_viewport_array, NV_viewport_array) \
|
||||
EXT_COMP_CHECK(ARB_viewport_array, OES_viewport_array)
|
||||
|
||||
// extensions we know we want to check for are precached, indexd by this enum
|
||||
enum ExtensionCheckEnum
|
||||
{
|
||||
#undef EXT_TO_CHECK
|
||||
#define EXT_TO_CHECK(ver, ext) ext,
|
||||
#define EXT_TO_CHECK(ver, glesver, ext) ext,
|
||||
EXTENSION_CHECKS()
|
||||
|
||||
GLExtension_Count,
|
||||
|
||||
@@ -287,6 +287,7 @@ void GLReplay::InitDebugData()
|
||||
|
||||
// TODO In case of GLES some currently unused shaders, which are guarded by HasExt[..] checks,
|
||||
// still contain compile errors (e.g. array2ms.comp, ms2array.comp, quad*, etc.).
|
||||
bool glesShadersAreComplete = !IsGLES;
|
||||
|
||||
GenerateGLSLShader(vs, shaderType, "", GetEmbeddedResource(glsl_blit_vert), glslBaseVer);
|
||||
|
||||
@@ -330,7 +331,7 @@ void GLReplay::InitDebugData()
|
||||
|
||||
GenerateGLSLShader(vs, shaderType, "", GetEmbeddedResource(glsl_blit_vert), glslBaseVer);
|
||||
|
||||
if(HasExt[ARB_shader_image_load_store] && HasExt[ARB_gpu_shader5])
|
||||
if(glesShadersAreComplete && HasExt[ARB_shader_image_load_store] && HasExt[ARB_gpu_shader5])
|
||||
{
|
||||
string defines = "";
|
||||
|
||||
@@ -462,7 +463,8 @@ void GLReplay::InitDebugData()
|
||||
"#extension GL_ARB_compute_shader : require\n"
|
||||
"#extension GL_ARB_shader_storage_buffer_object : require\n";
|
||||
|
||||
for(int t = 1; HasExt[ARB_compute_shader] && t <= RESTYPE_TEXTYPEMAX; t++)
|
||||
for(int t = 1; glesShadersAreComplete && HasExt[ARB_compute_shader] && t <= RESTYPE_TEXTYPEMAX;
|
||||
t++)
|
||||
{
|
||||
// float, uint, sint
|
||||
for(int i = 0; i < 3; i++)
|
||||
@@ -537,7 +539,7 @@ void GLReplay::InitDebugData()
|
||||
eGL_DYNAMIC_READ);
|
||||
}
|
||||
|
||||
if(HasExt[ARB_compute_shader])
|
||||
if(glesShadersAreComplete && HasExt[ARB_compute_shader])
|
||||
{
|
||||
GenerateGLSLShader(cs, shaderType, "", GetEmbeddedResource(glsl_ms2array_comp), glslCSVer);
|
||||
DebugData.MS2Array = CreateCShaderProgram(cs);
|
||||
@@ -555,7 +557,7 @@ void GLReplay::InitDebugData()
|
||||
"GL_ARB_compute_shader not supported, disabling 2DMS save/load.");
|
||||
}
|
||||
|
||||
if(HasExt[ARB_compute_shader])
|
||||
if(glesShadersAreComplete && HasExt[ARB_compute_shader])
|
||||
{
|
||||
string defines =
|
||||
"#extension GL_ARB_compute_shader : require\n"
|
||||
|
||||
@@ -415,7 +415,10 @@ private:
|
||||
|
||||
void CreateDebugData(const GLHookSet &gl);
|
||||
|
||||
bool Legacy() { return !attribsCreate || version < 32; }
|
||||
bool Legacy()
|
||||
{
|
||||
return !attribsCreate || (!IsGLES && version < 32) || (IsGLES && version < 20);
|
||||
}
|
||||
bool Modern() { return !Legacy(); }
|
||||
GLuint Program;
|
||||
GLuint GeneralUBO, StringUBO, GlyphUBO;
|
||||
|
||||
@@ -597,7 +597,8 @@ void GLResourceManager::PrepareTextureInitialContents(ResourceId liveid, Resourc
|
||||
}
|
||||
|
||||
state->seamless = GL_FALSE;
|
||||
if(details.curType == eGL_TEXTURE_CUBE_MAP || details.curType == eGL_TEXTURE_CUBE_MAP_ARRAY)
|
||||
if((details.curType == eGL_TEXTURE_CUBE_MAP || details.curType == eGL_TEXTURE_CUBE_MAP_ARRAY) &&
|
||||
HasExt[ARB_seamless_cubemap_per_texture])
|
||||
gl.glGetTextureParameterivEXT(res.name, details.curType, eGL_TEXTURE_CUBE_MAP_SEAMLESS,
|
||||
(GLint *)&state->seamless);
|
||||
|
||||
@@ -608,8 +609,7 @@ void GLResourceManager::PrepareTextureInitialContents(ResourceId liveid, Resourc
|
||||
|
||||
if(HasExt[ARB_texture_swizzle] || HasExt[EXT_texture_swizzle])
|
||||
{
|
||||
gl.glGetTextureParameterivEXT(res.name, details.curType, eGL_TEXTURE_SWIZZLE_RGBA,
|
||||
(GLint *)&state->swizzle[0]);
|
||||
GetTextureSwizzle(gl, res.name, details.curType, state->swizzle);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1976,7 +1976,8 @@ void GLResourceManager::Apply_InitialState(GLResource live, InitialContentData i
|
||||
gl.glTextureParameterivEXT(live.name, details.curType, eGL_DEPTH_STENCIL_TEXTURE_MODE,
|
||||
(GLint *)&state->depthMode);
|
||||
|
||||
if(details.curType == eGL_TEXTURE_CUBE_MAP || details.curType == eGL_TEXTURE_CUBE_MAP_ARRAY)
|
||||
if((details.curType == eGL_TEXTURE_CUBE_MAP || details.curType == eGL_TEXTURE_CUBE_MAP_ARRAY) &&
|
||||
HasExt[ARB_seamless_cubemap_per_texture])
|
||||
gl.glTextureParameterivEXT(live.name, details.curType, eGL_TEXTURE_CUBE_MAP_SEAMLESS,
|
||||
(GLint *)&state->seamless);
|
||||
|
||||
@@ -1987,8 +1988,9 @@ void GLResourceManager::Apply_InitialState(GLResource live, InitialContentData i
|
||||
|
||||
// assume that emulated (luminance, alpha-only etc) textures are not swizzled
|
||||
if(!details.emulated && (HasExt[ARB_texture_swizzle] || HasExt[EXT_texture_swizzle]))
|
||||
gl.glTextureParameterivEXT(live.name, details.curType, eGL_TEXTURE_SWIZZLE_RGBA,
|
||||
(GLint *)state->swizzle);
|
||||
{
|
||||
SetTextureSwizzle(gl, live.name, details.curType, state->swizzle);
|
||||
}
|
||||
|
||||
if(!ms)
|
||||
{
|
||||
|
||||
@@ -576,7 +576,7 @@ bool GLRenderState::CheckEnableDisableParam(GLenum pname)
|
||||
case eGL_SAMPLE_ALPHA_TO_ONE:
|
||||
case eGL_MULTISAMPLE: return HasExt[EXT_multisample_compatibility];
|
||||
|
||||
case eGL_SAMPLE_SHADING: return HasExt[OES_sample_shading];
|
||||
case eGL_SAMPLE_SHADING: return HasExt[ARB_sample_shading];
|
||||
|
||||
default: break;
|
||||
}
|
||||
|
||||
@@ -1350,7 +1350,7 @@ void GLReplay::SavePipelineState()
|
||||
GLint swizzles[4] = {eGL_RED, eGL_GREEN, eGL_BLUE, eGL_ALPHA};
|
||||
if(target != eGL_TEXTURE_BUFFER &&
|
||||
(HasExt[ARB_texture_swizzle] || HasExt[EXT_texture_swizzle]))
|
||||
gl.glGetTexParameteriv(target, eGL_TEXTURE_SWIZZLE_RGBA, swizzles);
|
||||
GetTextureSwizzle(gl.GetHookset(), tex, target, (GLenum *)swizzles);
|
||||
|
||||
for(int i = 0; i < 4; i++)
|
||||
{
|
||||
@@ -1763,7 +1763,7 @@ void GLReplay::SavePipelineState()
|
||||
(HasExt[ARB_texture_swizzle] || HasExt[EXT_texture_swizzle]))
|
||||
{
|
||||
GLenum target = m_pDriver->m_Textures[id].curType;
|
||||
gl.glGetTextureParameterivEXT(curCol[i], target, eGL_TEXTURE_SWIZZLE_RGBA, swizzles);
|
||||
GetTextureSwizzle(gl.GetHookset(), curCol[i], target, (GLenum *)swizzles);
|
||||
}
|
||||
|
||||
for(int s = 0; s < 4; s++)
|
||||
@@ -2979,9 +2979,9 @@ ResourceId GLReplay::CreateProxyTexture(const FetchTexture &templateTex)
|
||||
GLint bgrSwizzle[] = {eGL_BLUE, eGL_GREEN, eGL_RED, eGL_ONE};
|
||||
|
||||
if(templateTex.format.compCount == 4)
|
||||
gl.glTexParameteriv(binding, eGL_TEXTURE_SWIZZLE_RGBA, bgraSwizzle);
|
||||
SetTextureSwizzle(gl.GetHookset(), tex, binding, (GLenum *)bgraSwizzle);
|
||||
else if(templateTex.format.compCount == 3)
|
||||
gl.glTexParameteriv(binding, eGL_TEXTURE_SWIZZLE_RGBA, bgrSwizzle);
|
||||
SetTextureSwizzle(gl.GetHookset(), tex, binding, (GLenum *)bgrSwizzle);
|
||||
else
|
||||
RDCERR("Unexpected component count %d for BGRA order format", templateTex.format.compCount);
|
||||
}
|
||||
|
||||
@@ -635,6 +635,25 @@ void GetFramebufferMipAndLayer(const GLHookSet &gl, GLenum framebuffer, GLenum a
|
||||
}
|
||||
}
|
||||
|
||||
// GL_TEXTURE_SWIZZLE_RGBA is not supported on GLES, so for consistency we use r/g/b/a component
|
||||
// swizzles for both GL and GLES.
|
||||
// The same applies to SetTextureSwizzle function.
|
||||
void GetTextureSwizzle(const GLHookSet &gl, GLuint tex, GLenum target, GLenum *swizzleRGBA)
|
||||
{
|
||||
gl.glGetTextureParameterivEXT(tex, target, eGL_TEXTURE_SWIZZLE_R, (GLint *)&swizzleRGBA[0]);
|
||||
gl.glGetTextureParameterivEXT(tex, target, eGL_TEXTURE_SWIZZLE_G, (GLint *)&swizzleRGBA[1]);
|
||||
gl.glGetTextureParameterivEXT(tex, target, eGL_TEXTURE_SWIZZLE_B, (GLint *)&swizzleRGBA[2]);
|
||||
gl.glGetTextureParameterivEXT(tex, target, eGL_TEXTURE_SWIZZLE_A, (GLint *)&swizzleRGBA[3]);
|
||||
}
|
||||
|
||||
void SetTextureSwizzle(const GLHookSet &gl, GLuint tex, GLenum target, GLenum *swizzleRGBA)
|
||||
{
|
||||
gl.glTextureParameterivEXT(tex, target, eGL_TEXTURE_SWIZZLE_R, (GLint *)&swizzleRGBA[0]);
|
||||
gl.glTextureParameterivEXT(tex, target, eGL_TEXTURE_SWIZZLE_G, (GLint *)&swizzleRGBA[1]);
|
||||
gl.glTextureParameterivEXT(tex, target, eGL_TEXTURE_SWIZZLE_B, (GLint *)&swizzleRGBA[2]);
|
||||
gl.glTextureParameterivEXT(tex, target, eGL_TEXTURE_SWIZZLE_A, (GLint *)&swizzleRGBA[3]);
|
||||
}
|
||||
|
||||
bool EmulateLuminanceFormat(const GLHookSet &gl, GLuint tex, GLenum target, GLenum &internalFormat,
|
||||
GLenum &dataFormat)
|
||||
{
|
||||
@@ -740,7 +759,7 @@ bool EmulateLuminanceFormat(const GLHookSet &gl, GLuint tex, GLenum target, GLen
|
||||
{
|
||||
if(HasExt[ARB_texture_swizzle] || HasExt[EXT_texture_swizzle])
|
||||
{
|
||||
gl.glTextureParameterivEXT(tex, target, eGL_TEXTURE_SWIZZLE_RGBA, (GLint *)swizzle);
|
||||
SetTextureSwizzle(gl, tex, target, swizzle);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -37,6 +37,8 @@ GLenum GetDataType(GLenum internalFormat);
|
||||
GLenum GetSizedFormat(const GLHookSet &gl, GLenum target, GLenum internalFormat);
|
||||
void GetFramebufferMipAndLayer(const GLHookSet &gl, GLenum framebuffer, GLenum attachment,
|
||||
GLint *mip, GLint *layer);
|
||||
void GetTextureSwizzle(const GLHookSet &gl, GLuint tex, GLenum target, GLenum *swizzleRGBA);
|
||||
void SetTextureSwizzle(const GLHookSet &gl, GLuint tex, GLenum target, GLenum *swizzleRGBA);
|
||||
|
||||
bool EmulateLuminanceFormat(const GLHookSet &gl, GLuint tex, GLenum target, GLenum &internalFormat,
|
||||
GLenum &dataFormat);
|
||||
|
||||
@@ -1688,6 +1688,7 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg,
|
||||
GLsizei numSigProps = (GLsizei)ARRAY_COUNT(props);
|
||||
|
||||
// GL_LOCATION_COMPONENT not supported on core <4.4 (or without GL_ARB_enhanced_layouts)
|
||||
// and on GLES, either
|
||||
if(!HasExt[ARB_enhanced_layouts])
|
||||
numSigProps--;
|
||||
gl.glGetProgramResourceiv(sepProg, sigEnum, i, numSigProps, props, numSigProps, NULL, values);
|
||||
|
||||
@@ -549,7 +549,8 @@ void APIENTRY _glTextureStorage2DMultisampleEXT(GLuint texture, GLenum target, G
|
||||
GLsizei height, GLboolean fixedsamplelocations)
|
||||
{
|
||||
PushPopTexture(target, texture);
|
||||
if(HasExt[ARB_texture_storage] && HasExt[ARB_texture_storage_multisample] &&
|
||||
if(((IsGLES && GLCoreVersion >= 31) ||
|
||||
(!IsGLES && HasExt[ARB_texture_storage] && HasExt[ARB_texture_storage_multisample])) &&
|
||||
internalGL->glTexStorage2DMultisample)
|
||||
{
|
||||
internalGL->glTexStorage2DMultisample(target, samples, internalformat, width, height,
|
||||
@@ -567,7 +568,8 @@ void APIENTRY _glTextureStorage3DMultisampleEXT(GLuint texture, GLenum target, G
|
||||
GLsizei depth, GLboolean fixedsamplelocations)
|
||||
{
|
||||
PushPopTexture(target, texture);
|
||||
if(HasExt[ARB_texture_storage] && HasExt[ARB_texture_storage_multisample] &&
|
||||
if(((IsGLES && HasExt[OES_texture_storage_multisample_2d_array]) ||
|
||||
(!IsGLES && HasExt[ARB_texture_storage] && HasExt[ARB_texture_storage_multisample])) &&
|
||||
internalGL->glTexStorage3DMultisample)
|
||||
{
|
||||
internalGL->glTexStorage3DMultisample(target, samples, internalformat, width, height, depth,
|
||||
|
||||
Reference in New Issue
Block a user