OSDN Git Service

mesa: Expose texel offset limits in GLES3.
[android-x86/external-mesa.git] / src / mesa / main / get.c
index adb7bd2..223d885 100644 (file)
@@ -36,6 +36,7 @@
 #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
@@ -293,8 +295,9 @@ static const int extra_EXT_texture_integer_and_new_buffers[] = {
    EXTRA_END
 };
 
-static const int extra_GLSL_130[] = {
+static const int extra_GLSL_130_es3[] = {
    EXTRA_GLSL_130,
+   EXTRA_API_ES3,
    EXTRA_END
 };
 
@@ -312,8 +315,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
 };
 
@@ -675,7 +677,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];
@@ -985,6 +990,11 @@ check_extra(struct gl_context *ctx, const char *func, const struct value_desc *d
          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 */