diff options
author | Ilia Mirkin <[email protected]> | 2016-01-08 23:01:01 -0500 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2016-02-15 22:22:33 -0500 |
commit | 1edbe0157d72c7ec6374e25ecfd8af895a54ac0c (patch) | |
tree | 5c8b1f6f6dad3f5cfadd49278e76d7fb6d18d44c /src/mesa | |
parent | 2e0a84208b632021d41edccc1dc2e858e62c13f6 (diff) |
st/mesa: enable GL image extensions when backend supports them
This enables ARB_shader_image_load_store and ARB_shader_image_size when
the backend claims support for these. It will also implicitly enable the
image component of ARB_shader_texture_image_samples.
Signed-off-by: Ilia Mirkin <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/state_tracker/st_extensions.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index bdfbded9ac6..57eeed66639 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -226,6 +226,9 @@ void st_init_limits(struct pipe_screen *screen, screen, sh, PIPE_SHADER_CAP_MAX_SHADER_BUFFERS) / 2; pc->MaxShaderStorageBlocks = pc->MaxAtomicBuffers; + pc->MaxImageUniforms = screen->get_shader_param( + screen, sh, PIPE_SHADER_CAP_MAX_SHADER_IMAGES); + /* Gallium doesn't really care about local vs. env parameters so use the * same limits. */ @@ -371,6 +374,20 @@ void st_init_limits(struct pipe_screen *screen, c->MaxShaderStorageBlockSize = 1 << 27; extensions->ARB_shader_storage_buffer_object = GL_TRUE; } + + c->MaxCombinedImageUniforms = + c->Program[MESA_SHADER_VERTEX].MaxImageUniforms + + c->Program[MESA_SHADER_TESS_CTRL].MaxImageUniforms + + c->Program[MESA_SHADER_TESS_EVAL].MaxImageUniforms + + c->Program[MESA_SHADER_GEOMETRY].MaxImageUniforms + + c->Program[MESA_SHADER_FRAGMENT].MaxImageUniforms + + c->Program[MESA_SHADER_COMPUTE].MaxImageUniforms; + 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; + } } |