i965: Use brw_nir_cubemap_normalize for NIR shaders
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 3 Apr 2015 00:04:28 +0000 (17:04 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 3 Apr 2015 21:12:49 +0000 (14:12 -0700)
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/mesa/drivers/dri/i965/brw_fs_nir.cpp
src/mesa/drivers/dri/i965/brw_shader.cpp

index 0f1659db1104f2d5173a36b4e18403c28c1c540f..e9692aa5c177bb4752720c42e779ed5ce61c2103 100644 (file)
@@ -104,6 +104,9 @@ fs_visitor::emit_nir_code()
    nir_lower_tex_projector(nir);
    nir_validate_shader(nir);
 
+   nir_normalize_cubemap_coords(nir);
+   nir_validate_shader(nir);
+
    nir_split_var_copies(nir);
    nir_validate_shader(nir);
 
index 0dda9bb823d471698bac2709e3cdc26b1c55bf9f..4ef38829beb35124bf9ff0e99e4e265208edaf38 100644 (file)
@@ -173,7 +173,8 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
       brw_lower_texture_gradients(brw, shader->base.ir);
       do_vec_index_to_cond_assign(shader->base.ir);
       lower_vector_insert(shader->base.ir, true);
-      brw_do_cubemap_normalize(shader->base.ir);
+      if (options->NirOptions == NULL)
+         brw_do_cubemap_normalize(shader->base.ir);
       lower_offset_arrays(shader->base.ir);
       brw_do_lower_unnormalized_offset(shader->base.ir);
       lower_noise(shader->base.ir);