Bug 1265112 - Add support for NV_texture_barrier to GLContext. r=jrmuizel
☠☠ backed out by 99d3b89fb955 ☠ ☠
authorMarkus Stange <mstange@themasta.com>
Sat, 16 Jan 2016 15:27:18 +0100
changeset 358087 7d87fa0dc7edf93fb51253f287fb6709a029fb6d
parent 358086 b8a517eb7c6b700b6845a4f43e65cb2f0da58287
child 358088 d1b4c58744933a651ff6ff4e88726c8b31c0f059
push id16941
push userbmo:jbeich@FreeBSD.org
push dateSun, 01 May 2016 11:16:34 +0000
reviewersjrmuizel
bugs1265112
milestone49.0a1
Bug 1265112 - Add support for NV_texture_barrier to GLContext. r=jrmuizel MozReview-Commit-ID: 95j0YBKN1P1
gfx/gl/GLContext.cpp
gfx/gl/GLContext.h
gfx/gl/GLContextSymbols.h
--- a/gfx/gl/GLContext.cpp
+++ b/gfx/gl/GLContext.cpp
@@ -151,16 +151,17 @@ static const char* const sExtensionNames
     "GL_IMG_texture_npot",
     "GL_KHR_debug",
     "GL_NV_draw_instanced",
     "GL_NV_fence",
     "GL_NV_framebuffer_blit",
     "GL_NV_geometry_program4",
     "GL_NV_half_float",
     "GL_NV_instanced_arrays",
+    "GL_NV_texture_barrier",
     "GL_NV_transform_feedback",
     "GL_NV_transform_feedback2",
     "GL_OES_EGL_image",
     "GL_OES_EGL_image_external",
     "GL_OES_EGL_sync",
     "GL_OES_compressed_ETC1_RGB8_texture",
     "GL_OES_depth24",
     "GL_OES_depth32",
@@ -1553,16 +1554,30 @@ GLContext::LoadMoreSymbols(const char* p
             { (PRFuncPtr*) &mSymbols.fSetFence,     { "SetFenceNV",     nullptr } },
             { (PRFuncPtr*) &mSymbols.fTestFence,    { "TestFenceNV",    nullptr } },
             { (PRFuncPtr*) &mSymbols.fFinishFence,  { "FinishFenceNV",  nullptr } },
             { (PRFuncPtr*) &mSymbols.fIsFence,      { "IsFenceNV",      nullptr } },
             { (PRFuncPtr*) &mSymbols.fGetFenceiv,   { "GetFenceivNV",   nullptr } },
             END_SYMBOLS
         };
         fnLoadForExt(symbols, NV_fence);
+                ClearSymbols(extSymbols);
+            }
+        }
+
+        if (IsExtensionSupported(NV_texture_barrier)) {
+            SymLoadStruct extSymbols[] = {
+                { (PRFuncPtr*) &mSymbols.fTextureBarrier, { "TextureBarrierNV", nullptr } },
+                END_SYMBOLS
+            };
+
+            if (!LoadSymbols(&extSymbols[0], trygl, prefix)) {
+                NS_ERROR("GL supports NV_texture_barrier without supplying its functions.");
+
+                MarkExtensionUnsupported(NV_texture_barrier);
     }
 
     if (IsSupported(GLFeature::read_buffer)) {
         const SymLoadStruct symbols[] = {
             { (PRFuncPtr*) &mSymbols.fReadBuffer, { "ReadBuffer", nullptr } },
             END_SYMBOLS
         };
         fnLoadForFeature(symbols, GLFeature::read_buffer);
--- a/gfx/gl/GLContext.h
+++ b/gfx/gl/GLContext.h
@@ -473,16 +473,17 @@ public:
         IMG_texture_npot,
         KHR_debug,
         NV_draw_instanced,
         NV_fence,
         NV_framebuffer_blit,
         NV_geometry_program4,
         NV_half_float,
         NV_instanced_arrays,
+        NV_texture_barrier,
         NV_transform_feedback,
         NV_transform_feedback2,
         OES_EGL_image,
         OES_EGL_image_external,
         OES_EGL_sync,
         OES_compressed_ETC1_RGB8_texture,
         OES_depth24,
         OES_depth32,
@@ -2874,16 +2875,27 @@ public:
     void fGetFenceiv(GLuint fence, GLenum pname, GLint* params)
     {
         ASSERT_SYMBOL_PRESENT(fGetFenceiv);
         BEFORE_GL_CALL;
         mSymbols.fGetFenceiv(fence, pname, params);
         AFTER_GL_CALL;
     }
 
+// -----------------------------------------------------------------------------
+// Extension NV_texture_barrier
+public:
+    void fTextureBarrier()
+    {
+        ASSERT_SYMBOL_PRESENT(fTextureBarrier);
+        BEFORE_GL_CALL;
+        mSymbols.fTextureBarrier();
+        AFTER_GL_CALL;
+    }
+
 // Core GL & Extension ARB_copy_buffer
 public:
     void fCopyBufferSubData(GLenum readtarget, GLenum writetarget,
                             GLintptr readoffset, GLintptr writeoffset,
                             GLsizeiptr size)
     {
         BEFORE_GL_CALL;
         ASSERT_SYMBOL_PRESENT(fCopyBufferSubData);
--- a/gfx/gl/GLContextSymbols.h
+++ b/gfx/gl/GLContextSymbols.h
@@ -685,14 +685,18 @@ struct GLContextSymbols
 
     // get_string_indexed
     typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGIPROC)(GLenum name, GLuint index);
     PFNGLGETSTRINGIPROC fGetStringi;
 
     // APPLE_framebuffer_multisample
     typedef void (GLAPIENTRY * PFNRESOLVEMULTISAMPLEFRAMEBUFFERAPPLE) (void);
     PFNRESOLVEMULTISAMPLEFRAMEBUFFERAPPLE fResolveMultisampleFramebufferAPPLE;
+
+    // NV_texture_barrier
+    typedef void (GLAPIENTRY * PFNTEXTUREBARRIERPROC) (void);
+    PFNTEXTUREBARRIERPROC fTextureBarrier;
 };
 
 } // namespace gl
 } // namespace mozilla
 
 #endif /* GLCONTEXTSYMBOLS_H_ */