diff options
author | Jason Ekstrand <[email protected]> | 2015-09-10 11:08:15 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-09-15 12:38:48 -0700 |
commit | a88ce0c1c4c1f77209b71d5a6858f952642f385a (patch) | |
tree | 3ba7d213c35addc05de9be05cfa0e1d6a641c83a /src/mesa/drivers/dri/i965/brw_shader.cpp | |
parent | 47739c7df430664c3a998163a1e8a4a5e1901691 (diff) |
i965/vec4: Use the replicated fdot instruction in NIR
Reviewed-by: Connor Abbott <[email protected]>
Reviewed-by: Eduardo Lima Mitev <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_shader.cpp')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_shader.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp index cf9aa232386..eed73fbadc3 100644 --- a/src/mesa/drivers/dri/i965/brw_shader.cpp +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp @@ -96,6 +96,14 @@ brw_compiler_create(void *mem_ctx, const struct brw_device_info *devinfo) */ nir_options->lower_ffma = true; nir_options->lower_sub = true; + /* In the vec4 backend, our dpN instruction replicates its result to all + * the components of a vec4. We would like NIR to give us replicated fdot + * instructions because it can optimize better for us. + * + * For the FS backend, it should be lowered away by the scalarizing pass so + * we should never see fdot anyway. + */ + nir_options->fdot_replicates = true; /* We want the GLSL compiler to emit code that uses condition codes */ for (int i = 0; i < MESA_SHADER_STAGES; i++) { |