aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward O'Callaghan <[email protected]>2016-02-17 21:01:57 +1100
committerDave Airlie <[email protected]>2016-04-07 11:56:44 +1000
commit2016e9ffda26aac6a65c363f38afc047b72d3e83 (patch)
treea1bbc8a3f091708d341dfc5ab909ab34ce50e627
parent4bc9130fba2f815cb910536d3d3a253a8c3ed0b9 (diff)
gallium: Obtain ARB_framebuffer_no_attachment constants
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``. We also obtain the MaxFramebufferSamples value using a query back to the driver for PIPE_FORMAT_NONE. V.1: Merge if branch predicates into one branch. Move const init into st_init_limits() [airlied: whitespace fixup] Signed-off-by: Edward O'Callaghan <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
-rw-r--r--src/mesa/state_tracker/st_extensions.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 6c0df8d2a98..287894317df 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -445,6 +445,18 @@ void st_init_limits(struct pipe_screen *screen,
extensions->ARB_shader_image_load_store = GL_TRUE;
extensions->ARB_shader_image_size = GL_TRUE;
}
+
+ /* ARB_framebuffer_no_attachments */
+ c->MaxFramebufferWidth = c->MaxViewportWidth;
+ c->MaxFramebufferHeight = c->MaxViewportHeight;
+ /* NOTE: 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.
+ */
+ c->MaxFramebufferLayers =
+ screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS);
}
@@ -956,6 +968,9 @@ void st_init_extensions(struct pipe_screen *screen,
enum pipe_format int_formats[] = {
PIPE_FORMAT_R8G8B8A8_SINT
};
+ enum pipe_format void_formats[] = {
+ PIPE_FORMAT_NONE
+ };
consts->MaxSamples =
get_max_samples_for_formats(screen, ARRAY_SIZE(color_formats),
@@ -976,6 +991,12 @@ void st_init_extensions(struct pipe_screen *screen,
get_max_samples_for_formats(screen, ARRAY_SIZE(int_formats),
int_formats, consts->MaxSamples,
PIPE_BIND_SAMPLER_VIEW);
+
+ /* ARB_framebuffer_no_attachments, assume max no. of samples 32 */
+ consts->MaxFramebufferSamples =
+ get_max_samples_for_formats(screen, ARRAY_SIZE(void_formats),
+ void_formats, 32,
+ PIPE_BIND_RENDER_TARGET);
}
if (consts->MaxSamples == 1) {
/* one sample doesn't really make sense */
@@ -1068,6 +1089,13 @@ void st_init_extensions(struct pipe_screen *screen,
extensions->AMD_vertex_shader_viewport_index = GL_TRUE;
}
+ /* ARB_framebuffer_no_attachments */
+ if (screen->get_param(screen, PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT) &&
+ ((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.