st/mesa: get max supported number of image samples from driver
authorIlia Mirkin <imirkin@alum.mit.edu>
Wed, 29 Jun 2016 04:11:57 +0000 (00:11 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sat, 2 Jul 2016 03:01:03 +0000 (23:01 -0400)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_extensions.c

index 412f598ca6222cf430067c77138864ba4ade820c..c5ecd5a2dd7f8dddeffa05a8b203fa918edc6b67 100644 (file)
@@ -443,7 +443,6 @@ void st_init_limits(struct pipe_screen *screen,
          c->Program[MESA_SHADER_COMPUTE].MaxImageUniforms;
    c->MaxCombinedShaderOutputResources += c->MaxCombinedImageUniforms;
    c->MaxImageUnits = MAX_IMAGE_UNITS;
-   c->MaxImageSamples = 0; /* XXX */
    if (c->MaxCombinedImageUniforms) {
       extensions->ARB_shader_image_load_store = GL_TRUE;
       extensions->ARB_shader_image_size = GL_TRUE;
@@ -988,6 +987,11 @@ void st_init_extensions(struct pipe_screen *screen,
                                      color_formats, 16,
                                      PIPE_BIND_RENDER_TARGET);
 
+      consts->MaxImageSamples =
+         get_max_samples_for_formats(screen, ARRAY_SIZE(color_formats),
+                                     color_formats, 16,
+                                     PIPE_BIND_SHADER_IMAGE);
+
       consts->MaxColorTextureSamples =
          get_max_samples_for_formats(screen, ARRAY_SIZE(color_formats),
                                      color_formats, consts->MaxSamples,