mesa: add NV_texture_barrier
authorMarek Olšák <maraeo@gmail.com>
Tue, 8 Mar 2011 10:29:20 +0000 (11:29 +0100)
committerMarek Olšák <maraeo@gmail.com>
Tue, 15 Mar 2011 14:47:27 +0000 (15:47 +0100)
12 files changed:
src/mapi/glapi/gen/Makefile
src/mapi/glapi/gen/NV_texture_barrier.xml [new file with mode: 0644]
src/mapi/glapi/gen/gl_API.xml
src/mesa/SConscript
src/mesa/drivers/common/driverfuncs.c
src/mesa/main/api_exec.c
src/mesa/main/dd.h
src/mesa/main/extensions.c
src/mesa/main/mtypes.h
src/mesa/main/texturebarrier.c [new file with mode: 0644]
src/mesa/main/texturebarrier.h [new file with mode: 0644]
src/mesa/sources.mak

index 51eaf7e9304c94e2c0d89e32ea56b60a53f2c492..1f4642af5597d0aa89286442fe0fa6bc5bd56aa2 100644 (file)
@@ -98,6 +98,7 @@ API_XML = \
        EXT_transform_feedback.xml \
        NV_conditional_render.xml \
        NV_primitive_restart.xml \
+       NV_texture_barrier.xml \
        OES_EGL_image.xml \
        GL3x.xml
 
diff --git a/src/mapi/glapi/gen/NV_texture_barrier.xml b/src/mapi/glapi/gen/NV_texture_barrier.xml
new file mode 100644 (file)
index 0000000..52b1a3c
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
+
+<!-- Note: no GLX protocol info yet. -->
+
+
+<OpenGLAPI>
+
+<category name="GL_NV_texture_barrier" number="381">
+    <function name="TextureBarrierNV" offset="assign" />
+</category>
+
+</OpenGLAPI>
index 834b6d640328ce50ef3b5e0d31afff685df8998b..56c0ec71b36f94ef1b113acde10bbdbc9e6b0a7a 100644 (file)
 
 <xi:include href="NV_primitive_restart.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
 
+<xi:include href="NV_texture_barrier.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
 <xi:include href="EXT_transform_feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
 
 <xi:include href="ARB_draw_instanced.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
index 49637d0ff18a84270164f2340d9bd81eae89f90e..dc9090fb735f92fbabb76e1bc6586a431100ee31 100644 (file)
@@ -123,6 +123,7 @@ main_sources = [
     'main/texrender.c',
     'main/texstate.c',
     'main/texstore.c',
+    'main/texturebarrier.c'
     'main/transformfeedback.c',
     'main/uniforms.c',
     'main/varray.c',
index 5389a500111aa40939ad2fa5445ca6a3855970f7..854dea94504022e563aece891a05a07658f78538 100644 (file)
@@ -42,6 +42,7 @@
 #include "main/fbobject.h"
 #include "main/texrender.h"
 #include "main/syncobj.h"
+#include "main/texturebarrier.h"
 #include "main/transformfeedback.h"
 
 #include "program/program.h"
@@ -188,6 +189,8 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
 
    driver->BlitFramebuffer = _swrast_BlitFramebuffer;
 
+   _mesa_init_texture_barrier_functions(driver);
+
    /* APPLE_vertex_array_object */
    driver->NewArrayObject = _mesa_new_array_object;
    driver->DeleteArrayObject = _mesa_delete_array_object;
index 546cdd6198749abbe5c78a75fa85e51dd627fbfe..4da48936484218174f96877b9cccba97a71c13c1 100644 (file)
@@ -87,6 +87,7 @@
 #include "texobj.h"
 #include "texparam.h"
 #include "texstate.h"
+#include "texturebarrier.h"
 #include "transformfeedback.h"
 #include "mtypes.h"
 #include "varray.h"
@@ -719,6 +720,9 @@ _mesa_create_exec_table(void)
    SET_BlendFuncSeparateiARB(exec, _mesa_BlendFuncSeparatei);
    SET_BlendEquationiARB(exec, _mesa_BlendEquationi);
    SET_BlendEquationSeparateiARB(exec, _mesa_BlendEquationSeparatei);
+
+   /* GL_NV_texture_barrier */
+   SET_TextureBarrierNV(exec, _mesa_TextureBarrierNV);
  
    return exec;
 }
