aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/get.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-06-04 09:07:26 +0200
committermarha <marha@users.sourceforge.net>2013-06-04 09:07:26 +0200
commit150771e7aabf4c864b0b970c5b8d773634793abe (patch)
tree3d544cc0d8d06dd70e843d6ca7e4b0ef421d2758 /mesalib/src/mesa/main/get.c
parentfbe681216618af573ce29ca03b382b39b5919a52 (diff)
downloadvcxsrv-150771e7aabf4c864b0b970c5b8d773634793abe.tar.gz
vcxsrv-150771e7aabf4c864b0b970c5b8d773634793abe.tar.bz2
vcxsrv-150771e7aabf4c864b0b970c5b8d773634793abe.zip
xwininfo fontconfig libX11 libXau libXdmcp libXext mesa libXinerama libxcb libxcb/xcb-proto libfontenc pixman xkbcomp mkfontscale xkeyboard-config git update 4 Jun 2013
xserver commit c21344add2fc589df83b29be5831c36a372201bd libxcb commit 9ae84ad187e2ba440c40f44b8eb21c82c2fdbf12 libxcb/xcb-proto commit bdfedfa57a13ff805580cfacafc70f9cc55df363 xkeyboard-config commit dad9ade4e83d1ef5a517fcc4cc9ad3a79b47acce libX11 commit 8496122eb00ce6cd5d2308ee54f64b68c378e455 libXdmcp commit 0b443c1b769b9c9a3b45b4252afe07e18b709ff4 libXext commit d8366afbb0d2e4fbb1e419b1187f490522270bea libfontenc commit 3acba630d8b57084f7e92c15732408711ed5137a libXinerama commit 6e1d1dc328ba8162bba2f4694e7f3c706a1491ff libXau commit 899790011304c4029e15abf410e49ce7cec17e0a xkbcomp commit ed582f4fccd4e23abcfba8b3b03649fea6414f44 pixman commit 2acfac5f8e097ee2ae225d986f981b55d65dd152 mkfontscale commit 19e2cb7c6a3ec2c5b1bc0d24866fa685eef0ee13 xwininfo commit ba0d1b0da21d2dbdd81098ed5778f3792b472e13 fontconfig commit cd9b1033a68816a7acfbba1718ba0aa5888f6ec7 mesa commit 7bafd88c153e395274b632e7eae4bc9fc3aec1d2
Diffstat (limited to 'mesalib/src/mesa/main/get.c')
-rw-r--r--mesalib/src/mesa/main/get.c123
1 files changed, 74 insertions, 49 deletions
diff --git a/mesalib/src/mesa/main/get.c b/mesalib/src/mesa/main/get.c
index 2ba868c0d..593c75be2 100644
--- a/mesalib/src/mesa/main/get.c
+++ b/mesalib/src/mesa/main/get.c
@@ -15,9 +15,10 @@
* 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
- * BRIAN PAUL 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.
+ * 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.
*
* Author: Kristian Høgsberg <krh@bitplanet.net>
*/
@@ -30,12 +31,12 @@
#include "extensions.h"
#include "get.h"
#include "macros.h"
-#include "mfeatures.h"
#include "mtypes.h"
#include "state.h"
#include "texcompress.h"
#include "framebuffer.h"
#include "samplerobj.h"
+#include "stencil.h"
/* This is a table driven implemetation of the glGet*v() functions.
* The basic idea is that most getters just look up an int somewhere
@@ -141,6 +142,7 @@ enum value_extra {
EXTRA_VALID_CLIP_DISTANCE,
EXTRA_FLUSH_CURRENT,
EXTRA_GLSL_130,
+ EXTRA_EXT_UBO_GS4,
};
#define NO_EXTRA NULL
@@ -226,7 +228,13 @@ union value {
* extensions or specific gl versions) or actions (flush current, new
* buffers) that we need to do before looking up an enum. We need to
* declare them all up front so we can refer to them in the value_desc
- * structs below. */
+ * structs below.
+ *
+ * Each EXTRA_ will be executed. For EXTRA_* enums of extensions and API
+ * versions, listing multiple ones in an array means an error will be thrown
+ * only if none of them are available. If you need to check for "AND"
+ * behavior, you would need to make a custom EXTRA_ enum.
+ */
static const int extra_new_buffers[] = {
EXTRA_NEW_BUFFERS,
@@ -281,6 +289,12 @@ static const int extra_EXT_texture_integer[] = {
EXTRA_END
};
+static const int extra_EXT_texture_integer_and_new_buffers[] = {
+ EXT(EXT_texture_integer),
+ EXTRA_NEW_BUFFERS,
+ EXTRA_END
+};
+
static const int extra_GLSL_130[] = {
EXTRA_GLSL_130,
EXTRA_END
@@ -300,8 +314,7 @@ static const int extra_ARB_transform_feedback2_api_es3[] = {
};
static const int extra_ARB_uniform_buffer_object_and_geometry_shader[] = {
- EXT(ARB_uniform_buffer_object),
- EXT(ARB_geometry_shader4),
+ EXTRA_EXT_UBO_GS4,
EXTRA_END
};
@@ -317,6 +330,12 @@ static const int extra_ARB_ES3_compatibility_api_es3[] = {
EXTRA_END
};
+static const int extra_EXT_framebuffer_sRGB_and_new_buffers[] = {
+ EXT(EXT_framebuffer_sRGB),
+ EXTRA_NEW_BUFFERS,
+ EXTRA_END
+};
+
EXTRA_EXT(ARB_texture_cube_map);
EXTRA_EXT(MESA_texture_array);
EXTRA_EXT2(EXT_secondary_color, ARB_vertex_program);
@@ -397,6 +416,13 @@ extra_NV_read_buffer_api_gl[] = {
EXTRA_END
};
+static const int extra_core_ARB_color_buffer_float_and_new_buffers[] = {
+ EXTRA_API_GL_CORE,
+ EXT(ARB_color_buffer_float),
+ EXTRA_NEW_BUFFERS,
+ EXTRA_END
+};
+
/* This is the big table describing all the enums we accept in
* glGet*v(). The table is partitioned into six parts: enums
* understood by all GL APIs (OpenGL, GLES and GLES2), enums shared
@@ -404,8 +430,7 @@ extra_NV_read_buffer_api_gl[] = {
* remaining combinations. To look up the enums valid in a given API
* we will use a hash table specific to that API. These tables are in
* turn generated at build time and included through get_hash.h.
- * The different sections are guarded by #if FEATURE_GL etc to make
- * sure we only compile in the enums we may need. */
+ */
#include "get_hash.h"
@@ -651,7 +676,10 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
v->value_enum = ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace];
break;
case GL_STENCIL_REF:
- v->value_int = ctx->Stencil.Ref[ctx->Stencil.ActiveFace];
+ v->value_int = _mesa_get_stencil_ref(ctx, ctx->Stencil.ActiveFace);
+ break;
+ case GL_STENCIL_BACK_REF:
+ v->value_int = _mesa_get_stencil_ref(ctx, 1);
break;
case GL_STENCIL_VALUE_MASK:
v->value_int = ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace];
@@ -883,58 +911,50 @@ static GLboolean
check_extra(struct gl_context *ctx, const char *func, const struct value_desc *d)
{
const GLuint version = ctx->Version;
- int total, enabled;
+ GLboolean api_check = GL_FALSE;
+ GLboolean api_found = GL_FALSE;
const int *e;
- total = 0;
- enabled = 0;
- for (e = d->extra; *e != EXTRA_END; e++)
+ for (e = d->extra; *e != EXTRA_END; e++) {
switch (*e) {
case EXTRA_VERSION_30:
- if (version >= 30) {
- total++;
- enabled++;
- }
+ api_check = GL_TRUE;
+ if (version >= 30)
+ api_found = GL_TRUE;
break;
case EXTRA_VERSION_31:
- if (version >= 31) {
- total++;
- enabled++;
- }
+ api_check = GL_TRUE;
+ if (version >= 31)
+ api_found = GL_TRUE;
break;
case EXTRA_VERSION_32:
- if (version >= 32) {
- total++;
- enabled++;
- }
+ api_check = GL_TRUE;
+ if (version >= 32)
+ api_found = GL_TRUE;
break;
case EXTRA_NEW_FRAG_CLAMP:
if (ctx->NewState & (_NEW_BUFFERS | _NEW_FRAG_CLAMP))
_mesa_update_state(ctx);
break;
case EXTRA_API_ES2:
- if (ctx->API == API_OPENGLES2) {
- total++;
- enabled++;
- }
+ api_check = GL_TRUE;
+ if (ctx->API == API_OPENGLES2)
+ api_found = GL_TRUE;
break;
case EXTRA_API_ES3:
- if (_mesa_is_gles3(ctx)) {
- total++;
- enabled++;
- }
+ api_check = GL_TRUE;
+ if (_mesa_is_gles3(ctx))
+ api_found = GL_TRUE;
break;
case EXTRA_API_GL:
- if (_mesa_is_desktop_gl(ctx)) {
- total++;
- enabled++;
- }
+ api_check = GL_TRUE;
+ if (_mesa_is_desktop_gl(ctx))
+ api_found = GL_TRUE;
break;
case EXTRA_API_GL_CORE:
- if (ctx->API == API_OPENGL_CORE) {
- total++;
- enabled++;
- }
+ api_check = GL_TRUE;
+ if (ctx->API == API_OPENGL_CORE)
+ api_found = GL_TRUE;
break;
case EXTRA_NEW_BUFFERS:
if (ctx->NewState & _NEW_BUFFERS)
@@ -965,21 +985,26 @@ check_extra(struct gl_context *ctx, const char *func, const struct value_desc *d
}
break;
case EXTRA_GLSL_130:
- if (ctx->Const.GLSLVersion >= 130) {
- total++;
- enabled++;
- }
+ api_check = GL_TRUE;
+ if (ctx->Const.GLSLVersion >= 130)
+ api_found = GL_TRUE;
break;
+ case EXTRA_EXT_UBO_GS4:
+ api_check = GL_TRUE;
+ api_found = (ctx->Extensions.ARB_uniform_buffer_object &&
+ ctx->Extensions.ARB_geometry_shader4);
+ break;
case EXTRA_END:
break;
default: /* *e is a offset into the extension struct */
- total++;
+ api_check = GL_TRUE;
if (*(GLboolean *) ((char *) &ctx->Extensions + *e))
- enabled++;
+ api_found = GL_TRUE;
break;
}
+ }
- if (total > 0 && enabled == 0) {
+ if (api_check && !api_found) {
_mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=%s)", func,
_mesa_lookup_enum_by_nr(d->pname));
return GL_FALSE;