diff options
author | Ilia Mirkin <[email protected]> | 2016-02-19 19:08:35 -0500 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2016-02-27 00:08:28 -0500 |
commit | e2dce1a340c89d8c910eb7a632160097389c9735 (patch) | |
tree | 5b7c6ead5be0542c2165b6177614b070097c3985 /src/compiler/glsl/ast_array_index.cpp | |
parent | 2875183463420ba21418d546f844f5bf1f089214 (diff) |
mesa: add GL_OES_gpu_shader5 and GL_EXT_gpu_shader5 support
The two extensions are identical, and are largely taking bits of already
existing desktop functionality. We continue to do a poor job of
supporting the 'precise' keyword, just like we do on desktop.
This passes the relevant dEQP tests that I could find.
Signed-off-by: Ilia Mirkin <[email protected]>
Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
Diffstat (limited to 'src/compiler/glsl/ast_array_index.cpp')
-rw-r--r-- | src/compiler/glsl/ast_array_index.cpp | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/src/compiler/glsl/ast_array_index.cpp b/src/compiler/glsl/ast_array_index.cpp index f5baeb9ea32..69322cf111f 100644 --- a/src/compiler/glsl/ast_array_index.cpp +++ b/src/compiler/glsl/ast_array_index.cpp @@ -236,14 +236,23 @@ _mesa_ast_array_index_to_hir(void *mem_ctx, _mesa_glsl_error(&loc, state, "unsized array index must be constant"); } } else if (array->type->without_array()->is_interface() - && (array->variable_referenced()->data.mode == ir_var_uniform || - array->variable_referenced()->data.mode == ir_var_shader_storage) - && !state->is_version(400, 0) && !state->ARB_gpu_shader5_enable) { - /* Page 50 in section 4.3.9 of the OpenGL ES 3.10 spec says: - * - * "All indices used to index a uniform or shader storage block - * array must be constant integral expressions." - */ + && ((array->variable_referenced()->data.mode == ir_var_uniform + && !state->is_version(400, 320) + && !state->ARB_gpu_shader5_enable + && !state->EXT_gpu_shader5_enable + && !state->OES_gpu_shader5_enable) || + (array->variable_referenced()->data.mode == ir_var_shader_storage + && !state->is_version(400, 0) + && !state->ARB_gpu_shader5_enable))) { + /* Page 50 in section 4.3.9 of the OpenGL ES 3.10 spec says: + * + * "All indices used to index a uniform or shader storage block + * array must be constant integral expressions." + * + * But OES_gpu_shader5 (and ESSL 3.20) relax this to allow indexing + * on uniform blocks but not shader storage blocks. + * + */ _mesa_glsl_error(&loc, state, "%s block array index must be constant", array->variable_referenced()->data.mode == ir_var_uniform ? "uniform" : "shader storage"); @@ -279,7 +288,10 @@ _mesa_ast_array_index_to_hir(void *mem_ctx, * dynamically uniform expression is undefined. */ if (array->type->without_array()->is_sampler()) { - if (!state->is_version(400, 0) && !state->ARB_gpu_shader5_enable) { + if (!state->is_version(400, 320) && + !state->ARB_gpu_shader5_enable && + !state->EXT_gpu_shader5_enable && + !state->OES_gpu_shader5_enable) { if (state->is_version(130, 300)) _mesa_glsl_error(&loc, state, "sampler arrays indexed with non-constant " |