i965: Enable MESA_shader_integer_functions on all GLSL 1.30 platforms
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 23 Jun 2016 23:19:45 +0000 (16:19 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 19 Jul 2016 19:19:29 +0000 (12:19 -0700)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_link.cpp
src/mesa/drivers/dri/i965/intel_extensions.c

index b2664b8b6ea6f3268db43ea2035612d4e412d4c5..a77df50c7c4cdc24c3731497a3389d99ba49ef69 100644 (file)
@@ -106,12 +106,20 @@ process_glsl_ir(gl_shader_stage stage,
     */
    brw_lower_packing_builtins(brw, shader->Stage, shader->ir);
    do_mat_op_to_vec(shader->ir);
-   lower_instructions(shader->ir,
-                      DIV_TO_MUL_RCP |
-                      SUB_TO_ADD_NEG |
-                      EXP_TO_EXP2 |
-                      LOG_TO_LOG2 |
-                      DFREXP_DLDEXP_TO_ARITH);
+
+   unsigned instructions_to_lower = (DIV_TO_MUL_RCP |
+                                     SUB_TO_ADD_NEG |
+                                     EXP_TO_EXP2 |
+                                     LOG_TO_LOG2 |
+                                     DFREXP_DLDEXP_TO_ARITH);
+   if (brw->gen < 7) {
+      instructions_to_lower |= BIT_COUNT_TO_MATH |
+                               EXTRACT_TO_SHIFTS |
+                               INSERT_TO_SHIFTS |
+                               REVERSE_TO_SHIFTS;
+   }
+
+   lower_instructions(shader->ir, instructions_to_lower);
 
    /* Pre-gen6 HW can only nest if-statements 16 deep.  Beyond this,
     * if-statements need to be flattened.
index cf383bcaae466f4b08622c949695fa8458e05f65..5ebcba20e298b9e4e2b4b86dcb8ab9cc145bcff3 100644 (file)
@@ -278,6 +278,7 @@ intelInitExtensions(struct gl_context *ctx)
    _mesa_override_glsl_version(&ctx->Const);
 
    ctx->Extensions.EXT_shader_integer_mix = ctx->Const.GLSLVersion >= 130;
+   ctx->Extensions.MESA_shader_integer_functions = ctx->Const.GLSLVersion >= 130;
 
    if (brw->gen >= 5) {
       ctx->Extensions.ARB_texture_query_levels = ctx->Const.GLSLVersion >= 130;