aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/fbobject.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2015-06-15 21:36:28 +0200
committermarha <marha@users.sourceforge.net>2015-06-15 21:36:28 +0200
commit008a8d8051786badb83e455bd9281103ba9a6470 (patch)
treef99ea672d105271cb60a726fac8022ce47ea2866 /mesalib/src/mesa/main/fbobject.c
parent912e881bec8b16f2331225960645c3bdf5a8ba2d (diff)
parente8d5e7c4bb11f7fcb0a4ba5c13f43e7929849a2f (diff)
downloadvcxsrv-008a8d8051786badb83e455bd9281103ba9a6470.tar.gz
vcxsrv-008a8d8051786badb83e455bd9281103ba9a6470.tar.bz2
vcxsrv-008a8d8051786badb83e455bd9281103ba9a6470.zip
Merge remote-tracking branch 'origin/released'
Conflicts: freetype/src/base/ftfntfmt.c freetype/src/cache/ftcimage.c freetype/src/cid/cidriver.c freetype/src/truetype/ttdriver.c mesalib/src/mesa/drivers/dri/common/dri_util.c mesalib/src/mesa/drivers/dri/swrast/swrast.c openssl/Makefile
Diffstat (limited to 'mesalib/src/mesa/main/fbobject.c')
-rw-r--r--mesalib/src/mesa/main/fbobject.c103
1 files changed, 12 insertions, 91 deletions
diff --git a/mesalib/src/mesa/main/fbobject.c b/mesalib/src/mesa/main/fbobject.c
index 8db651ca2..c5a702636 100644
--- a/mesalib/src/mesa/main/fbobject.c
+++ b/mesalib/src/mesa/main/fbobject.c
@@ -1489,14 +1489,6 @@ void GLAPIENTRY
_mesa_CreateRenderbuffers(GLsizei n, GLuint *renderbuffers)
{
GET_CURRENT_CONTEXT(ctx);
-
- if (!ctx->Extensions.ARB_direct_state_access) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glCreateRenderbuffers(GL_ARB_direct_state_access "
- "is not supported)");
- return;
- }
-
create_render_buffers(ctx, n, renderbuffers, true);
}
@@ -1937,12 +1929,6 @@ renderbuffer_storage_named(GLuint renderbuffer, GLenum internalFormat,
{
GET_CURRENT_CONTEXT(ctx);
- if (!ctx->Extensions.ARB_direct_state_access) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(GL_ARB_direct_state_access is not supported)", func);
- return;
- }
-
if (MESA_VERBOSE & VERBOSE_API) {
if (samples == NO_SAMPLES)
_mesa_debug(ctx, "%s(%u, %s, %d, %d)\n",
@@ -2197,13 +2183,6 @@ _mesa_GetNamedRenderbufferParameteriv(GLuint renderbuffer, GLenum pname,
{
GET_CURRENT_CONTEXT(ctx);
- if (!ctx->Extensions.ARB_direct_state_access) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetNamedRenderbufferParameteriv("
- "GL_ARB_direct_state_access is not supported)");
- return;
- }
-
struct gl_renderbuffer *rb = _mesa_lookup_renderbuffer(ctx, renderbuffer);
if (!rb || rb == &DummyRenderbuffer) {
/* ID was reserved, but no real renderbuffer object made yet */
@@ -2475,12 +2454,6 @@ create_framebuffers(GLsizei n, GLuint *framebuffers, bool dsa)
const char *func = dsa ? "glCreateFramebuffers" : "glGenFramebuffers";
- if (dsa && !ctx->Extensions.ARB_direct_state_access) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(GL_ARB_direct_state_access is not supported)", func);
- return;
- }
-
if (n < 0) {
_mesa_error(ctx, GL_INVALID_VALUE, "%s(n < 0)", func);
return;
@@ -2579,13 +2552,6 @@ _mesa_CheckNamedFramebufferStatus(GLuint framebuffer, GLenum target)
struct gl_framebuffer *fb;
GET_CURRENT_CONTEXT(ctx);
- if (!ctx->Extensions.ARB_direct_state_access) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glCheckNamedFramebufferStatus(GL_ARB_direct_state_access "
- "is not supported)");
- return 0;
- }
-
/* Validate the target (for conformance's sake) and grab a reference to the
* default framebuffer in case framebuffer = 0.
* Section 9.4 Framebuffer Completeness of the OpenGL 4.5 core spec
@@ -2741,6 +2707,10 @@ check_texture_target(struct gl_context *ctx, GLenum target,
/* We're being called by glFramebufferTextureLayer().
* The only legal texture types for that function are 3D,
* cube-map, and 1D/2D/cube-map array textures.
+ *
+ * We don't need to check for GL_ARB_texture_cube_map_array because the
+ * application wouldn't have been able to create a texture with a
+ * GL_TEXTURE_CUBE_MAP_ARRAY target if the extension were not enabled.
*/
switch (target) {
case GL_TEXTURE_3D:
@@ -2750,10 +2720,13 @@ check_texture_target(struct gl_context *ctx, GLenum target,
case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
return true;
case GL_TEXTURE_CUBE_MAP:
- /* This target is valid in TextureLayer when ARB_direct_state_access
- * or OpenGL 4.5 is supported.
+ /* 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.
*/
- return ctx->Extensions.ARB_direct_state_access;
+ return ctx->API == API_OPENGL_CORE;
}
_mesa_error(ctx, GL_INVALID_OPERATION,
@@ -3131,12 +3104,6 @@ _mesa_NamedFramebufferTextureLayer(GLuint framebuffer, GLenum attachment,
const char *func = "glNamedFramebufferTextureLayer";
- if (!ctx->Extensions.ARB_direct_state_access) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(GL_ARB_direct_state_access is not supported)", func);
- return;
- }
-
/* Get the framebuffer object */
fb = _mesa_lookup_framebuffer_err(ctx, framebuffer, func);
if (!fb)
@@ -3222,12 +3189,6 @@ _mesa_NamedFramebufferTexture(GLuint framebuffer, GLenum attachment,
const char *func = "glNamedFramebufferTexture";
- if (!ctx->Extensions.ARB_direct_state_access) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(GL_ARB_direct_state_access is not supported)", func);
- return;
- }
-
if (!_mesa_has_geometry_shaders(ctx)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"unsupported function (glNamedFramebufferTexture) called");
@@ -3353,15 +3314,10 @@ _mesa_NamedFramebufferRenderbuffer(GLuint framebuffer, GLenum attachment,
struct gl_renderbuffer *rb;
GET_CURRENT_CONTEXT(ctx);
- if (!ctx->Extensions.ARB_direct_state_access) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glNamedFramebufferRenderbuffer(GL_ARB_direct_state_access "
- "is not supported)");
- return;
- }
-
fb = _mesa_lookup_framebuffer_err(ctx, framebuffer,
"glNamedFramebufferRenderbuffer");
+ if (!fb)
+ return;
if (renderbuffertarget != GL_RENDERBUFFER) {
_mesa_error(ctx, GL_INVALID_ENUM,
@@ -3692,13 +3648,6 @@ _mesa_GetNamedFramebufferAttachmentParameteriv(GLuint framebuffer,
GET_CURRENT_CONTEXT(ctx);
struct gl_framebuffer *buffer;
- if (!ctx->Extensions.ARB_direct_state_access) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetNamedFramebufferAttachmentParameteriv("
- "GL_ARB_direct_state_access is not supported)");
- return;
- }
-
if (framebuffer) {
buffer = _mesa_lookup_framebuffer_err(ctx, framebuffer,
"glGetNamedFramebufferAttachmentParameteriv");
@@ -3731,13 +3680,6 @@ _mesa_NamedFramebufferParameteri(GLuint framebuffer, GLenum pname,
(void) pname;
(void) param;
- if (!ctx->Extensions.ARB_direct_state_access) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glNamedFramebufferParameteri("
- "GL_ARB_direct_state_access is not supported)");
- return;
- }
-
_mesa_error(ctx, GL_INVALID_OPERATION,
"glNamedFramebufferParameteri not supported "
"(ARB_framebuffer_no_attachments not implemented)");
@@ -3754,13 +3696,6 @@ _mesa_GetNamedFramebufferParameteriv(GLuint framebuffer, GLenum pname,
(void) pname;
(void) param;
- if (!ctx->Extensions.ARB_direct_state_access) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glNamedFramebufferParameteriv("
- "GL_ARB_direct_state_access is not supported)");
- return;
- }
-
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetNamedFramebufferParameteriv not supported "
"(ARB_framebuffer_no_attachments not implemented)");
@@ -3929,13 +3864,6 @@ _mesa_InvalidateNamedFramebufferSubData(GLuint framebuffer,
struct gl_framebuffer *fb;
GET_CURRENT_CONTEXT(ctx);
- if (!ctx->Extensions.ARB_direct_state_access) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glInvalidateNamedFramebufferSubData("
- "GL_ARB_direct_state_access is not supported)");
- return;
- }
-
/* The OpenGL 4.5 core spec (02.02.2015) says (in Section 17.4 Whole
* Framebuffer Operations, PDF page 522): "If framebuffer is zero, the
* default draw framebuffer is affected."
@@ -3997,13 +3925,6 @@ _mesa_InvalidateNamedFramebufferData(GLuint framebuffer,
struct gl_framebuffer *fb;
GET_CURRENT_CONTEXT(ctx);
- if (!ctx->Extensions.ARB_direct_state_access) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glInvalidateNamedFramebufferData("
- "GL_ARB_direct_state_access is not supported)");
- return;
- }
-
/* The OpenGL 4.5 core spec (02.02.2015) says (in Section 17.4 Whole
* Framebuffer Operations, PDF page 522): "If framebuffer is zero, the
* default draw framebuffer is affected."