[Mesa-dev] [PATCH 03/17] gallium: Obtain ARB_framebuffer_no_attachment constants

Edward O'Callaghan eocallaghan at alterapraxis.com
Sat Mar 19 06:41:16 UTC 2016


Set default values for the constants required in
ARB_framebuffer_no_attachments and obtained the number
of layers from ``PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS``.

Signed-off-by: Edward O'Callaghan <eocallaghan at alterapraxis.com>
---
 src/mesa/state_tracker/st_extensions.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 840ad40..2975d6d 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -1042,10 +1042,29 @@ 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;
+   /* N.B., we cheat here a little by assuming that
+    * PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS has the same
+    * number of layers as we need, although we technically
+    * could have more the generality is not really useful
+    * in practicality.
+    */
+   consts->MaxFramebufferLayers
+      = screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS);
+
    /* Bitmask of MSAA modes supported by the hardware. */
    consts->MSAAModes
       = screen->get_param(screen, PIPE_CAP_MSAA_MODES);
 
+   if ((consts->MaxSamples >= 4 && consts->MaxFramebufferLayers >= 2048)
+      || (consts->MaxFramebufferSamples >= consts->MaxSamples &&
+          consts->MaxFramebufferLayers  >= consts->MaxArrayTextureLayers))
+      extensions->ARB_framebuffer_no_attachments = GL_TRUE;
+
+
    /* GL_ARB_ES3_compatibility.
     *
     * Assume that ES3 is supported if GLSL 3.30 is supported.
-- 
2.5.0



More information about the mesa-dev mailing list