[Mesa-dev] [PATCH 10/15] Revert "mesa: Add ARB_direct_state_access checks in FBO functions"

Ian Romanick idr at freedesktop.org
Mon May 18 14:28:19 PDT 2015


From: Ian Romanick <ian.d.romanick at intel.com>

This reverts commit 6ad0b7e07a0445e9e0f368e079c4f7b8a6757bb3.

Cc: "10.6" <mesa-stable at lists.freedesktop.org>
---
 src/mesa/main/blit.c     |  7 -----
 src/mesa/main/buffers.c  | 21 ---------------
 src/mesa/main/clear.c    | 32 -----------------------
 src/mesa/main/fbobject.c | 67 ------------------------------------------------
 4 files changed, 127 deletions(-)

diff --git a/src/mesa/main/blit.c b/src/mesa/main/blit.c
index fac9724..db8fee5 100644
--- a/src/mesa/main/blit.c
+++ b/src/mesa/main/blit.c
@@ -540,13 +540,6 @@ _mesa_BlitNamedFramebuffer(GLuint readFramebuffer, GLuint drawFramebuffer,
    GET_CURRENT_CONTEXT(ctx);
    struct gl_framebuffer *readFb, *drawFb;
 
-   if (!ctx->Extensions.ARB_direct_state_access) {
-      _mesa_error(ctx, GL_INVALID_OPERATION,
-                  "glBlitNamedFramebuffer(GL_ARB_direct_state_access "
-                  "is not supported)");
-      return;
-   }
-
    if (MESA_VERBOSE & VERBOSE_API)
       _mesa_debug(ctx,
                   "glBlitNamedFramebuffer(%u %u %d, %d, %d, %d, "
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index c83459a..0536266 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -303,13 +303,6 @@ _mesa_NamedFramebufferDrawBuffer(GLuint framebuffer, GLenum buf)
    GET_CURRENT_CONTEXT(ctx);
    struct gl_framebuffer *fb;
 
-   if (!ctx->Extensions.ARB_direct_state_access) {
-      _mesa_error(ctx, GL_INVALID_OPERATION,
-                  "glNamedFramebufferDrawBuffer(GL_ARB_direct_state_access "
-                  "is not supported)");
-      return;
-   }
-
    if (framebuffer) {
       fb = _mesa_lookup_framebuffer_err(ctx, framebuffer,
                                         "glNamedFramebufferDrawBuffer");
@@ -520,13 +513,6 @@ _mesa_NamedFramebufferDrawBuffers(GLuint framebuffer, GLsizei n,
    GET_CURRENT_CONTEXT(ctx);
    struct gl_framebuffer *fb;
 
-   if (!ctx->Extensions.ARB_direct_state_access) {
-      _mesa_error(ctx, GL_INVALID_OPERATION,
-                  "glNamedFramebufferDrawBuffers(GL_ARB_direct_state_access "
-                  "is not supported)");
-      return;
-   }
-
    if (framebuffer) {
       fb = _mesa_lookup_framebuffer_err(ctx, framebuffer,
                                         "glNamedFramebufferDrawBuffers");
@@ -764,13 +750,6 @@ _mesa_NamedFramebufferReadBuffer(GLuint framebuffer, GLenum src)
    GET_CURRENT_CONTEXT(ctx);
    struct gl_framebuffer *fb;
 
-   if (!ctx->Extensions.ARB_direct_state_access) {
-      _mesa_error(ctx, GL_INVALID_OPERATION,
-                  "glNamedFramebufferReadBuffer(GL_ARB_direct_state_access "
-                  "is not supported)");
-      return;
-   }
-
    if (framebuffer) {
       fb = _mesa_lookup_framebuffer_err(ctx, framebuffer,
                                         "glNamedFramebufferReadBuffer");
diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c
index c6999f7..426caea 100644
--- a/src/mesa/main/clear.c
+++ b/src/mesa/main/clear.c
@@ -412,14 +412,6 @@ _mesa_ClearNamedFramebufferiv(GLuint framebuffer, GLenum buffer,
 {
    GLint oldfb;
 
-   GET_CURRENT_CONTEXT(ctx);
-   if (!ctx->Extensions.ARB_direct_state_access) {
-      _mesa_error(ctx, GL_INVALID_OPERATION,
-                  "glClearNamedFramebufferiv(GL_ARB_direct_state_access "
-                  "is not supported)");
-      return;
-   }
-
    _mesa_GetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &oldfb);
    _mesa_BindFramebuffer(GL_DRAW_FRAMEBUFFER, framebuffer);
    _mesa_ClearBufferiv(buffer, drawbuffer, value);
@@ -510,14 +502,6 @@ _mesa_ClearNamedFramebufferuiv(GLuint framebuffer, GLenum buffer,
 {
    GLint oldfb;
 
-   GET_CURRENT_CONTEXT(ctx);
-   if (!ctx->Extensions.ARB_direct_state_access) {
-      _mesa_error(ctx, GL_INVALID_OPERATION,
-                  "glClearNamedFramebufferuiv(GL_ARB_direct_state_access "
-                  "is not supported)");
-      return;
-   }
-
    _mesa_GetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &oldfb);
    _mesa_BindFramebuffer(GL_DRAW_FRAMEBUFFER, framebuffer);
    _mesa_ClearBufferuiv(buffer, drawbuffer, value);
@@ -629,14 +613,6 @@ _mesa_ClearNamedFramebufferfv(GLuint framebuffer, GLenum buffer,
 {
    GLint oldfb;
 
-   GET_CURRENT_CONTEXT(ctx);
-   if (!ctx->Extensions.ARB_direct_state_access) {
-      _mesa_error(ctx, GL_INVALID_OPERATION,
-                  "glClearNamedFramebufferfv(GL_ARB_direct_state_access "
-                  "is not supported)");
-      return;
-   }
-
    _mesa_GetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &oldfb);
    _mesa_BindFramebuffer(GL_DRAW_FRAMEBUFFER, framebuffer);
    _mesa_ClearBufferfv(buffer, drawbuffer, value);
@@ -719,14 +695,6 @@ _mesa_ClearNamedFramebufferfi(GLuint framebuffer, GLenum buffer,
 {
    GLint oldfb;
 
-   GET_CURRENT_CONTEXT(ctx);
-   if (!ctx->Extensions.ARB_direct_state_access) {
-      _mesa_error(ctx, GL_INVALID_OPERATION,
-                  "glClearNamedFramebufferfi(GL_ARB_direct_state_access "
-                  "is not supported)");
-      return;
-   }
-
    _mesa_GetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &oldfb);
    _mesa_BindFramebuffer(GL_DRAW_FRAMEBUFFER, framebuffer);
    _mesa_ClearBufferfi(buffer, 0, depth, stencil);
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index de8af46..5b8c52a 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2454,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;
@@ -2558,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
@@ -3110,12 +3097,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)
@@ -3201,12 +3182,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");
@@ -3332,13 +3307,6 @@ _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)
@@ -3673,13 +3641,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");
@@ -3712,13 +3673,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)");
@@ -3735,13 +3689,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)");
@@ -3910,13 +3857,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."
@@ -3978,13 +3918,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."
-- 
2.1.0



More information about the mesa-dev mailing list