summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/blend.c10
-rw-r--r--src/mesa/main/buffers.c2
-rw-r--r--src/mesa/main/enable.c10
-rw-r--r--src/mesa/main/errors.c39
-rw-r--r--src/mesa/main/extensions.c71
-rw-r--r--src/mesa/main/extensions_table.h178
-rw-r--r--src/mesa/main/fog.c2
-rw-r--r--src/mesa/main/get_hash_params.py4
-rw-r--r--src/mesa/main/getstring.c17
-rw-r--r--src/mesa/main/mtypes.h2
-rw-r--r--src/mesa/main/objectlabel.c46
-rw-r--r--src/mesa/main/points.c2
-rw-r--r--src/mesa/main/shader_query.cpp23
-rw-r--r--src/mesa/main/tests/Makefile.am1
-rw-r--r--src/mesa/main/tests/dispatch_sanity.cpp8
-rw-r--r--src/mesa/main/tests/mesa_extensions.cpp51
-rw-r--r--src/mesa/main/texenv.c2
-rw-r--r--src/mesa/main/teximage.c43
18 files changed, 313 insertions, 198 deletions
diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index ddf7f497f1e..2ae22e9e691 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -67,7 +67,7 @@ legal_src_factor(const struct gl_context *ctx, GLenum factor)
case GL_SRC1_ALPHA:
case GL_ONE_MINUS_SRC1_COLOR:
case GL_ONE_MINUS_SRC1_ALPHA:
- return _mesa_is_desktop_gl(ctx)
+ return ctx->API != API_OPENGLES
&& ctx->Extensions.ARB_blend_func_extended;
default:
return GL_FALSE;
@@ -100,14 +100,14 @@ legal_dst_factor(const struct gl_context *ctx, GLenum factor)
case GL_ONE_MINUS_CONSTANT_ALPHA:
return _mesa_is_desktop_gl(ctx) || ctx->API == API_OPENGLES2;
case GL_SRC_ALPHA_SATURATE:
- return (_mesa_is_desktop_gl(ctx)
+ return (ctx->API != API_OPENGLES
&& ctx->Extensions.ARB_blend_func_extended)
|| _mesa_is_gles3(ctx);
case GL_SRC1_COLOR:
case GL_SRC1_ALPHA:
case GL_ONE_MINUS_SRC1_COLOR:
case GL_ONE_MINUS_SRC1_ALPHA:
- return _mesa_is_desktop_gl(ctx)
+ return ctx->API != API_OPENGLES
&& ctx->Extensions.ARB_blend_func_extended;
default:
return GL_FALSE;
@@ -404,7 +404,7 @@ _mesa_BlendEquation( GLenum mode )
ctx->Color._BlendEquationPerBuffer = GL_FALSE;
if (ctx->Driver.BlendEquationSeparate)
- (*ctx->Driver.BlendEquationSeparate)( ctx, mode, mode );
+ ctx->Driver.BlendEquationSeparate(ctx, mode, mode);
}
@@ -582,7 +582,7 @@ _mesa_BlendColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
ctx->Color.BlendColor[3] = CLAMP(tmp[3], 0.0F, 1.0F);
if (ctx->Driver.BlendColor)
- (*ctx->Driver.BlendColor)(ctx, ctx->Color.BlendColor);
+ ctx->Driver.BlendColor(ctx, ctx->Color.BlendColor);
}
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index 93588a2ee18..83e238ae825 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -731,7 +731,7 @@ _mesa_read_buffer(struct gl_context *ctx, struct gl_framebuffer *fb,
/* Call the device driver function only if fb is the bound read buffer */
if (fb == ctx->ReadBuffer) {
if (ctx->Driver.ReadBuffer)
- (*ctx->Driver.ReadBuffer)(ctx, buffer);
+ ctx->Driver.ReadBuffer(ctx, buffer);
}
}
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 42f67990784..a8a667e3c12 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -369,10 +369,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
break;
case GL_DEBUG_OUTPUT:
case GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB:
- if (!_mesa_is_desktop_gl(ctx))
- goto invalid_enum_error;
- else
- _mesa_set_debug_state_int(ctx, cap, state);
+ _mesa_set_debug_state_int(ctx, cap, state);
break;
case GL_DITHER:
if (ctx->Color.DitherFlag == state)
@@ -1225,10 +1222,7 @@ _mesa_IsEnabled( GLenum cap )
return ctx->Polygon.CullFlag;
case GL_DEBUG_OUTPUT:
case GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB:
- if (!_mesa_is_desktop_gl(ctx))
- goto invalid_enum_error;
- else
- return (GLboolean) _mesa_get_debug_state_int(ctx, cap);
+ return (GLboolean) _mesa_get_debug_state_int(ctx, cap);
case GL_DEPTH_TEST:
return ctx->Depth.Test;
case GL_DITHER:
diff --git a/src/mesa/main/errors.c b/src/mesa/main/errors.c
index f720de316e4..366b119aba3 100644
--- a/src/mesa/main/errors.c
+++ b/src/mesa/main/errors.c
@@ -978,9 +978,13 @@ _mesa_DebugMessageInsert(GLenum source, GLenum type, GLuint id,
GLenum severity, GLint length,
const GLchar *buf)
{
- const char *callerstr = "glDebugMessageInsert";
-
GET_CURRENT_CONTEXT(ctx);
+ const char *callerstr;
+
+ if (_mesa_is_desktop_gl(ctx))
+ callerstr = "glDebugMessageInsert";
+ else
+ callerstr = "glDebugMessageInsertKHR";
if (!validate_params(ctx, INSERT, callerstr, source, type, severity))
return; /* GL_INVALID_ENUM */
@@ -1004,15 +1008,21 @@ _mesa_GetDebugMessageLog(GLuint count, GLsizei logSize, GLenum *sources,
{
GET_CURRENT_CONTEXT(ctx);
struct gl_debug_state *debug;
+ const char *callerstr;
GLuint ret;
+ if (_mesa_is_desktop_gl(ctx))
+ callerstr = "glGetDebugMessageLog";
+ else
+ callerstr = "glGetDebugMessageLogKHR";
+
if (!messageLog)
logSize = 0;
if (logSize < 0) {
_mesa_error(ctx, GL_INVALID_VALUE,
- "glGetDebugMessageLog(logSize=%d : logSize must not be"
- " negative)", logSize);
+ "%s(logSize=%d : logSize must not be negative)",
+ callerstr, logSize);
return 0;
}
@@ -1066,9 +1076,14 @@ _mesa_DebugMessageControl(GLenum gl_source, GLenum gl_type,
enum mesa_debug_source source = gl_enum_to_debug_source(gl_source);
enum mesa_debug_type type = gl_enum_to_debug_type(gl_type);
enum mesa_debug_severity severity = gl_enum_to_debug_severity(gl_severity);
- const char *callerstr = "glDebugMessageControl";
+ const char *callerstr;
struct gl_debug_state *debug;
+ if (_mesa_is_desktop_gl(ctx))
+ callerstr = "glDebugMessageControl";
+ else
+ callerstr = "glDebugMessageControlKHR";
+
if (count < 0) {
_mesa_error(ctx, GL_INVALID_VALUE,
"%s(count=%d : count must not be negative)", callerstr,
@@ -1124,10 +1139,15 @@ _mesa_PushDebugGroup(GLenum source, GLuint id, GLsizei length,
const GLchar *message)
{
GET_CURRENT_CONTEXT(ctx);
- const char *callerstr = "glPushDebugGroup";
+ const char *callerstr;
struct gl_debug_state *debug;
struct gl_debug_message *emptySlot;
+ if (_mesa_is_desktop_gl(ctx))
+ callerstr = "glPushDebugGroup";
+ else
+ callerstr = "glPushDebugGroupKHR";
+
switch(source) {
case GL_DEBUG_SOURCE_APPLICATION:
case GL_DEBUG_SOURCE_THIRD_PARTY:
@@ -1176,10 +1196,15 @@ void GLAPIENTRY
_mesa_PopDebugGroup(void)
{
GET_CURRENT_CONTEXT(ctx);
- const char *callerstr = "glPopDebugGroup";
+ const char *callerstr;
struct gl_debug_state *debug;
struct gl_debug_message *gdmessage, msg;
+ if (_mesa_is_desktop_gl(ctx))
+ callerstr = "glPopDebugGroup";
+ else
+ callerstr = "glPopDebugGroupKHR";
+
debug = _mesa_lock_debug_state(ctx);
if (!debug)
return;
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index e94d2b74749..fa50cb68cca 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -40,7 +40,6 @@
struct gl_extensions _mesa_extension_override_enables;
struct gl_extensions _mesa_extension_override_disables;
static char *extra_extensions = NULL;
-static char *cant_disable_extensions = NULL;
/**
@@ -68,29 +67,30 @@ const struct mesa_extension _mesa_extension_table[] = {
#undef EXT
};
+static bool disabled_extensions[ARRAY_SIZE(_mesa_extension_table)];
/**
* Given an extension name, lookup up the corresponding member of struct
- * gl_extensions and return that member's offset (in bytes). If the name is
- * not found in the \c _mesa_extension_table, return 0.
+ * gl_extensions and return that member's index. If the name is
+ * not found in the \c _mesa_extension_table, return -1.
*
* \param name Name of extension.
- * \return Offset of member in struct gl_extensions.
+ * \return Index of member in struct gl_extensions.
*/
-static size_t
-name_to_offset(const char* name)
+static int
+name_to_index(const char* name)
{
unsigned i;
if (name == 0)
- return 0;
+ return -1;
for (i = 0; i < ARRAY_SIZE(_mesa_extension_table); ++i) {
if (strcmp(name, _mesa_extension_table[i].name) == 0)
- return _mesa_extension_table[i].offset;
+ return i;
}
- return 0;
+ return -1;
}
/**
@@ -206,11 +206,11 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
* \return offset of extensions withint `ext' or 0 if extension is not known
*/
static size_t
-set_extension(struct gl_extensions *ext, const char *name, GLboolean state)
+set_extension(struct gl_extensions *ext, int i, GLboolean state)
{
size_t offset;
- offset = name_to_offset(name);
+ offset = i < 0 ? 0 : _mesa_extension_table[i].offset;
if (offset != 0 && (offset != o(dummy_true) || state != GL_FALSE)) {
((GLboolean *) ext)[offset] = state;
}
@@ -240,12 +240,6 @@ get_extension_override( struct gl_context *ctx )
{
override_extensions_in_context(ctx);
- if (cant_disable_extensions != NULL) {
- _mesa_problem(ctx,
- "Trying to disable permanently enabled extensions: %s",
- cant_disable_extensions);
- }
-
if (extra_extensions == NULL) {
return calloc(1, sizeof(char));
} else {
@@ -257,7 +251,7 @@ get_extension_override( struct gl_context *ctx )
/**
- * \brief Free extra_extensions and cant_disable_extensions strings
+ * \brief Free extra_extensions string
*
* These strings are allocated early during the first context creation by
* _mesa_one_time_init_extension_overrides.
@@ -266,7 +260,6 @@ static void
free_unknown_extensions_strings(void)
{
free(extra_extensions);
- free(cant_disable_extensions);
}
@@ -295,21 +288,20 @@ _mesa_one_time_init_extension_overrides(void)
/* extra_exts: List of unrecognized extensions. */
extra_extensions = calloc(ALIGN(strlen(env_const) + 2, 4), sizeof(char));
- cant_disable_extensions = calloc(ALIGN(strlen(env_const) + 2, 4), sizeof(char));
/* Copy env_const because strtok() is destructive. */
env = strdup(env_const);
- if (env == NULL || extra_extensions == NULL ||
- cant_disable_extensions == NULL) {
- free(env);
- free(extra_extensions);
- free(cant_disable_extensions);
- return;
+ if (env == NULL ||
+ extra_extensions == NULL) {
+ free(env);
+ free(extra_extensions);
+ return;
}
for (ext = strtok(env, " "); ext != NULL; ext = strtok(NULL, " ")) {
int enable;
+ int i;
bool recognized;
switch (ext[0]) {
case '+':
@@ -325,7 +317,8 @@ _mesa_one_time_init_extension_overrides(void)
break;
}
- offset = set_extension(&_mesa_extension_override_enables, ext, enable);
+ i = name_to_index(ext);
+ offset = set_extension(&_mesa_extension_override_enables, i, enable);
if (offset != 0 && (offset != o(dummy_true) || enable != GL_FALSE)) {
((GLboolean *) &_mesa_extension_override_disables)[offset] = !enable;
recognized = true;
@@ -333,14 +326,12 @@ _mesa_one_time_init_extension_overrides(void)
recognized = false;
}
- if (!recognized) {
- if (enable) {
- strcat(extra_extensions, ext);
- strcat(extra_extensions, " ");
- } else if (offset == o(dummy_true)) {
- strcat(cant_disable_extensions, ext);
- strcat(cant_disable_extensions, " ");
- }
+ if (i >= 0)
+ disabled_extensions[i] = !enable;
+
+ if (!recognized && enable) {
+ strcat(extra_extensions, ext);
+ strcat(extra_extensions, " ");
}
}
@@ -354,13 +345,6 @@ _mesa_one_time_init_extension_overrides(void)
} else if (extra_extensions[len - 1] == ' ') {
extra_extensions[len - 1] = '\0';
}
- len = strlen(cant_disable_extensions);
- if (len == 0) {
- free(cant_disable_extensions);
- cant_disable_extensions = NULL;
- } else if (cant_disable_extensions[len - 1] == ' ') {
- cant_disable_extensions[len - 1] = '\0';
- }
}
@@ -401,7 +385,8 @@ _mesa_extension_supported(const struct gl_context *ctx, extension_index i)
const bool *base = (bool *) &ctx->Extensions;
const struct mesa_extension *ext = _mesa_extension_table + i;
- return (ctx->Version >= ext->version[ctx->API]) && base[ext->offset];
+ return !disabled_extensions[i] &&
+ (ctx->Version >= ext->version[ctx->API]) && base[ext->offset];
}
/**
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index d12fd9f1c8d..051d69a3613 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -1,8 +1,31 @@
+/* The extension table is alphabetically sorted by the extension name string column. */
+
#define GLL 0
#define GLC 0
#define ES1 0
#define ES2 0
#define x ~0
+
+EXT(3DFX_texture_compression_FXT1 , TDFX_texture_compression_FXT1 , GLL, GLC, x , x , 1999)
+
+EXT(AMD_conservative_depth , ARB_conservative_depth , GLL, GLC, x , x , 2009)
+EXT(AMD_draw_buffers_blend , ARB_draw_buffers_blend , GLL, GLC, x , x , 2009)
+EXT(AMD_performance_monitor , AMD_performance_monitor , GLL, GLC, x , x , 2007)
+EXT(AMD_pinned_memory , AMD_pinned_memory , GLL, GLC, x , x , 2013)
+EXT(AMD_seamless_cubemap_per_texture , AMD_seamless_cubemap_per_texture , GLL, GLC, x , x , 2009)
+EXT(AMD_shader_stencil_export , ARB_shader_stencil_export , GLL, GLC, x , x , 2009)
+EXT(AMD_shader_trinary_minmax , dummy_true , GLL, GLC, x , x , 2012)
+EXT(AMD_vertex_shader_layer , AMD_vertex_shader_layer , x , GLC, x , x , 2012)
+EXT(AMD_vertex_shader_viewport_index , AMD_vertex_shader_viewport_index , x , GLC, x , x , 2012)
+
+EXT(ANGLE_texture_compression_dxt3 , ANGLE_texture_compression_dxt , GLL, GLC, ES1, ES2, 2011)
+EXT(ANGLE_texture_compression_dxt5 , ANGLE_texture_compression_dxt , GLL, GLC, ES1, ES2, 2011)
+
+EXT(APPLE_object_purgeable , APPLE_object_purgeable , GLL, GLC, x , x , 2006)
+EXT(APPLE_packed_pixels , dummy_true , GLL, x , x , x , 2002)
+EXT(APPLE_texture_max_level , dummy_true , x , x , ES1, ES2, 2009)
+EXT(APPLE_vertex_array_object , dummy_true , GLL, x , x , x , 2002)
+
EXT(ARB_ES2_compatibility , ARB_ES2_compatibility , GLL, GLC, x , x , 2009)
EXT(ARB_ES3_compatibility , ARB_ES3_compatibility , GLL, GLC, x , x , 2012)
EXT(ARB_arrays_of_arrays , ARB_arrays_of_arrays , GLL, GLC, x , x , 2012)
@@ -16,9 +39,9 @@ EXT(ARB_color_buffer_float , ARB_color_buffer_float
EXT(ARB_compressed_texture_pixel_storage , dummy_true , GLL, GLC, x , x , 2011)
EXT(ARB_compute_shader , ARB_compute_shader , GLL, GLC, x , x , 2012)
EXT(ARB_conditional_render_inverted , ARB_conditional_render_inverted , GLL, GLC, x , x , 2014)
+EXT(ARB_conservative_depth , ARB_conservative_depth , GLL, GLC, x , x , 2011)
EXT(ARB_copy_buffer , dummy_true , GLL, GLC, x , x , 2008)
EXT(ARB_copy_image , ARB_copy_image , GLL, GLC, x , x , 2012)
-EXT(ARB_conservative_depth , ARB_conservative_depth , GLL, GLC, x , x , 2011)
EXT(ARB_debug_output , dummy_true , GLL, GLC, x , x , 2009)
EXT(ARB_depth_buffer_float , ARB_depth_buffer_float , GLL, GLC, x , x , 2008)
EXT(ARB_depth_clamp , ARB_depth_clamp , GLL, GLC, x , x , 2003)
@@ -56,8 +79,8 @@ EXT(ARB_multi_bind , dummy_true
EXT(ARB_multi_draw_indirect , ARB_draw_indirect , x , GLC, x , x , 2012)
EXT(ARB_multisample , dummy_true , GLL, x , x , x , 1994)
EXT(ARB_multitexture , dummy_true , GLL, x , x , x , 1998)
-EXT(ARB_occlusion_query2 , ARB_occlusion_query2 , GLL, GLC, x , x , 2003)
EXT(ARB_occlusion_query , ARB_occlusion_query , GLL, x , x , x , 2001)
+EXT(ARB_occlusion_query2 , ARB_occlusion_query2 , GLL, GLC, x , x , 2003)
EXT(ARB_pipeline_statistics_query , ARB_pipeline_statistics_query , GLL, GLC, x , x , 2014)
EXT(ARB_pixel_buffer_object , EXT_pixel_buffer_object , GLL, GLC, x , x , 2004)
EXT(ARB_point_parameters , EXT_point_parameters , GLL, x , x , x , 1997)
@@ -83,13 +106,13 @@ EXT(ARB_shader_subroutine , ARB_shader_subroutine
EXT(ARB_shader_texture_image_samples , ARB_shader_texture_image_samples , GLL, GLC, x , x , 2014)
EXT(ARB_shader_texture_lod , ARB_shader_texture_lod , GLL, GLC, x , x , 2009)
EXT(ARB_shading_language_100 , dummy_true , GLL, x , x , x , 2003)
-EXT(ARB_shading_language_packing , ARB_shading_language_packing , GLL, GLC, x , x , 2011)
EXT(ARB_shading_language_420pack , ARB_shading_language_420pack , GLL, GLC, x , x , 2011)
+EXT(ARB_shading_language_packing , ARB_shading_language_packing , GLL, GLC, x , x , 2011)
EXT(ARB_shadow , ARB_shadow , GLL, x , x , x , 2001)
EXT(ARB_stencil_texturing , ARB_stencil_texturing , GLL, GLC, x , x , 2012)
EXT(ARB_sync , ARB_sync , GLL, GLC, x , x , 2003)
-EXT(ARB_texture_barrier , NV_texture_barrier , GLL, GLC, x , x , 2014)
EXT(ARB_tessellation_shader , ARB_tessellation_shader , x , GLC, x , x , 2009)
+EXT(ARB_texture_barrier , NV_texture_barrier , GLL, GLC, x , x , 2014)
EXT(ARB_texture_border_clamp , ARB_texture_border_clamp , GLL, x , x , x , 2000)
EXT(ARB_texture_buffer_object , ARB_texture_buffer_object , x , GLC, x , x , 2008)
EXT(ARB_texture_buffer_object_rgb32 , ARB_texture_buffer_object_rgb32 , x , GLC, x , x , 2009)
@@ -105,20 +128,20 @@ EXT(ARB_texture_env_crossbar , ARB_texture_env_crossbar
EXT(ARB_texture_env_dot3 , ARB_texture_env_dot3 , GLL, x , x , x , 2001)
EXT(ARB_texture_float , ARB_texture_float , GLL, GLC, x , x , 2004)
EXT(ARB_texture_gather , ARB_texture_gather , GLL, GLC, x , x , 2009)
-EXT(ARB_texture_mirrored_repeat , dummy_true , GLL, x , x , x , 2001)
EXT(ARB_texture_mirror_clamp_to_edge , ARB_texture_mirror_clamp_to_edge , GLL, GLC, x , x , 2013)
+EXT(ARB_texture_mirrored_repeat , dummy_true , GLL, x , x , x , 2001)
EXT(ARB_texture_multisample , ARB_texture_multisample , GLL, GLC, x , x , 2009)
EXT(ARB_texture_non_power_of_two , ARB_texture_non_power_of_two , GLL, GLC, x , x , 2003)
EXT(ARB_texture_query_levels , ARB_texture_query_levels , GLL, GLC, x , x , 2012)
EXT(ARB_texture_query_lod , ARB_texture_query_lod , GLL, GLC, x , x , 2009)
EXT(ARB_texture_rectangle , NV_texture_rectangle , GLL, GLC, x , x , 2004)
-EXT(ARB_texture_rgb10_a2ui , ARB_texture_rgb10_a2ui , GLL, GLC, x , x , 2009)
EXT(ARB_texture_rg , ARB_texture_rg , GLL, GLC, x , x , 2008)
+EXT(ARB_texture_rgb10_a2ui , ARB_texture_rgb10_a2ui , GLL, GLC, x , x , 2009)
EXT(ARB_texture_stencil8 , ARB_texture_stencil8 , GLL, GLC, x , x , 2013)
EXT(ARB_texture_storage , dummy_true , GLL, GLC, x , x , 2011)
EXT(ARB_texture_storage_multisample , ARB_texture_multisample , GLL, GLC, x , x , 2012)
-EXT(ARB_texture_view , ARB_texture_view , GLL, GLC, x , x , 2012)
EXT(ARB_texture_swizzle , EXT_texture_swizzle , GLL, GLC, x , x , 2008)
+EXT(ARB_texture_view , ARB_texture_view , GLL, GLC, x , x , 2012)
EXT(ARB_timer_query , ARB_timer_query , GLL, GLC, x , x , 2010)
EXT(ARB_transform_feedback2 , ARB_transform_feedback2 , GLL, GLC, x , x , 2010)
EXT(ARB_transform_feedback3 , ARB_transform_feedback3 , GLL, GLC, x , x , 2010)
@@ -127,28 +150,39 @@ EXT(ARB_transpose_matrix , dummy_true
EXT(ARB_uniform_buffer_object , ARB_uniform_buffer_object , GLL, GLC, x , x , 2009)
EXT(ARB_vertex_array_bgra , EXT_vertex_array_bgra , GLL, GLC, x , x , 2008)
EXT(ARB_vertex_array_object , dummy_true , GLL, GLC, x , x , 2006)
+EXT(ARB_vertex_attrib_64bit , ARB_vertex_attrib_64bit , x , GLC, x , x , 2010)
EXT(ARB_vertex_attrib_binding , dummy_true , GLL, GLC, x , x , 2012)
EXT(ARB_vertex_buffer_object , dummy_true , GLL, x , x , x , 2003)
EXT(ARB_vertex_program , ARB_vertex_program , GLL, x , x , x , 2002)
EXT(ARB_vertex_shader , ARB_vertex_shader , GLL, GLC, x , x , 2002)
-EXT(ARB_vertex_attrib_64bit , ARB_vertex_attrib_64bit , x , GLC, x , x , 2010)
EXT(ARB_vertex_type_10f_11f_11f_rev , ARB_vertex_type_10f_11f_11f_rev , GLL, GLC, x , x , 2013)
EXT(ARB_vertex_type_2_10_10_10_rev , ARB_vertex_type_2_10_10_10_rev , GLL, GLC, x , x , 2009)
EXT(ARB_viewport_array , ARB_viewport_array , x , GLC, x , x , 2010)
EXT(ARB_window_pos , dummy_true , GLL, x , x , x , 2001)
+EXT(ATI_blend_equation_separate , EXT_blend_equation_separate , GLL, GLC, x , x , 2003)
+EXT(ATI_draw_buffers , dummy_true , GLL, x , x , x , 2002)
+EXT(ATI_fragment_shader , ATI_fragment_shader , GLL, x , x , x , 2001)
+EXT(ATI_separate_stencil , ATI_separate_stencil , GLL, x , x , x , 2006)
+EXT(ATI_texture_compression_3dc , ATI_texture_compression_3dc , GLL, x , x , x , 2004)
+EXT(ATI_texture_env_combine3 , ATI_texture_env_combine3 , GLL, x , x , x , 2002)
+EXT(ATI_texture_float , ARB_texture_float , GLL, GLC, x , x , 2002)
+EXT(ATI_texture_mirror_once , ATI_texture_mirror_once , GLL, GLC, x , x , 2006)
+
EXT(EXT_abgr , dummy_true , GLL, GLC, x , x , 1995)
EXT(EXT_bgra , dummy_true , GLL, x , x , x , 1995)
EXT(EXT_blend_color , EXT_blend_color , GLL, x , x , x , 1995)
EXT(EXT_blend_equation_separate , EXT_blend_equation_separate , GLL, GLC, x , x , 2003)
+EXT(EXT_blend_func_extended , ARB_blend_func_extended , x , x , x , ES2, 2015)
EXT(EXT_blend_func_separate , EXT_blend_func_separate , GLL, x , x , x , 1999)
-EXT(EXT_buffer_storage , ARB_buffer_storage , x , x , x , 31, 2015)
-EXT(EXT_discard_framebuffer , dummy_true , x , x , ES1, ES2, 2009)
EXT(EXT_blend_minmax , EXT_blend_minmax , GLL, x , ES1, ES2, 1995)
EXT(EXT_blend_subtract , dummy_true , GLL, x , x , x , 1995)
+EXT(EXT_buffer_storage , ARB_buffer_storage , x , x , x , 31, 2015)
+EXT(EXT_color_buffer_float , dummy_true , x , x , ES1, 30, 2013)
EXT(EXT_compiled_vertex_array , dummy_true , GLL, x , x , x , 1996)
EXT(EXT_copy_texture , dummy_true , GLL, x , x , x , 1995)
EXT(EXT_depth_bounds_test , EXT_depth_bounds_test , GLL, GLC, x , x , 2002)
+EXT(EXT_discard_framebuffer , dummy_true , x , x , ES1, ES2, 2009)
EXT(EXT_draw_buffers , dummy_true , x , x , x , ES2, 2012)
EXT(EXT_draw_buffers2 , EXT_draw_buffers2 , GLL, GLC, x , x , 2006)
EXT(EXT_draw_elements_base_vertex , ARB_draw_elements_base_vertex , x , x , x , ES2, 2014)
@@ -172,20 +206,21 @@ EXT(EXT_point_parameters , EXT_point_parameters
EXT(EXT_polygon_offset , dummy_true , GLL, x , x , x , 1995)
EXT(EXT_polygon_offset_clamp , EXT_polygon_offset_clamp , GLL, GLC, x , x , 2014)
EXT(EXT_provoking_vertex , EXT_provoking_vertex , GLL, GLC, x , x , 2009)
+EXT(EXT_read_format_bgra , dummy_true , x , x , ES1, ES2, 2009)
EXT(EXT_rescale_normal , dummy_true , GLL, x , x , x , 1997)
EXT(EXT_secondary_color , dummy_true , GLL, x , x , x , 1999)
EXT(EXT_separate_shader_objects , dummy_true , x , x , x , ES2, 2013)
EXT(EXT_separate_specular_color , dummy_true , GLL, x , x , x , 1997)
-EXT(EXT_shader_integer_mix , EXT_shader_integer_mix , GLL, GLC, ES1, 30, 2013)
+EXT(EXT_shader_integer_mix , EXT_shader_integer_mix , GLL, GLC, x , 30, 2013)
+EXT(EXT_shader_samples_identical , EXT_shader_samples_identical , GLL, GLC, x , 31, 2015)
EXT(EXT_shadow_funcs , ARB_shadow , GLL, x , x , x , 2002)
EXT(EXT_stencil_two_side , EXT_stencil_two_side , GLL, x , x , x , 2001)
EXT(EXT_stencil_wrap , dummy_true , GLL, x , x , x , 2002)
EXT(EXT_subtexture , dummy_true , GLL, x , x , x , 1995)
+EXT(EXT_texture , dummy_true , GLL, x , x , x , 1996)
EXT(EXT_texture3D , dummy_true , GLL, x , x , x , 1996)
EXT(EXT_texture_array , EXT_texture_array , GLL, GLC, x , x , 2006)
EXT(EXT_texture_compression_dxt1 , ANGLE_texture_compression_dxt , GLL, GLC, ES1, ES2, 2004)
-EXT(ANGLE_texture_compression_dxt3 , ANGLE_texture_compression_dxt , GLL, GLC, ES1, ES2, 2011)
-EXT(ANGLE_texture_compression_dxt5 , ANGLE_texture_compression_dxt , GLL, GLC, ES1, ES2, 2011)
EXT(EXT_texture_compression_latc , EXT_texture_compression_latc , GLL, x , x , x , 2006)
EXT(EXT_texture_compression_rgtc , ARB_texture_compression_rgtc , GLL, GLC, x , x , 2004)
EXT(EXT_texture_compression_s3tc , EXT_texture_compression_s3tc , GLL, GLC, x , x , 2000)
@@ -196,28 +231,66 @@ EXT(EXT_texture_env_combine , dummy_true
EXT(EXT_texture_env_dot3 , EXT_texture_env_dot3 , GLL, x , x , x , 2000)
EXT(EXT_texture_filter_anisotropic , EXT_texture_filter_anisotropic , GLL, GLC, ES1, ES2, 1999)
EXT(EXT_texture_format_BGRA8888 , dummy_true , x , x , ES1, ES2, 2005)
-EXT(EXT_texture_rg , ARB_texture_rg , x , x , x , ES2, 2011)
-EXT(EXT_read_format_bgra , dummy_true , x , x , ES1, ES2, 2009)
EXT(EXT_texture_integer , EXT_texture_integer , GLL, GLC, x , x , 2006)
EXT(EXT_texture_lod_bias , dummy_true , GLL, x , ES1, x , 1999)
EXT(EXT_texture_mirror_clamp , EXT_texture_mirror_clamp , GLL, GLC, x , x , 2004)
EXT(EXT_texture_object , dummy_true , GLL, x , x , x , 1995)
-EXT(EXT_texture , dummy_true , GLL, x , x , x , 1996)
EXT(EXT_texture_rectangle , NV_texture_rectangle , GLL, x , x , x , 2004)
-EXT(EXT_texture_shared_exponent , EXT_texture_shared_exponent , GLL, GLC, x , x , 2004)
-EXT(EXT_texture_snorm , EXT_texture_snorm , GLL, GLC, x , x , 2009)
+EXT(EXT_texture_rg , ARB_texture_rg , x , x , x , ES2, 2011)
EXT(EXT_texture_sRGB , EXT_texture_sRGB , GLL, GLC, x , x , 2004)
EXT(EXT_texture_sRGB_decode , EXT_texture_sRGB_decode , GLL, GLC, x , x , 2006)
+EXT(EXT_texture_shared_exponent , EXT_texture_shared_exponent , GLL, GLC, x , x , 2004)
+EXT(EXT_texture_snorm , EXT_texture_snorm , GLL, GLC, x , x , 2009)
EXT(EXT_texture_swizzle , EXT_texture_swizzle , GLL, GLC, x , x , 2008)
EXT(EXT_texture_type_2_10_10_10_REV , dummy_true , x , x , x , ES2, 2008)
EXT(EXT_timer_query , EXT_timer_query , GLL, GLC, x , x , 2006)
EXT(EXT_transform_feedback , EXT_transform_feedback , GLL, GLC, x , x , 2011)
EXT(EXT_unpack_subimage , dummy_true , x , x , x , ES2, 2011)
-EXT(EXT_vertex_array_bgra , EXT_vertex_array_bgra , GLL, GLC, x , x , 2008)
EXT(EXT_vertex_array , dummy_true , GLL, x , x , x , 1995)
-EXT(EXT_color_buffer_float , dummy_true , x , x , ES1, 30, 2013)
+EXT(EXT_vertex_array_bgra , EXT_vertex_array_bgra , GLL, GLC, x , x , 2008)
+EXT(IBM_multimode_draw_arrays , dummy_true , GLL, GLC, x , x , 1998)
+EXT(IBM_rasterpos_clip , dummy_true , GLL, x , x , x , 1996)
+EXT(IBM_texture_mirrored_repeat , dummy_true , GLL, x , x , x , 1998)
+EXT(INGR_blend_func_separate , EXT_blend_func_separate , GLL, x , x , x , 1999)
+
+EXT(INTEL_performance_query , INTEL_performance_query , GLL, GLC, x , ES2, 2013)
+
+EXT(KHR_context_flush_control , dummy_true , GLL, GLC, x , ES2, 2014)
+EXT(KHR_debug , dummy_true , GLL, GLC, ES1, ES2, 2012)
+EXT(KHR_texture_compression_astc_hdr , KHR_texture_compression_astc_hdr , GLL, GLC, x , ES2, 2012)
+EXT(KHR_texture_compression_astc_ldr , KHR_texture_compression_astc_ldr , GLL, GLC, x , ES2, 2012)
+
+EXT(MESA_pack_invert , MESA_pack_invert , GLL, GLC, x , x , 2002)
+EXT(MESA_texture_signed_rgba , EXT_texture_snorm , GLL, GLC, x , x , 2009)
+EXT(MESA_window_pos , dummy_true , GLL, x , x , x , 2000)
+EXT(MESA_ycbcr_texture , MESA_ycbcr_texture , GLL, GLC, x , x , 2002)
+
+EXT(NV_blend_square , dummy_true , GLL, x , x , x , 1999)
+EXT(NV_conditional_render , NV_conditional_render , GLL, GLC, x , x , 2008)
+EXT(NV_depth_clamp , ARB_depth_clamp , GLL, GLC, x , x , 2001)
+EXT(NV_draw_buffers , dummy_true , x , x , x , ES2, 2011)
+EXT(NV_fbo_color_attachments , dummy_true , x , x , x , ES2, 2010)
+EXT(NV_fog_distance , NV_fog_distance , GLL, x , x , x , 2001)
+EXT(NV_fragment_program_option , NV_fragment_program_option , GLL, x , x , x , 2005)
+EXT(NV_light_max_exponent , dummy_true , GLL, x , x , x , 1999)
+EXT(NV_packed_depth_stencil , dummy_true , GLL, GLC, x , x , 2000)
+EXT(NV_point_sprite , NV_point_sprite , GLL, GLC, x , x , 2001)
+EXT(NV_primitive_restart , NV_primitive_restart , GLL, x , x , x , 2002)
+EXT(NV_read_buffer , dummy_true , x , x , x , ES2, 2011)
+EXT(NV_read_depth , dummy_true , x , x , x , ES2, 2011)
+EXT(NV_read_depth_stencil , dummy_true , x , x , x , ES2, 2011)
+EXT(NV_read_stencil , dummy_true , x , x , x , ES2, 2011)
+EXT(NV_texgen_reflection , dummy_true , GLL, x , x , x , 1999)
+EXT(NV_texture_barrier , NV_texture_barrier , GLL, GLC, x , x , 2009)
+EXT(NV_texture_env_combine4 , NV_texture_env_combine4 , GLL, x , x , x , 1999)
+EXT(NV_texture_rectangle , NV_texture_rectangle , GLL, x , x , x , 2000)
+EXT(NV_vdpau_interop , NV_vdpau_interop , GLL, GLC, x , x , 2010)
+
+EXT(OES_EGL_image , OES_EGL_image , GLL, GLC, ES1, ES2, 2006) /* FIXME: Mesa expects GL_OES_EGL_image to be available in OpenGL contexts. */
+EXT(OES_EGL_image_external , OES_EGL_image_external , x , x , ES1, ES2, 2010)
+EXT(OES_EGL_sync , dummy_true , x , x , ES1, ES2, 2010)
EXT(OES_blend_equation_separate , EXT_blend_equation_separate , x , x , ES1, x , 2009)
EXT(OES_blend_func_separate , EXT_blend_func_separate , x , x , ES1, x , 2009)
EXT(OES_blend_subtract , dummy_true , x , x , ES1, x , 2009)
@@ -230,9 +303,6 @@ EXT(OES_depth_texture , ARB_depth_texture
EXT(OES_depth_texture_cube_map , OES_depth_texture_cube_map , x , x , x , ES2, 2012)
EXT(OES_draw_elements_base_vertex , ARB_draw_elements_base_vertex , x , x , x , ES2, 2014)
EXT(OES_draw_texture , OES_draw_texture , x , x , ES1, x , 2004)
-EXT(OES_EGL_sync , dummy_true , x , x , ES1, ES2, 2010)
-EXT(OES_EGL_image , OES_EGL_image , GLL, GLC, ES1, ES2, 2006) /* FIXME: Mesa expects GL_OES_EGL_image to be available in OpenGL contexts. */
-EXT(OES_EGL_image_external , OES_EGL_image_external , x , x , ES1, ES2, 2010)
EXT(OES_element_index_uint , dummy_true , x , x , ES1, ES2, 2005)
EXT(OES_fbo_render_mipmap , dummy_true , x , x , ES1, ES2, 2005)
EXT(OES_fixed_point , dummy_true , x , x , ES1, x , 2002)
@@ -260,73 +330,17 @@ EXT(OES_texture_float_linear , OES_texture_float_linear
EXT(OES_texture_half_float , OES_texture_half_float , x , x , x , ES2, 2005)
EXT(OES_texture_half_float_linear , OES_texture_half_float_linear , x , x , x , ES2, 2005)
EXT(OES_texture_mirrored_repeat , dummy_true , x , x , ES1, x , 2005)
-EXT(OES_texture_storage_multisample_2d_array, ARB_texture_multisample , x , x , ES1, 31, 2014)
EXT(OES_texture_npot , ARB_texture_non_power_of_two , x , x , ES1, ES2, 2005)
+EXT(OES_texture_storage_multisample_2d_array, ARB_texture_multisample , x , x , ES1, 31, 2014)
EXT(OES_vertex_array_object , dummy_true , x , x , ES1, ES2, 2010)
-
-EXT(KHR_debug , dummy_true , GLL, GLC, x , x , 2012)
-EXT(KHR_context_flush_control , dummy_true , GLL, GLC, x , ES2, 2014)
-EXT(KHR_texture_compression_astc_hdr , KHR_texture_compression_astc_hdr , GLL, GLC, x , ES2, 2012)
-EXT(KHR_texture_compression_astc_ldr , KHR_texture_compression_astc_ldr , GLL, GLC, x , ES2, 2012)
-
-
-EXT(3DFX_texture_compression_FXT1 , TDFX_texture_compression_FXT1 , GLL, GLC, x , x , 1999)
-EXT(AMD_conservative_depth , ARB_conservative_depth , GLL, GLC, x , x , 2009)
-EXT(AMD_draw_buffers_blend , ARB_draw_buffers_blend , GLL, GLC, x , x , 2009)
-EXT(AMD_performance_monitor , AMD_performance_monitor , GLL, GLC, x , x , 2007)
-EXT(AMD_pinned_memory , AMD_pinned_memory , GLL, GLC, x , x , 2013)
-EXT(AMD_seamless_cubemap_per_texture , AMD_seamless_cubemap_per_texture , GLL, GLC, x , x , 2009)
-EXT(AMD_shader_stencil_export , ARB_shader_stencil_export , GLL, GLC, x , x , 2009)
-EXT(AMD_shader_trinary_minmax , dummy_true , GLL, GLC, x , x , 2012)
-EXT(AMD_vertex_shader_layer , AMD_vertex_shader_layer , x , GLC, x , x , 2012)
-EXT(AMD_vertex_shader_viewport_index , AMD_vertex_shader_viewport_index , x , GLC, x , x , 2012)
-EXT(APPLE_object_purgeable , APPLE_object_purgeable , GLL, GLC, x , x , 2006)
-EXT(APPLE_packed_pixels , dummy_true , GLL, x , x , x , 2002)
-EXT(APPLE_texture_max_level , dummy_true , x , x , ES1, ES2, 2009)
-EXT(APPLE_vertex_array_object , dummy_true , GLL, x , x , x , 2002)
-EXT(ATI_blend_equation_separate , EXT_blend_equation_separate , GLL, GLC, x , x , 2003)
-EXT(ATI_draw_buffers , dummy_true , GLL, x , x , x , 2002)
-EXT(ATI_fragment_shader , ATI_fragment_shader , GLL, x , x , x , 2001)
-EXT(ATI_separate_stencil , ATI_separate_stencil , GLL, x , x , x , 2006)
-EXT(ATI_texture_compression_3dc , ATI_texture_compression_3dc , GLL, x , x , x , 2004)
-EXT(ATI_texture_env_combine3 , ATI_texture_env_combine3 , GLL, x , x , x , 2002)
-EXT(ATI_texture_float , ARB_texture_float , GLL, GLC, x , x , 2002)
-EXT(ATI_texture_mirror_once , ATI_texture_mirror_once , GLL, GLC, x , x , 2006)
-EXT(IBM_multimode_draw_arrays , dummy_true , GLL, GLC, x , x , 1998)
-EXT(IBM_rasterpos_clip , dummy_true , GLL, x , x , x , 1996)
-EXT(IBM_texture_mirrored_repeat , dummy_true , GLL, x , x , x , 1998)
-EXT(INGR_blend_func_separate , EXT_blend_func_separate , GLL, x , x , x , 1999)
-EXT(INTEL_performance_query , INTEL_performance_query , GLL, GLC, x , ES2, 2013)
-EXT(MESA_pack_invert , MESA_pack_invert , GLL, GLC, x , x , 2002)
-EXT(MESA_texture_signed_rgba , EXT_texture_snorm , GLL, GLC, x , x , 2009)
-EXT(MESA_window_pos , dummy_true , GLL, x , x , x , 2000)
-EXT(MESA_ycbcr_texture , MESA_ycbcr_texture , GLL, GLC, x , x , 2002)
-EXT(NV_blend_square , dummy_true , GLL, x , x , x , 1999)
-EXT(NV_conditional_render , NV_conditional_render , GLL, GLC, x , x , 2008)
-EXT(NV_depth_clamp , ARB_depth_clamp , GLL, GLC, x , x , 2001)
-EXT(NV_draw_buffers , dummy_true , x , x , x , ES2, 2011)
-EXT(NV_fbo_color_attachments , dummy_true , x , x , x , ES2, 2010)
-EXT(NV_fog_distance , NV_fog_distance , GLL, x , x , x , 2001)
-EXT(NV_fragment_program_option , NV_fragment_program_option , GLL, x , x , x , 2005)
-EXT(NV_light_max_exponent , dummy_true , GLL, x , x , x , 1999)
-EXT(NV_packed_depth_stencil , dummy_true , GLL, GLC, x , x , 2000)
-EXT(NV_point_sprite , NV_point_sprite , GLL, GLC, x , x , 2001)
-EXT(NV_primitive_restart , NV_primitive_restart , GLL, x , x , x , 2002)
-EXT(NV_read_buffer , dummy_true , x , x , x , ES2, 2011)
-EXT(NV_read_depth , dummy_true , x , x , x , ES2, 2011)
-EXT(NV_read_depth_stencil , dummy_true , x , x , x , ES2, 2011)
-EXT(NV_read_stencil , dummy_true , x , x , x , ES2, 2011)
-EXT(NV_texgen_reflection , dummy_true , GLL, x , x , x , 1999)
-EXT(NV_texture_barrier , NV_texture_barrier , GLL, GLC, x , x , 2009)
-EXT(NV_texture_env_combine4 , NV_texture_env_combine4 , GLL, x , x , x , 1999)
-EXT(NV_texture_rectangle , NV_texture_rectangle , GLL, x , x , x , 2000)
-EXT(NV_vdpau_interop , NV_vdpau_interop , GLL, GLC, x , x , 2010)
EXT(S3_s3tc , ANGLE_texture_compression_dxt , GLL, GLC, x , x , 1999)
+
EXT(SGIS_generate_mipmap , dummy_true , GLL, x , x , x , 1997)
EXT(SGIS_texture_border_clamp , ARB_texture_border_clamp , GLL, x , x , x , 1997)
EXT(SGIS_texture_edge_clamp , dummy_true , GLL, x , x , x , 1997)
EXT(SGIS_texture_lod , dummy_true , GLL, x , x , x , 1997)
+
EXT(SUN_multi_draw_arrays , dummy_true , GLL, x , x , x , 1999)
#undef GLL
#undef GLC
diff --git a/src/mesa/main/fog.c b/src/mesa/main/fog.c
index 45f343d61c8..1ad939cfde6 100644
--- a/src/mesa/main/fog.c
+++ b/src/mesa/main/fog.c
@@ -190,7 +190,7 @@ _mesa_Fogfv( GLenum pname, const GLfloat *params )
}
if (ctx->Driver.Fogfv) {
- (*ctx->Driver.Fogfv)( ctx, pname, params );
+ ctx->Driver.Fogfv( ctx, pname, params );
}
return;
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index fbc7b8f8602..9b22b91ac1b 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -330,6 +330,9 @@ descriptor=[
# GL_KHR_context_flush_control
[ "CONTEXT_RELEASE_BEHAVIOR", "CONTEXT_ENUM(Const.ContextReleaseBehavior), NO_EXTRA" ],
+
+# blend_func_extended
+ [ "MAX_DUAL_SOURCE_DRAW_BUFFERS", "CONTEXT_INT(Const.MaxDualSourceDrawBuffers), extra_ARB_blend_func_extended" ],
]},
# GLES3 is not a typo.
@@ -801,7 +804,6 @@ descriptor=[
# GL_ARB_robustness
[ "RESET_NOTIFICATION_STRATEGY_ARB", "CONTEXT_ENUM(Const.ResetStrategy), NO_EXTRA" ],
- [ "MAX_DUAL_SOURCE_DRAW_BUFFERS", "CONTEXT_INT(Const.MaxDualSourceDrawBuffers), extra_ARB_blend_func_extended" ],
# GL_ARB_uniform_buffer_object
[ "MAX_GEOMETRY_UNIFORM_BLOCKS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxUniformBlocks), extra_ARB_uniform_buffer_object_and_geometry_shader" ],
diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c
index 9873fdbf1a4..87c5a3a194f 100644
--- a/src/mesa/main/getstring.c
+++ b/src/mesa/main/getstring.c
@@ -121,7 +121,7 @@ _mesa_GetString( GLenum name )
assert(ctx->Driver.GetString);
{
/* Give the driver the chance to handle this query */
- const GLubyte *str = (*ctx->Driver.GetString)(ctx, name);
+ const GLubyte *str = ctx->Driver.GetString(ctx, name);
if (str)
return str;
}
@@ -203,12 +203,18 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params )
{
GET_CURRENT_CONTEXT(ctx);
const GLuint clientUnit = ctx->Array.ActiveTexture;
+ const char *callerstr;
+
+ if (_mesa_is_desktop_gl(ctx))
+ callerstr = "glGetPointerv";
+ else
+ callerstr = "glGetPointervKHR";
if (!params)
return;
if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glGetPointerv %s\n", _mesa_enum_to_string(pname));
+ _mesa_debug(ctx, "%s %s\n", callerstr, _mesa_enum_to_string(pname));
switch (pname) {
case GL_VERTEX_ARRAY_POINTER:
@@ -268,10 +274,7 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params )
break;
case GL_DEBUG_CALLBACK_FUNCTION_ARB:
case GL_DEBUG_CALLBACK_USER_PARAM_ARB:
- if (!_mesa_is_desktop_gl(ctx))
- goto invalid_pname;
- else
- *params = _mesa_get_debug_state_ptr(ctx, pname);
+ *params = _mesa_get_debug_state_ptr(ctx, pname);
break;
default:
goto invalid_pname;
@@ -280,7 +283,7 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params )
return;
invalid_pname:
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetPointerv" );
+ _mesa_error( ctx, GL_INVALID_ENUM, "%s", callerstr);
return;
}
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 95cbba4ed57..4a849fb090d 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2193,6 +2193,7 @@ struct gl_ati_fragment_shader_state
struct gl_subroutine_function
{
char *name;
+ int index;
int num_compat_types;
const struct glsl_type **types;
};
@@ -3766,6 +3767,7 @@ struct gl_extensions
GLboolean EXT_polygon_offset_clamp;
GLboolean EXT_provoking_vertex;
GLboolean EXT_shader_integer_mix;
+ GLboolean EXT_shader_samples_identical;
GLboolean EXT_stencil_two_side;
GLboolean EXT_texture_array;
GLboolean EXT_texture_compression_latc;
diff --git a/src/mesa/main/objectlabel.c b/src/mesa/main/objectlabel.c
index 1019f893ba8..41f370ce485 100644
--- a/src/mesa/main/objectlabel.c
+++ b/src/mesa/main/objectlabel.c
@@ -243,13 +243,19 @@ _mesa_ObjectLabel(GLenum identifier, GLuint name, GLsizei length,
const GLchar *label)
{
GET_CURRENT_CONTEXT(ctx);
+ const char *callerstr;
char **labelPtr;
- labelPtr = get_label_pointer(ctx, identifier, name, "glObjectLabel");
+ if (_mesa_is_desktop_gl(ctx))
+ callerstr = "glObjectLabel";
+ else
+ callerstr = "glObjectLabelKHR";
+
+ labelPtr = get_label_pointer(ctx, identifier, name, callerstr);
if (!labelPtr)
return;
- set_label(ctx, labelPtr, label, length, "glObjectLabel");
+ set_label(ctx, labelPtr, label, length, callerstr);
}
void GLAPIENTRY
@@ -257,15 +263,21 @@ _mesa_GetObjectLabel(GLenum identifier, GLuint name, GLsizei bufSize,
GLsizei *length, GLchar *label)
{
GET_CURRENT_CONTEXT(ctx);
+ const char *callerstr;
char **labelPtr;
+ if (_mesa_is_desktop_gl(ctx))
+ callerstr = "glGetObjectLabel";
+ else
+ callerstr = "glGetObjectLabelKHR";
+
if (bufSize < 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glGetObjectLabel(bufSize = %d)",
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(bufSize = %d)", callerstr,
bufSize);
return;
}
- labelPtr = get_label_pointer(ctx, identifier, name, "glGetObjectLabel");
+ labelPtr = get_label_pointer(ctx, identifier, name, callerstr);
if (!labelPtr)
return;
@@ -276,17 +288,24 @@ void GLAPIENTRY
_mesa_ObjectPtrLabel(const void *ptr, GLsizei length, const GLchar *label)
{
GET_CURRENT_CONTEXT(ctx);
- char **labelPtr;
struct gl_sync_object *const syncObj = (struct gl_sync_object *) ptr;
+ const char *callerstr;
+ char **labelPtr;
+
+ if (_mesa_is_desktop_gl(ctx))
+ callerstr = "glObjectPtrLabel";
+ else
+ callerstr = "glObjectPtrLabelKHR";
if (!_mesa_validate_sync(ctx, syncObj)) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glObjectPtrLabel (not a valid sync object)");
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s (not a valid sync object)",
+ callerstr);
return;
}
labelPtr = &syncObj->Label;
- set_label(ctx, labelPtr, label, length, "glObjectPtrLabel");
+ set_label(ctx, labelPtr, label, length, callerstr);
}
void GLAPIENTRY
@@ -294,17 +313,24 @@ _mesa_GetObjectPtrLabel(const void *ptr, GLsizei bufSize, GLsizei *length,
GLchar *label)
{
GET_CURRENT_CONTEXT(ctx);
- char **labelPtr;
struct gl_sync_object *const syncObj = (struct gl_sync_object *) ptr;
+ const char *callerstr;
+ char **labelPtr;
+
+ if (_mesa_is_desktop_gl(ctx))
+ callerstr = "glGetObjectPtrLabel";
+ else
+ callerstr = "glGetObjectPtrLabelKHR";
if (bufSize < 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glGetObjectPtrLabel(bufSize = %d)",
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(bufSize = %d)", callerstr,
bufSize);
return;
}
if (!_mesa_validate_sync(ctx, syncObj)) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glGetObjectPtrLabel (not a valid sync object)");
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s (not a valid sync object)",
+ callerstr);
return;
}
diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c
index 863e3c1af32..c2f2b6399cb 100644
--- a/src/mesa/main/points.c
+++ b/src/mesa/main/points.c
@@ -209,7 +209,7 @@ _mesa_PointParameterfv( GLenum pname, const GLfloat *params)
}
if (ctx->Driver.PointParameterfv)
- (*ctx->Driver.PointParameterfv)(ctx, pname, params);
+ ctx->Driver.PointParameterfv(ctx, pname, params);
}
diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp
index 58ba04153e6..79a91b5b6bd 100644
--- a/src/mesa/main/shader_query.cpp
+++ b/src/mesa/main/shader_query.cpp
@@ -661,6 +661,13 @@ _mesa_program_resource_index(struct gl_shader_program *shProg,
switch (res->Type) {
case GL_ATOMIC_COUNTER_BUFFER:
return RESOURCE_ATC(res) - shProg->AtomicBuffers;
+ case GL_VERTEX_SUBROUTINE:
+ case GL_GEOMETRY_SUBROUTINE:
+ case GL_FRAGMENT_SUBROUTINE:
+ case GL_COMPUTE_SUBROUTINE:
+ case GL_TESS_CONTROL_SUBROUTINE:
+ case GL_TESS_EVALUATION_SUBROUTINE:
+ return RESOURCE_SUB(res)->index;
case GL_UNIFORM_BLOCK:
case GL_SHADER_STORAGE_BLOCK:
case GL_TRANSFORM_FEEDBACK_VARYING:
@@ -1413,9 +1420,19 @@ _mesa_validate_pipeline_io(struct gl_pipeline_object *pipeline)
for (idx = prev + 1; idx < ARRAY_SIZE(pipeline->CurrentProgram); idx++) {
if (shProg[idx]) {
- if (!validate_io(shProg[prev]->_LinkedShaders[prev],
- shProg[idx]->_LinkedShaders[idx]))
- return false;
+ /* Since we now only validate precision, we can skip this step for
+ * desktop GLSL shaders, there precision qualifier is ignored.
+ *
+ * From OpenGL 4.50 Shading Language spec, section 4.7:
+ * "For the purposes of determining if an output from one shader
+ * stage matches an input of the next stage, the precision
+ * qualifier need not match."
+ */
+ if (shProg[prev]->IsES || shProg[idx]->IsES) {
+ if (!validate_io(shProg[prev]->_LinkedShaders[prev],
+ shProg[idx]->_LinkedShaders[idx]))
+ return false;
+ }
prev = idx;
}
}
diff --git a/src/mesa/main/tests/Makefile.am b/src/mesa/main/tests/Makefile.am
index bd7ab7365c0..d6977e20e85 100644
--- a/src/mesa/main/tests/Makefile.am
+++ b/src/mesa/main/tests/Makefile.am
@@ -27,6 +27,7 @@ AM_CPPFLAGS += -DHAVE_SHARED_GLAPI
main_test_SOURCES += \
dispatch_sanity.cpp \
mesa_formats.cpp \
+ mesa_extensions.cpp \
program_state_string.cpp
main_test_LDADD += \
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index abe0f432572..97f81f932f6 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -2421,6 +2421,11 @@ const struct function gles3_functions_possible[] = {
{ "glProgramUniform4uiEXT", 30, -1 },
{ "glProgramUniform4uivEXT", 30, -1 },
+ /* GL_EXT_blend_func_extended */
+ { "glBindFragDataLocationIndexedEXT", 30, -1 },
+ { "glGetFragDataIndexEXT", 30, -1 },
+ { "glBindFragDataLocationEXT", 30, -1 },
+
{ NULL, 0, -1 }
};
@@ -2509,5 +2514,8 @@ const struct function gles31_functions_possible[] = {
/* GL_EXT_buffer_storage */
{ "glBufferStorageEXT", 31, -1 },
+ /* GL_EXT_blend_func_extended */
+ { "glGetProgramResourceLocationIndexEXT", 31, -1 },
+
{ NULL, 0, -1 },
};
diff --git a/src/mesa/main/tests/mesa_extensions.cpp b/src/mesa/main/tests/mesa_extensions.cpp
new file mode 100644
index 00000000000..0c7addd4282
--- /dev/null
+++ b/src/mesa/main/tests/mesa_extensions.cpp
@@ -0,0 +1,51 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \name mesa_extensions.cpp
+ *
+ * Verify that the extensions table is sorted.
+ */
+
+#include <gtest/gtest.h>
+#include "util/macros.h"
+
+/**
+ * Debug/test: verify the extension table is alphabetically sorted.
+ */
+TEST(MesaExtensionsTest, AlphabeticallySorted)
+{
+ const char *ext_names[] = {
+ #define EXT(name_str, ...) #name_str,
+ #include "main/extensions_table.h"
+ #undef EXT
+ };
+
+ for (unsigned i = 0; i < ARRAY_SIZE(ext_names) - 1; ++i) {
+ const char *current_str = ext_names[i];
+ const char *next_str = ext_names[i+1];
+
+ /* We expect the extension table to be alphabetically sorted */
+ ASSERT_LT(strcmp(current_str, next_str), 0);
+ }
+}
diff --git a/src/mesa/main/texenv.c b/src/mesa/main/texenv.c
index 091922161c5..93c680650bb 100644
--- a/src/mesa/main/texenv.c
+++ b/src/mesa/main/texenv.c
@@ -495,7 +495,7 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
/* Tell device driver about the new texture environment */
if (ctx->Driver.TexEnv) {
- (*ctx->Driver.TexEnv)( ctx, target, pname, param );
+ ctx->Driver.TexEnv(ctx, target, pname, param);
}
}
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index d9453e3a281..ac7599f9fd4 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1333,21 +1333,6 @@ _mesa_target_can_be_compressed(const struct gl_context *ctx, GLenum target,
break;
case GL_PROXY_TEXTURE_CUBE_MAP_ARRAY:
case GL_TEXTURE_CUBE_MAP_ARRAY:
- /* From section 3.8.6, page 146 of OpenGL ES 3.0 spec:
- *
- * "The ETC2/EAC texture compression algorithm supports only
- * two-dimensional images. If internalformat is an ETC2/EAC format,
- * glCompressedTexImage3D will generate an INVALID_OPERATION error if
- * target is not TEXTURE_2D_ARRAY."
- *
- * This should also be applicable for glTexStorage3D(). Other available
- * targets for these functions are: TEXTURE_3D and TEXTURE_CUBE_MAP_ARRAY.
- */
- if (layout == MESA_FORMAT_LAYOUT_ETC2 && _mesa_is_gles3(ctx))
- return write_error(error, GL_INVALID_OPERATION);
-
- target_can_be_compresed = ctx->Extensions.ARB_texture_cube_map_array;
-
/* From the KHR_texture_compression_astc_hdr spec:
*
* Add a second new column "3D Tex." which is empty for all non-ASTC
@@ -1368,16 +1353,24 @@ _mesa_target_can_be_compressed(const struct gl_context *ctx, GLenum target,
* 8.19 is *not* checked'
*
* The instances of <internalformat> above should say <target>.
+ *
+ * ETC2/EAC formats are the only alternative in GLES and thus such errors
+ * have already been handled by normal ETC2/EAC behavior.
*/
- /* Throw an INVALID_OPERATION error if the target is
- * TEXTURE_CUBE_MAP_ARRAY and the format is not ASTC.
+ /* From section 3.8.6, page 146 of OpenGL ES 3.0 spec:
+ *
+ * "The ETC2/EAC texture compression algorithm supports only
+ * two-dimensional images. If internalformat is an ETC2/EAC format,
+ * glCompressedTexImage3D will generate an INVALID_OPERATION error if
+ * target is not TEXTURE_2D_ARRAY."
+ *
+ * This should also be applicable for glTexStorage3D(). Other available
+ * targets for these functions are: TEXTURE_3D and TEXTURE_CUBE_MAP_ARRAY.
*/
- if (target_can_be_compresed &&
- ctx->Extensions.KHR_texture_compression_astc_ldr &&
- layout != MESA_FORMAT_LAYOUT_ASTC)
- return write_error(error, GL_INVALID_OPERATION);
-
+ if (layout == MESA_FORMAT_LAYOUT_ETC2 && _mesa_is_gles3(ctx))
+ return write_error(error, GL_INVALID_OPERATION);
+ target_can_be_compresed = ctx->Extensions.ARB_texture_cube_map_array;
break;
case GL_TEXTURE_3D:
switch (layout) {
@@ -1401,12 +1394,6 @@ _mesa_target_can_be_compressed(const struct gl_context *ctx, GLenum target,
return write_error(error, GL_INVALID_OPERATION);
break;
default:
- /* Throw an INVALID_OPERATION error if the target is TEXTURE_3D and
- * the format is not ASTC.
- * See comment in switch case GL_TEXTURE_CUBE_MAP_ARRAY for more info.
- */
- if (ctx->Extensions.KHR_texture_compression_astc_ldr)
- return write_error(error, GL_INVALID_OPERATION);
break;
}
default: