diff options
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/arrayobj.c | 9 | ||||
-rw-r--r-- | src/mesa/main/extensions_table.h | 2 | ||||
-rw-r--r-- | src/mesa/main/fbobject.c | 13 |
3 files changed, 17 insertions, 7 deletions
diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c index 5ee68cf9e94..a23031fe182 100644 --- a/src/mesa/main/arrayobj.c +++ b/src/mesa/main/arrayobj.c @@ -196,7 +196,16 @@ _mesa_vao_attribute_map[ATTRIBUTE_MAP_MODE_MAX][VERT_ATTRIB_MAX] = struct gl_vertex_array_object * _mesa_lookup_vao(struct gl_context *ctx, GLuint id) { + /* The ARB_direct_state_access specification says: + * + * "<vaobj> is [compatibility profile: + * zero, indicating the default vertex array object, or] + * the name of the vertex array object." + */ if (id == 0) { + if (ctx->API == API_OPENGL_COMPAT) + return ctx->Array.DefaultVAO; + return NULL; } else { struct gl_vertex_array_object *vao; diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h index 013756455fd..3c8f126c368 100644 --- a/src/mesa/main/extensions_table.h +++ b/src/mesa/main/extensions_table.h @@ -59,7 +59,7 @@ EXT(ARB_depth_buffer_float , ARB_depth_buffer_float EXT(ARB_depth_clamp , ARB_depth_clamp , GLL, GLC, x , x , 2003) EXT(ARB_depth_texture , ARB_depth_texture , GLL, x , x , x , 2001) EXT(ARB_derivative_control , ARB_derivative_control , GLL, GLC, x , x , 2014) -EXT(ARB_direct_state_access , dummy_true , 45, GLC, x , x , 2014) +EXT(ARB_direct_state_access , dummy_true , 31, GLC, x , x , 2014) EXT(ARB_draw_buffers , dummy_true , GLL, GLC, x , x , 2002) EXT(ARB_draw_buffers_blend , ARB_draw_buffers_blend , GLL, GLC, x , x , 2009) EXT(ARB_draw_elements_base_vertex , ARB_draw_elements_base_vertex , GLL, GLC, x , x , 2009) diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 284990d7d00..51e137dce9b 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -3292,13 +3292,14 @@ check_texture_target(struct gl_context *ctx, GLenum target, case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: return true; case GL_TEXTURE_CUBE_MAP: - /* We don't need to check the extension (GL_ARB_direct_state_access) or - * GL version (4.5) for GL_TEXTURE_CUBE_MAP because DSA is always - * enabled in core profile. This can be called from - * _mesa_FramebufferTextureLayer in compatibility profile (OpenGL 3.0), - * so we do have to check the profile. + /* GL_TEXTURE_CUBE_MAP is only allowed by OpenGL 4.5 here, which + * includes the DSA API. + * + * Because DSA is only enabled for GL 3.1+ and this can be called + * from _mesa_FramebufferTextureLayer in compatibility profile, + * we need to check the version. */ - return ctx->API == API_OPENGL_CORE; + return _mesa_is_desktop_gl(ctx) && ctx->Version >= 31; } _mesa_error(ctx, GL_INVALID_OPERATION, |