summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2016-05-30 11:49:26 -0400
committerIlia Mirkin <[email protected]>2016-08-30 20:25:15 -0400
commit3b81c998a214a2ad7a4a712577277b1fc7b9be4e (patch)
tree2dd9e9b67b64dbc41b8c62ccd3ee567616f06dc5 /src/mesa
parent5ce0969df2a47cef90cd10d6d95c448d41bc02d5 (diff)
mesa: add scaffolding for OES/EXT_primitive_bounding_box
Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/Makefile.sources2
-rw-r--r--src/mesa/main/bbox.c44
-rw-r--r--src/mesa/main/bbox.h42
-rw-r--r--src/mesa/main/context.c2
-rw-r--r--src/mesa/main/extensions_table.h2
-rw-r--r--src/mesa/main/mtypes.h1
-rw-r--r--src/mesa/main/tests/dispatch_sanity.cpp3
-rw-r--r--src/mesa/main/version.c2
8 files changed, 97 insertions, 1 deletions
diff --git a/src/mesa/Makefile.sources b/src/mesa/Makefile.sources
index f941c966723..363b1339d78 100644
--- a/src/mesa/Makefile.sources
+++ b/src/mesa/Makefile.sources
@@ -26,6 +26,8 @@ MAIN_FILES = \
main/attrib.h \
main/barrier.c \
main/barrier.h \
+ main/bbox.c \
+ main/bbox.h \
main/blend.c \
main/blend.h \
main/blit.c \
diff --git a/src/mesa/main/bbox.c b/src/mesa/main/bbox.c
new file mode 100644
index 00000000000..0ef5705532c
--- /dev/null
+++ b/src/mesa/main/bbox.c
@@ -0,0 +1,44 @@
+/*
+ * Mesa 3-D graphics library
+ *
+ * Copyright (C) 2016 Ilia Mirkin. All Rights Reserved.
+ *
+ * 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 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 bbox.c
+ * glPrimitiveBoundingBox function
+ */
+
+#include "bbox.h"
+#include "context.h"
+
+void GLAPIENTRY
+_mesa_PrimitiveBoundingBox(
+ GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW,
+ GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW)
+{
+}
+
+void
+_mesa_init_bbox(struct gl_context *ctx)
+{
+}
diff --git a/src/mesa/main/bbox.h b/src/mesa/main/bbox.h
new file mode 100644
index 00000000000..d00f87ea93f
--- /dev/null
+++ b/src/mesa/main/bbox.h
@@ -0,0 +1,42 @@
+/*
+ * Mesa 3-D graphics library
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
+ *
+ * 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 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.
+ */
+
+
+#ifndef BBOX_H
+#define BBOX_H
+
+#include "glheader.h"
+
+struct gl_context;
+
+extern void GLAPIENTRY
+_mesa_PrimitiveBoundingBox(
+ GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW,
+ GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW);
+
+extern void
+_mesa_init_bbox(struct gl_context *ctx);
+
+#endif
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 8f9bbf1b732..f550b0c556d 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -83,6 +83,7 @@
#include "api_loopback.h"
#include "arrayobj.h"
#include "attrib.h"
+#include "bbox.h"
#include "blend.h"
#include "buffers.h"
#include "bufferobj.h"
@@ -809,6 +810,7 @@ init_attrib_groups(struct gl_context *ctx)
/* Attribute Groups */
_mesa_init_accum( ctx );
_mesa_init_attrib( ctx );
+ _mesa_init_bbox( ctx );
_mesa_init_buffer_objects( ctx );
_mesa_init_color( ctx );
_mesa_init_current( ctx );
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index 5d66cae873c..75cdcb8665e 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -223,6 +223,7 @@ EXT(EXT_pixel_buffer_object , EXT_pixel_buffer_object
EXT(EXT_point_parameters , EXT_point_parameters , GLL, x , x , x , 1997)
EXT(EXT_polygon_offset , dummy_true , GLL, x , x , x , 1995)
EXT(EXT_polygon_offset_clamp , EXT_polygon_offset_clamp , GLL, GLC, ES1, ES2, 2014)
+EXT(EXT_primitive_bounding_box , OES_primitive_bounding_box , x , x , x , 31, 2014)
EXT(EXT_provoking_vertex , EXT_provoking_vertex , GLL, GLC, x , x , 2009)
EXT(EXT_read_format_bgra , dummy_true , x , x , ES1, ES2, 2009)
EXT(EXT_rescale_normal , dummy_true , GLL, x , x , x , 1997)
@@ -352,6 +353,7 @@ EXT(OES_mapbuffer , dummy_true
EXT(OES_packed_depth_stencil , dummy_true , x , x , ES1, ES2, 2007)
EXT(OES_point_size_array , dummy_true , x , x , ES1, x , 2004)
EXT(OES_point_sprite , ARB_point_sprite , x , x , ES1, x , 2004)
+EXT(OES_primitive_bounding_box , OES_primitive_bounding_box , x , x , x , 31, 2014)
EXT(OES_query_matrix , dummy_true , x , x , ES1, x , 2003)
EXT(OES_read_format , dummy_true , GLL, GLC, ES1, x , 2003)
EXT(OES_rgb8_rgba8 , dummy_true , x , x , ES1, ES2, 2005)
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 09b84f148a7..c7ed1b3cfd4 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3941,6 +3941,7 @@ struct gl_extensions
GLboolean EXT_vertex_array_bgra;
GLboolean EXT_window_rectangles;
GLboolean OES_copy_image;
+ GLboolean OES_primitive_bounding_box;
GLboolean OES_sample_variables;
GLboolean OES_standard_derivatives;
GLboolean OES_texture_buffer;
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index c0db287a028..42fe61aed43 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -2607,5 +2607,8 @@ const struct function gles31_functions_possible[] = {
/* GL_OES_tessellation_shader */
{ "glPatchParameteriOES", 31, -1 },
+ /* GL_OES_primitive_bound_box */
+ { "glPrimitiveBoundingBoxOES", 31, -1 },
+
{ NULL, 0, -1 },
};
diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c
index 0df7f8ac16e..cfc1638d63b 100644
--- a/src/mesa/main/version.c
+++ b/src/mesa/main/version.c
@@ -536,7 +536,7 @@ compute_version_es2(const struct gl_extensions *extensions,
extensions->ARB_draw_buffers_blend &&
extensions->ARB_draw_elements_base_vertex &&
extensions->OES_geometry_shader &&
- /*extensions->OES_primitive_bounding_box*/ false &&
+ extensions->OES_primitive_bounding_box &&
extensions->OES_sample_variables &&
extensions->ARB_tessellation_shader &&
extensions->ARB_texture_border_clamp &&