diff options
author | Ian Romanick <[email protected]> | 2016-06-24 01:58:18 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2016-07-19 12:19:30 -0700 |
commit | 94296be276bf9c0a574df262b5d45f1bf38918ff (patch) | |
tree | 49022dacedc9005d23c4d680158a3347dc2f1f02 | |
parent | 7cb49b1bd7f15d53e08d3716e9a835c42dc11c09 (diff) |
st/mesa: Enable MESA_shader_integer_functions on all GLSL 1.30 platforms
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
-rw-r--r-- | src/mesa/state_tracker/st_extensions.c | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 16 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 3d27ca3a905..d2ecc7fa593 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -910,6 +910,7 @@ void st_init_extensions(struct pipe_screen *screen, extensions->EXT_shader_integer_mix = GL_TRUE; extensions->ARB_arrays_of_arrays = GL_TRUE; + extensions->MESA_shader_integer_functions = GL_TRUE; } else { /* Optional integer support for GLSL 1.2. */ if (screen->get_shader_param(screen, PIPE_SHADER_VERTEX, diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 0b7feb79714..7564119ac11 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -6761,7 +6761,21 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) (have_dround ? 0 : DOPS_TO_DFRAC) | (options->EmitNoPow ? POW_TO_EXP2 : 0) | (!ctx->Const.NativeIntegers ? INT_DIV_TO_MUL_RCP : 0) | - (options->EmitNoSat ? SAT_TO_CLAMP : 0)); + (options->EmitNoSat ? SAT_TO_CLAMP : 0) | + /* Assume that if ARB_gpu_shader5 is not supported + * then all of the extended integer functions need + * lowering. It may be necessary to add some caps + * for individual instructions. + */ + (!ctx->Extensions.ARB_gpu_shader5 + ? BIT_COUNT_TO_MATH | + EXTRACT_TO_SHIFTS | + INSERT_TO_SHIFTS | + REVERSE_TO_SHIFTS | + FIND_LSB_TO_FLOAT_CAST | + FIND_MSB_TO_FLOAT_CAST | + IMUL_HIGH_TO_MUL + : 0)); do_vec_index_to_cond_assign(ir); lower_vector_insert(ir, true); |