On 31.01.2016 15:11, Ilia Mirkin wrote:
This seems odd. When would this not just be MaxArrayTextureLayers? IMO
a plain enable cap, like PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENTS makes
more sense here.

From the GL_ARB_framebuffer_no_attachments spec overview:

Additionally, this extension provides queryable implementation-dependent maximums for framebuffer width, height, layer count, and sample count, which may differ from similar limits on textures and renderbuffers. These maximums will be used to error-check the default framebuffer parameters and also permit implementations to expose the ability to rasterize to an attachment-less framebuffer larger than the maximum supported texture size.

So having a Gallium cap that corresponds to GL_MAX_FRAMEBUFFER_LAYERS is not entirely silly. One could even argue that there should be caps for the other MAX_FRAMEBUFFER_* values as well...

Cheers,
Nicolai

On Sun, Jan 31, 2016 at 1:25 AM, Edward O'Callaghan
<eocallag...@alterapraxis.com> wrote:
diff --git a/src/mesa/state_tracker/st_extensions.c 
b/src/mesa/state_tracker/st_extensions.c
index d066784..99105bd 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -490,6 +490,7 @@ void st_init_extensions(struct pipe_screen *screen,
        { o(ARB_fragment_program_shadow),      PIPE_CAP_TEXTURE_SHADOW_MAP      
         },
        { o(ARB_framebuffer_object),           PIPE_CAP_MIXED_FRAMEBUFFER_SIZES 
         },
        { o(ARB_indirect_parameters),          
PIPE_CAP_MULTI_DRAW_INDIRECT_PARAMS       },
+      { o(ARB_framebuffer_no_attachments),   PIPE_CAP_MAX_FRAMEBUFFER_LAYERS   
        },
        { o(ARB_instanced_arrays),             
PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR  },
        { o(ARB_occlusion_query),              PIPE_CAP_OCCLUSION_QUERY         
         },
        { o(ARB_occlusion_query2),             PIPE_CAP_OCCLUSION_QUERY         
         },
@@ -962,6 +963,18 @@ void st_init_extensions(struct pipe_screen *screen,
           extensions->AMD_vertex_shader_viewport_index = GL_TRUE;
     }

+   /* ARB_framebuffer_no_attachments */
+   consts->MaxFramebufferWidth   = consts->MaxViewportWidth;
+   consts->MaxFramebufferHeight  = consts->MaxViewportHeight;
+   consts->MaxFramebufferSamples = consts->MaxSamples;
+   consts->MaxFramebufferLayers
+      = screen->get_param(screen, PIPE_CAP_MAX_FRAMEBUFFER_LAYERS);
+   if ((consts->MaxSamples >= 4 && consts->MaxFramebufferLayers >= 2048)
+      || (consts->MaxFramebufferSamples >= consts->MaxSamples &&
+          consts->MaxFramebufferLayers  >= consts->MaxArrayTextureLayers))
+      extensions->ARB_framebuffer_no_attachments = GL_TRUE;

You don't want both of these... either you want to just enable the ext
when the cap is on, or you want to enable the ext under certain more
complex conditions.

   -ilia
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to