intel: Enable GL_ARB_internalformat_query
authorIan Romanick <ian.d.romanick@intel.com>
Sat, 1 Dec 2012 19:06:31 +0000 (11:06 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 16 Jan 2013 05:34:45 +0000 (21:34 -0800)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/intel/intel_extensions.c

index 70657b7d5b408e68eac4b9f5fd997bb5c549315b..7b53360a3817eb791d2a44263437b5692da28cea 100644 (file)
  * Mesa's Driver Functions
  ***************************************/
 
+static size_t
+brw_query_samples_for_format(struct gl_context *ctx, GLenum internalFormat,
+                             int samples[16])
+{
+   struct intel_context *intel = intel_context(ctx);
+
+   switch (intel->gen) {
+   case 7:
+      samples[0] = 8;
+      samples[1] = 4;
+      return 2;
+
+   case 6:
+      samples[0] = 4;
+      return 1;
+
+   default:
+      samples[0] = 1;
+      return 1;
+   }
+}
+
 static void brwInitDriverFunctions(struct intel_screen *screen,
                                   struct dd_function_table *functions)
 {
@@ -66,6 +88,7 @@ static void brwInitDriverFunctions(struct intel_screen *screen,
    brwInitFragProgFuncs( functions );
    brw_init_queryobj_functions(functions);
 
+   functions->QuerySamplesForFormat = brw_query_samples_for_format;
    functions->BeginTransformFeedback = brw_begin_transform_feedback;
 
    if (screen->gen >= 7)
index 5c6b651eccd5a183df068d4e41d4e1e946990171..8d92df2b1a816ea8a1a2944f24009495cadec189 100755 (executable)
@@ -47,6 +47,7 @@ intelInitExtensions(struct gl_context *ctx)
    ctx->Extensions.ARB_explicit_attrib_location = true;
    ctx->Extensions.ARB_framebuffer_object = true;
    ctx->Extensions.ARB_half_float_pixel = true;
+   ctx->Extensions.ARB_internalformat_query = true;
    ctx->Extensions.ARB_map_buffer_range = true;
    ctx->Extensions.ARB_point_sprite = true;
    ctx->Extensions.ARB_shader_objects = true;