mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-21 13:15:57 +00:00
Check extension for use of TEXTURE_BORDER_COLOR
* This wasn't supported on GLES until 3.2, or with OES_texture_border_color
This commit is contained in:
@@ -581,6 +581,7 @@ extern bool IsGLES;
|
||||
// 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(13, 99, ARB_texture_border_clamp) \
|
||||
EXT_TO_CHECK(30, 30, EXT_transform_feedback) \
|
||||
EXT_TO_CHECK(30, 32, EXT_draw_buffers2) \
|
||||
EXT_TO_CHECK(31, 99, ARB_texture_buffer_object) \
|
||||
@@ -640,6 +641,7 @@ extern bool IsGLES;
|
||||
EXT_TO_CHECK(99, 32, EXT_color_buffer_float) \
|
||||
EXT_TO_CHECK(99, 32, EXT_primitive_bounding_box) \
|
||||
EXT_TO_CHECK(99, 32, OES_primitive_bounding_box) \
|
||||
EXT_TO_CHECK(99, 32, OES_texture_border_color) \
|
||||
EXT_TO_CHECK(99, 32, OES_texture_storage_multisample_2d_array) \
|
||||
EXT_TO_CHECK(99, 99, EXT_clip_cull_distance) \
|
||||
EXT_TO_CHECK(99, 99, EXT_multisample_compatibility) \
|
||||
@@ -657,6 +659,7 @@ extern bool IsGLES;
|
||||
// Either promoted extensions from EXT to ARB, or
|
||||
// desktop extensions and their roughly equivalent GLES alternatives
|
||||
#define EXTENSION_COMPATIBILITY_CHECKS() \
|
||||
EXT_COMP_CHECK(ARB_texture_border_clamp, OES_texture_border_color) \
|
||||
EXT_COMP_CHECK(ARB_polygon_offset_clamp, EXT_polygon_offset_clamp) \
|
||||
EXT_COMP_CHECK(ARB_texture_filter_anisotropic, EXT_texture_filter_anisotropic) \
|
||||
EXT_COMP_CHECK(ARB_base_instance, EXT_base_instance) \
|
||||
|
||||
@@ -701,8 +701,16 @@ void GLResourceManager::PrepareTextureInitialContents(ResourceId liveid, Resourc
|
||||
(GLint *)&state.wrap[2]);
|
||||
GL.glGetTextureParameterfvEXT(res.name, details.curType, eGL_TEXTURE_MIN_LOD, &state.minLod);
|
||||
GL.glGetTextureParameterfvEXT(res.name, details.curType, eGL_TEXTURE_MAX_LOD, &state.maxLod);
|
||||
GL.glGetTextureParameterfvEXT(res.name, details.curType, eGL_TEXTURE_BORDER_COLOR,
|
||||
&state.border[0]);
|
||||
|
||||
// technically border color has been in since GL 1.0, but since this extension was really
|
||||
// early and dovetails nicely with OES_texture_border_color which added both border colors and
|
||||
// clamping, we check it.
|
||||
if(HasExt[ARB_texture_border_clamp])
|
||||
GL.glGetTextureParameterfvEXT(res.name, details.curType, eGL_TEXTURE_BORDER_COLOR,
|
||||
&state.border[0]);
|
||||
else
|
||||
state.border[0] = state.border[1] = state.border[2] = state.border[3] = 1.0f;
|
||||
|
||||
if(!IsGLES)
|
||||
GL.glGetTextureParameterfvEXT(res.name, details.curType, eGL_TEXTURE_LOD_BIAS,
|
||||
&state.lodBias);
|
||||
@@ -1903,8 +1911,12 @@ void GLResourceManager::Apply_InitialState(GLResource live, GLInitialContents in
|
||||
(GLint *)&state.wrap[1]);
|
||||
GL.glTextureParameterivEXT(live.name, details.curType, eGL_TEXTURE_WRAP_T,
|
||||
(GLint *)&state.wrap[2]);
|
||||
GL.glTextureParameterfvEXT(live.name, details.curType, eGL_TEXTURE_BORDER_COLOR,
|
||||
state.border);
|
||||
|
||||
// see fetch in PrepareTextureInitialContents
|
||||
if(HasExt[ARB_texture_border_clamp])
|
||||
GL.glTextureParameterfvEXT(live.name, details.curType, eGL_TEXTURE_BORDER_COLOR,
|
||||
state.border);
|
||||
|
||||
if(!IsGLES)
|
||||
GL.glTextureParameterfvEXT(live.name, details.curType, eGL_TEXTURE_LOD_BIAS,
|
||||
&state.lodBias);
|
||||
|
||||
Reference in New Issue
Block a user