index 749c30a4cc19df89d808c649cc6243692460d86c..0947672a081505535dfdb06259be942ad556dbed 100644 (file)
@@ -1025,6 +1025,11 @@ struct dd_function_table {
                                    struct gl_transform_feedback_object *obj);
    void (*DrawTransformFeedback)(struct gl_context *ctx, GLenum mode,
                                  struct gl_transform_feedback_object *obj);
+
+   /**
+    * \name GL_NV_texture_barrier interface
+    */
+   void (*TextureBarrier)(struct gl_context *ctx);
 };
 
 
index 68740e24cc197e3b86e278a0031719273f86e515..1f39ec92df4df03d8fdf09dd7d4782a5499d637f 100644 (file)
@@ -283,6 +283,7 @@ static const struct extension extension_table[] = {
    { "GL_NV_point_sprite",                         o(NV_point_sprite),                         GL             },
    { "GL_NV_primitive_restart",                    o(NV_primitive_restart),                    GL             },
    { "GL_NV_texgen_reflection",                    o(NV_texgen_reflection),                    GL             },
+   { "GL_NV_texture_barrier",                      o(NV_texture_barrier),                      GL             },
    { "GL_NV_texture_env_combine4",                 o(NV_texture_env_combine4),                 GL             },
    { "GL_NV_texture_rectangle",                    o(NV_texture_rectangle),                    GL             },
    { "GL_NV_vertex_program1_1",                    o(NV_vertex_program1_1),                    GL             },
index 4f83e2e55c266b6d97a8146efd874b0c203e8a56..5409abaf1a40c736fa8e1f144ee059dc499b1bbf 100644 (file)
@@ -2848,6 +2848,7 @@ struct gl_extensions
    GLboolean NV_light_max_exponent;
    GLboolean NV_point_sprite;
    GLboolean NV_primitive_restart;
+   GLboolean NV_texture_barrier;
    GLboolean NV_texgen_reflection;
    GLboolean NV_texture_env_combine4;
    GLboolean NV_texture_rectangle;
diff --git a/src/mesa/main/texturebarrier.c b/src/mesa/main/texturebarrier.c
new file mode 100644 (file)
index 0000000..56cc871
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright © 2011 Marek Olšák <maraeo@gmail.com>
+ *
+ * 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.
+ */
+
+/**
+ * \file texturebarrier.c
+ * Implementation of glTextureBarrierNV.
+ *
+ * \author Marek Olšák <maraeo@gmail.com>
+ */
+
+#include "context.h"
+#include "texturebarrier.h"
+
+
+static void
+_mesa_texture_barrier(struct gl_context *ctx)
+{
+   /* no-op */
+}
+
+void
+_mesa_init_texture_barrier_functions(struct dd_function_table *driver)
+{
+   driver->TextureBarrier = _mesa_texture_barrier;
+}
+
+void GLAPIENTRY
+_mesa_TextureBarrierNV(void)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+   ctx->Driver.TextureBarrier(ctx);
+}
diff --git a/src/mesa/main/texturebarrier.h b/src/mesa/main/texturebarrier.h
new file mode 100644 (file)
index 0000000..a84a85b
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright © 2011 Marek Olšák <maraeo@gmail.com>
+ *
+ * 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.
+ */
+
+/**
+ * \file texturebarrier.h
+ * GL_NV_texture_barrier
+ *
+ * \author Marek Olšák <maraeo@gmail.com>
+ */
+
+#ifndef TEXTUREBARRIER_H
+#define TEXTUREBARRIER_H
+
+#include "glheader.h"
+
+struct dd_function_table;
+
+extern void
+_mesa_init_texture_barrier_functions(struct dd_function_table *driver);
+
+extern void GLAPIENTRY
+_mesa_TextureBarrierNV(void);
+
+#endif /* TEXTUREBARRIER_H */
index 21e08ed5f36c15f6ae2c1c9f1065963ce809825f..59782cbd05d2cd7191e821a8d7043f6ca686ee10 100644 (file)
@@ -94,6 +94,7 @@ MAIN_SOURCES = \
        main/texrender.c \
        main/texstate.c \
        main/texstore.c \
+       main/texturebarrier.c \
        main/transformfeedback.c \
        main/uniforms.c \
        main/varray.c \