Re: [Mesa-dev] [PATCH v2] mesa: Initializes the stencil value masks to 0xFF instead of ~0u

2014-12-15 Thread Eduardo Lima Mitev
On 12/15/2014 08:30 PM, Ian Romanick wrote: > On 12/15/2014 08:04 AM, Eduardo Lima Mitev wrote: >> >> Since the maximum supported precision for stencil buffers is 8 bits, mask >> values should be initialized to 2^8 - 1 = 0xFF. >> >> Currently, these masks are initialized to max unsigned integer (~0

[Mesa-dev] [Bug 86944] glsl_parser_extras.cpp", line 1455: Error: Badly formed expression.

2014-12-15 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=86944 José Fonseca changed: What|Removed |Added Assignee|mesa-dev@lists.freedesktop. |jfons...@vmware.com |or

Re: [Mesa-dev] [PATCH 01/11] mesa: put extern "C" in header files

2014-12-15 Thread Anuj Phogat
On Tue, Dec 16, 2014 at 5:50 AM, Brian Paul wrote: > --- > src/mesa/main/enums.h | 11 +++ > src/mesa/main/samplerobj.h| 9 + > src/mesa/main/texenvprogram.h | 11 +++ > src/mesa/main/texobj.h| 10 ++ > 4 files changed, 41 insertions(+) > > dif

Re: [Mesa-dev] [PATCH v3 09/28] mesa: Add RGBA to Luminance conversion helpers

2014-12-15 Thread Iago Toral
On Mon, 2014-12-15 at 10:19 -0800, Jason Ekstrand wrote: > > > On Mon, Dec 15, 2014 at 3:12 AM, Iago Toral wrote: > On Fri, 2014-12-12 at 11:36 -0800, Jason Ekstrand wrote: > > > > > > On Tue, Dec 9, 2014 at 4:07 AM, Iago Toral Quiroga > > > wrote

[Mesa-dev] [PATCH 130/133] nir/lower_system_values: Handle SSA destinations

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir_lower_system_values.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/glsl/nir/nir_lower_system_values.c b/src/glsl/nir/nir_lower_system_values.c index 7bb02a7..d1b4d26 100644 --- a/src/glsl/nir/nir_lower_system_values.c +++ b/src/glsl/

[Mesa-dev] [PATCH 129/133] nir/lower_atomics: Use/support SSA

2014-12-15 Thread Jason Ekstrand
Previously, lower_atomics was non-SSA only. We assert-failed if the destination of an atomic operation intrinsic was an SSA def and we used temporary registers for computing offsets. This commit changes both of these behaviors. We now use SSA values for computing offsets (so we can optimize them

[Mesa-dev] [PATCH 133/133] nir: Make load_const SSA-only

2014-12-15 Thread Jason Ekstrand
As it was, we weren't ever using load_const in a non-SSA way. This allows us to substantially simplify the load_const instruction. If we ever need a non-SSA constant load, we can do a load_const and an imov. --- src/glsl/nir/glsl_to_nir.cpp | 12 ++-- src/glsl/nir/nir.c

[Mesa-dev] [PATCH 114/133] nir: Remove the ffma peephole

2014-12-15 Thread Jason Ekstrand
This is no longer needed because it's now part of the algebraic optimization pass --- src/glsl/Makefile.sources| 1 - src/glsl/nir/nir_opt_peephole_ffma.c | 189 --- 2 files changed, 190 deletions(-) delete mode 100644 src/glsl/nir/nir_opt_peephole_ff

[Mesa-dev] [PATCH 123/133] nir: Make bcsel a fully vector operation

2014-12-15 Thread Jason Ekstrand
Previously, the condition was a scalar that applied to all components simultaneously. As of this commit, the condition is a vector and each component is switched seperately. --- src/glsl/nir/nir_lower_variables.c | 1 + src/glsl/nir/nir_opcodes.h | 5 ++--- src/glsl/nir/nir_

[Mesa-dev] [PATCH 117/133] nir: Use a source for uniform buffer indices instead of an index

2014-12-15 Thread Jason Ekstrand
In GLSL-to-NIR we were just setting the base index to 0 whenever there was an indirect so having it expressed as a sum makes no sense. Also, while a base offset may make sense for the memory location (first element in the array, etc.) it makes less sense for the actual uniform buffer index. This

[Mesa-dev] [PATCH 118/133] nir: Add a sampler index indirect to nir_tex_instr

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir.c | 11 +++ src/glsl/nir/nir.h | 10 ++ src/glsl/nir/nir_print.c| 4 src/glsl/nir/nir_validate.c | 3 +++ 4 files changed, 28 insertions(+) diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index 60c9cff..8bcc64a 100644 --- a/sr

[Mesa-dev] [PATCH 132/133] nir: Make nir_ssa_undef_instr_create take a number of components

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir.c | 5 ++--- src/glsl/nir/nir.h | 3 ++- src/glsl/nir/nir_lower_variables.c | 11 +-- src/glsl/nir/nir_to_ssa.c | 5 ++--- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir

[Mesa-dev] [PATCH 124/133] nir: Remove predication

2014-12-15 Thread Jason Ekstrand
We stopped generating predicates in glsl_to_nir some time ago. Right now, it's all dead untested code that I'm not convinced always worked in the first place. If we decide we want them back, we can revert this patch. --- src/glsl/nir/nir.c | 35 - src/glsl/nir/nir.

[Mesa-dev] [PATCH 131/133] i965/nir: Move the other lowering passes to before out-of-SSA

2014-12-15 Thread Jason Ekstrand
--- src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index 060912e..2cf9780 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp +++ b/src/

[Mesa-dev] [PATCH 125/133] nir/lower_variables: Use a real dominance DFS for variable renaming

2014-12-15 Thread Jason Ekstrand
Previously, we were just iterating over the program "in order" which kind-of approximates a DFS, but not really. In particular, we got the following case wrong: loop { a = 3; if (foo) { a = 5; } else { break; } use(a); } where use(a) would get 3 instead of 5 because of

[Mesa-dev] [PATCH 115/133] nir: Make texture instruction names more consistent

2014-12-15 Thread Jason Ekstrand
This commit renames nir_instr_as_texture to nir_instr_as_tex and renames nir_instr_type_texture to nir_instr_type_tex to be consistent with nir_tex_instr. --- src/glsl/nir/glsl_to_nir.cpp | 4 ++-- src/glsl/nir/nir.c | 10 +- src/glsl/nir/nir.h

[Mesa-dev] [PATCH 127/133] nir: Use nir_foreach_ssa_def for setting up ssa destinations

2014-12-15 Thread Jason Ekstrand
Before, we were using foreach_dest and switching on whether the destination was an SSA value. This works, except not all destinations are SSA values so we have to special-case ssa_undef instructions. Now that we have a foreach_ssa_def function, we can iterate over all of the register destinations

[Mesa-dev] [PATCH 111/133] nir: Add infastructure for generating algebraic transformation passes

2014-12-15 Thread Jason Ekstrand
This commit builds on the nir_search.h infastructure by adds a bit of python code that makes it stupid easy to write an algebraic transformation pass. The nir_algebraic.py file contains four python classes that correspond directly to the datastructures in nir_search.c and allow you to easily gener

[Mesa-dev] [PATCH 122/133] nir: Call nir_metadata_preserve more places

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir_from_ssa.c | 3 +++ src/glsl/nir/nir_lower_atomics.c| 5 - src/glsl/nir/nir_lower_io.c | 3 +++ src/glsl/nir/nir_lower_locals_to_regs.c | 3 +++ src/glsl/nir/nir_lower_system_values.c | 2 ++ src/glsl/nir/nir_opt_constant_folding.c | 4

[Mesa-dev] [PATCH 128/133] nir/live_variables: Use the new ssa_def iterator

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir_live_variables.c | 32 +--- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/src/glsl/nir/nir_live_variables.c b/src/glsl/nir/nir_live_variables.c index 7d99a06..13306b3 100644 --- a/src/glsl/nir/nir_live_variables.c +++ b/src/glsl/n

[Mesa-dev] [PATCH 116/133] nir: Constant fold array indirects

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir_opt_constant_folding.c | 84 + 1 file changed, 76 insertions(+), 8 deletions(-) diff --git a/src/glsl/nir/nir_opt_constant_folding.c b/src/glsl/nir/nir_opt_constant_folding.c index 3523713..e2b16e9 100644 --- a/src/glsl/nir/nir_opt_constant_fo

[Mesa-dev] [PATCH 107/133] nir: Add a lowering pass for adding source modifiers where possible

2014-12-15 Thread Jason Ekstrand
--- src/glsl/Makefile.sources| 1 + src/glsl/nir/nir.h | 1 + src/glsl/nir/nir_lower_to_source_mods.c | 181 +++ src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 5 + 4 files changed, 188 insertions(+) create mode 100644 src/glsl/

[Mesa-dev] [PATCH 105/133] i965/fs_nir: Implement the ARB_gpu_shader5 interpolation intrinsics

2014-12-15 Thread Jason Ekstrand
--- src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 102 +++ 1 file changed, 102 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index 46d855d..67714ec 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp +++

[Mesa-dev] [PATCH 112/133] nir: Add an algebraic optimization pass

2014-12-15 Thread Jason Ekstrand
This pass uses the previously built algebraic transformations framework and should act as an example for anyone else wanting to make an algebraic transformation pass for NIR. --- src/glsl/Makefile.am | 10 - src/glsl/Makefile.sources| 6 ++- src/glsl/nir/ni

[Mesa-dev] [PATCH 126/133] nir: Add a foreach_ssa_def function

2014-12-15 Thread Jason Ekstrand
There are some functions whose destinations are SSA-only and so aren't a nir_dest. This provides a function that is capable of iterating over the SSA definitions defined by those functions. If you want registers, you should use the old iterator. --- src/glsl/nir/nir.c | 41 ++

[Mesa-dev] [PATCH 119/133] nir: Rework the way samplers are lowered

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir_lower_samplers.cpp | 149 ++-- 1 file changed, 74 insertions(+), 75 deletions(-) diff --git a/src/glsl/nir/nir_lower_samplers.cpp b/src/glsl/nir/nir_lower_samplers.cpp index d94183c..ece4dc3 100644 --- a/src/glsl/nir/nir_lower_samplers.cpp +++

[Mesa-dev] [PATCH 121/133] nir/metadata: Rename metadata_dirty to metadata_preserve

2014-12-15 Thread Jason Ekstrand
nir_metadata_dirty was a terrible name because the parameter it takes is the metadata to be preserved. This is really confusing because it looks like it's doing the opposite of what it is actually doing. Now it's named sensibly. --- src/glsl/nir/nir.c | 10 +- src/gls

[Mesa-dev] [PATCH 106/133] nir: Add neg, abs, and sat opcodes

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir_opcodes.h | 5 + 1 file changed, 5 insertions(+) diff --git a/src/glsl/nir/nir_opcodes.h b/src/glsl/nir/nir_opcodes.h index 35d4634..c8230b3 100644 --- a/src/glsl/nir/nir_opcodes.h +++ b/src/glsl/nir/nir_opcodes.h @@ -59,10 +59,15 @@ UNOP(fmov, nir_type_float) UNOP(imov

[Mesa-dev] [PATCH 120/133] i965/fs_nir: Add support for indirect texture arrays

2014-12-15 Thread Jason Ekstrand
--- src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 24 ++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index c7610d1..f10a90d 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_nir.c

[Mesa-dev] [PATCH 104/133] i965/fs_nir: Add a has_indirect flag and clean up some of the input/output code

2014-12-15 Thread Jason Ekstrand
--- src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 77 ++-- 1 file changed, 14 insertions(+), 63 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index 4c1805d..46d855d 100644 --- a/src/mesa/drivers/dri/i965/brw

[Mesa-dev] [PATCH 108/133] nir: Make the type casting operations static inline functions

2014-12-15 Thread Jason Ekstrand
Previously, the casting operations were macros. While this is usually fine, the casting macro used the input parameter twice leading to strange behavior when you passed the result of another function into it. Since we know the source and destination types explicitly, we don't loose anything by ma

[Mesa-dev] [PATCH 110/133] nir: Add an expression matching framework

2014-12-15 Thread Jason Ekstrand
This framework provides a simple way to do simple search-and-replace operations on NIR code. The nir_search.h header provides four simple data structures for representing expressions: nir_value and four subtypes: nir_variable, nir_constant, and nir_expression. An expression tree can then be repr

[Mesa-dev] [PATCH 102/133] nir/glsl: Add support for gpu_shader5 interpolation instrinsics

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/glsl_to_nir.cpp | 80 +++- 1 file changed, 79 insertions(+), 1 deletion(-) diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp index 088a8e9..7654972 100644 --- a/src/glsl/nir/glsl_to_nir.cpp +++ b/src/glsl/nir/glsl_to_

[Mesa-dev] [PATCH 100/133] nir/validate: Validate intrinsic source/destination sizes

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir_validate.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/src/glsl/nir/nir_validate.c b/src/glsl/nir/nir_validate.c index ee29fc3..6051784 100644 --- a/src/glsl/nir/nir_validate.c +++ b/src/glsl/nir/nir_validate.c @@ -325,10 +325,36 @@ validate

[Mesa-dev] [PATCH 103/133] nir: Add a helper for getting a constant value from an SSA source

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir.c | 19 +++ src/glsl/nir/nir.h | 1 + 2 files changed, 20 insertions(+) diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index a4edc79..f5183ce 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c @@ -1666,6 +1666,25 @@ nir_foreach_src(nir_instr *inst

[Mesa-dev] [PATCH 101/133] nir: Add gpu_shader5 interpolation intrinsics

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir_intrinsics.h | 32 +++- src/glsl/nir/nir_lower_io.c | 16 ++-- 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/src/glsl/nir/nir_intrinsics.h b/src/glsl/nir/nir_intrinsics.h index 75bd12f..e66273d 100644 --- a/src/glsl/

[Mesa-dev] [PATCH 109/133] nir/glsl: Emit abs, neg, and sat operations instead of source modifiers

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/glsl_to_nir.cpp | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp index 7654972..5ead8cd 100644 --- a/src/glsl/nir/glsl_to_nir.cpp +++ b/src/glsl/nir/glsl_to_nir.cpp @@ -1041,19 +1041,16 @@ nir_

[Mesa-dev] [PATCH 113/133] nir: Add a basic constant folding pass

2014-12-15 Thread Jason Ekstrand
--- src/glsl/Makefile.sources| 1 + src/glsl/nir/nir.h | 1 + src/glsl/nir/nir_opt_constant_folding.c | 283 +++ src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 2 + 4 files changed, 287 insertions(+) create mode 100644 src/glsl/

[Mesa-dev] [PATCH 099/133] nir: Vectorize intrinsics

2014-12-15 Thread Jason Ekstrand
We used to have the number of components built into the intrinsic. This meant that all of our load/store intrinsics had vec1, vec2, vec3, and vec4 variants. This lead to piles of switch statements to generate the correct texture names, and introspection to figure out the number of components. We

[Mesa-dev] [PATCH 093/133] nir: Add a pass for lowering input/output loads/stores

2014-12-15 Thread Jason Ekstrand
--- src/glsl/Makefile.sources | 1 + src/glsl/nir/nir.h | 2 + src/glsl/nir/nir_lower_io.c | 388 3 files changed, 391 insertions(+) create mode 100644 src/glsl/nir/nir_lower_io.c diff --git a/src/glsl/Makefile.sources b/src/glsl/Makefi

[Mesa-dev] [PATCH 095/133] nir/glsl: Generate SSA NIR

2014-12-15 Thread Jason Ekstrand
With this commit, the GLSL IR -> NIR pass generates NIR in more-or-less SSA form. It's SSA in the sense that it doesn't have any registers, but it isn't really useful SSA because it still has a pile of load/store intrinsics that we will need to get rid of. --- src/glsl/nir/glsl_to_nir.cpp | 246 +

[Mesa-dev] [PATCH 089/133] nir: Automatically update SSA if uses

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index 07d7b94..a4edc79 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c @@ -1004,13 +1004,12 @@ update_if_uses(nir_cf_node *node) return;

[Mesa-dev] [PATCH 098/133] nir: Remove the old variable lowering code

2014-12-15 Thread Jason Ekstrand
--- src/glsl/Makefile.sources |1 - src/glsl/nir/nir_lower_variables_scalar.c | 1249 - 2 files changed, 1250 deletions(-) delete mode 100644 src/glsl/nir/nir_lower_variables_scalar.c diff --git a/src/glsl/Makefile.sources b/src/glsl/Makefile.sourc

[Mesa-dev] [PATCH 094/133] nir: Add a pass to lower global variables to local variables

2014-12-15 Thread Jason Ekstrand
--- src/glsl/Makefile.sources | 1 + src/glsl/nir/nir.h| 2 + src/glsl/nir/nir_lower_global_vars_to_local.c | 107 ++ 3 files changed, 110 insertions(+) create mode 100644 src/glsl/nir/nir_lower_global_vars_to_local.c di

[Mesa-dev] [PATCH 088/133] nir: Use the enum for the variable mode

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h index b04a137..fc16cb5 100644 --- a/src/glsl/nir/nir.h +++ b/src/glsl/nir/nir.h @@ -155,7 +155,7 @@ typedef struct { * * \sa nir_variable_mode

[Mesa-dev] [PATCH 091/133] nir: Add a pass to lower local variable accesses to SSA values

2014-12-15 Thread Jason Ekstrand
This pass analizes all of the load/store operations and, when a variable is never aliased (potentially used by an indirect operation), it is lowered directly to an SSA value. This pass translates to SSA directly and does not require any fixup by the original to-SSA pass. --- src/glsl/Makefile.sou

[Mesa-dev] [PATCH 096/133] i965/fs_nir: Use the new variable lowering code

2014-12-15 Thread Jason Ekstrand
This commit switches us over to the new variable lowering code which is capable of properly handling lowering indirects as we go. --- src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 44 ++-- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/src/mesa/drivers/dri

[Mesa-dev] [PATCH 097/133] nir/validate: Ensure that outputs are write-only and inputs are read-only

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir_validate.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/src/glsl/nir/nir_validate.c b/src/glsl/nir/nir_validate.c index 80faa15..b8ef802 100644 --- a/src/glsl/nir/nir_validate.c +++ b/src/glsl/nir/nir_validate.c @@ -337,6 +337,29 @@ validate_int

[Mesa-dev] [PATCH 090/133] nir: Add a copy splitting pass

2014-12-15 Thread Jason Ekstrand
--- src/glsl/Makefile.sources | 1 + src/glsl/nir/nir.h | 2 + src/glsl/nir/nir_split_var_copies.c | 225 3 files changed, 228 insertions(+) create mode 100644 src/glsl/nir/nir_split_var_copies.c diff --git a/src/glsl/Makefile.s

[Mesa-dev] [PATCH 086/133] nir/glsl: Don't allocate a state_slots array for 0 state slots

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/glsl_to_nir.cpp | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp index 754a81f..6870bd2 100644 --- a/src/glsl/nir/glsl_to_nir.cpp +++ b/src/glsl/nir/glsl_to_nir.cpp @@ -329,12 +329,1

[Mesa-dev] [PATCH 092/133] nir: Add a pass to lower local variables to registers

2014-12-15 Thread Jason Ekstrand
--- src/glsl/Makefile.sources | 1 + src/glsl/nir/nir.h | 2 + src/glsl/nir/nir_lower_locals_to_regs.c | 313 3 files changed, 316 insertions(+) create mode 100644 src/glsl/nir/nir_lower_locals_to_regs.c diff --git a/src/gls

[Mesa-dev] [PATCH 087/133] i965/fs_nir: Don't dump the shader.

2014-12-15 Thread Jason Ekstrand
This is killing piglit. I'll leave the logging local --- src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 5 - 1 file changed, 5 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index f4656bc..0cd8fca 100644 --- a/src/mesa/drivers/dri/i

[Mesa-dev] [PATCH 085/133] nir: Validate that the sources of a phi have the same size as the destination

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir_validate.c | 13 + 1 file changed, 13 insertions(+) diff --git a/src/glsl/nir/nir_validate.c b/src/glsl/nir/nir_validate.c index 8354aa3..80faa15 100644 --- a/src/glsl/nir/nir_validate.c +++ b/src/glsl/nir/nir_validate.c @@ -466,9 +466,22 @@ validate_phi_src(nir_p

[Mesa-dev] [PATCH 080/133] nir: Make array deref direct vs. indirect an enum

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/glsl_to_nir.cpp | 3 ++- src/glsl/nir/nir.c| 10 +- src/glsl/nir/nir.h| 7 ++- src/glsl/nir/nir_lower_atomics.c | 2 +- src/glsl/nir/nir_lower_samplers.cpp | 2 +- src/glsl/nir/nir_lower_va

[Mesa-dev] [PATCH 081/133] nir: Add a concept of a wildcard array dereference

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir.h | 9 + src/glsl/nir/nir_print.c | 3 +++ 2 files changed, 12 insertions(+) diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h index f4db3f8..27e7e7a 100644 --- a/src/glsl/nir/nir.h +++ b/src/glsl/nir/nir.h @@ -625,9 +625,18 @@ typedef struct { nir_variab

[Mesa-dev] [PATCH 083/133] nir: Don't require a function in ssa_def_init

2014-12-15 Thread Jason Ekstrand
Instead, we give SSA definitions a temporary index of 0x if the instruction does not have a block and a proper index when it actually gets added to the list. --- src/glsl/nir/nir.c | 42 ++ src/glsl/nir/nir.h | 5 ++--

[Mesa-dev] [PATCH 084/133] nir/copy_propagate: Don't cause size mismatches on phi node sources

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir_opt_copy_propagate.c | 12 1 file changed, 12 insertions(+) diff --git a/src/glsl/nir/nir_opt_copy_propagate.c b/src/glsl/nir/nir_opt_copy_propagate.c index b710181..1f81b17 100644 --- a/src/glsl/nir/nir_opt_copy_propagate.c +++ b/src/glsl/nir/nir_opt_copy_propa

[Mesa-dev] [PATCH 078/133] nir/lower_samplers: Use the nir_instr_rewrite_src function

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir_lower_samplers.cpp | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/glsl/nir/nir_lower_samplers.cpp b/src/glsl/nir/nir_lower_samplers.cpp index e10456d..347c84a 100644 --- a/src/glsl/nir/nir_lower_samplers.cpp +++ b/src/glsl/nir/nir_lower_sa

[Mesa-dev] [PATCH 079/133] nir: Clean up nir_deref helper functions

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index 5d7d21a..cf238c1 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c @@ -536,6 +536,7 @@ static nir_deref_var * copy_deref_var(void *mem_ctx, nir_deref

[Mesa-dev] [PATCH 082/133] nir: Use an integer index for specifying structure fields

2014-12-15 Thread Jason Ekstrand
Previously, we used a string name. It was nice for translating out of GLSL IR (which also does that) but cumbersome the rest of the time. --- src/glsl/nir/glsl_to_nir.cpp | 5 ++- src/glsl/nir/nir.c| 6 +-- src/glsl/nir/nir.h| 4 +-

[Mesa-dev] [PATCH 065/133] glsl/list: Add a foreach_list_typed_safe_reverse macro

2014-12-15 Thread Jason Ekstrand
--- src/glsl/list.h | 9 + 1 file changed, 9 insertions(+) diff --git a/src/glsl/list.h b/src/glsl/list.h index 4774ccc..330c17e 100644 --- a/src/glsl/list.h +++ b/src/glsl/list.h @@ -678,4 +678,13 @@ inline void exec_node::insert_before(exec_list *before) __node = __next, __next

[Mesa-dev] [PATCH 072/133] nir: Add a basic CSE pass

2014-12-15 Thread Jason Ekstrand
This pass is still fairly basic. It only handles ALU operations, constant loads, and phi nodes. No texture ops or intrinsics yet. --- src/glsl/Makefile.sources | 1 + src/glsl/nir/nir.h | 2 + src/glsl/nir/nir_opt_cse.c | 269 + 3 files ch

[Mesa-dev] [PATCH 066/133] nir/nir: Use safe iterators when iterating over the CFG

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index 060359a..32473e0 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c @@ -1732,22 +1732,24 @@ static inline bool foreach_if(nir_if *if_s

[Mesa-dev] [PATCH 073/133] i965/fs_nir: Add the CSE pass and actually run in a loop

2014-12-15 Thread Jason Ekstrand
--- src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 31 ++- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index b6720af..5703225 100644 --- a/src/mesa/drivers/dri/i965/brw_

[Mesa-dev] [PATCH 076/133] i965/fs_nir: Properly saturate multiplies

2014-12-15 Thread Jason Ekstrand
--- src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index 019d649..f4656bc 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp +++ b/src/mesa/drivers/

[Mesa-dev] [PATCH 071/133] nir: Add a fused multiply-add peephole

2014-12-15 Thread Jason Ekstrand
--- src/glsl/Makefile.sources| 1 + src/glsl/nir/nir.h | 1 + src/glsl/nir/nir_opcodes.h | 1 + src/glsl/nir/nir_opt_peephole_ffma.c | 191 +++ src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 2 + 5 files change

[Mesa-dev] [PATCH 070/133] nir: Validate that the SSA def and register indices are unique

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir_validate.c | 41 + 1 file changed, 41 insertions(+) diff --git a/src/glsl/nir/nir_validate.c b/src/glsl/nir/nir_validate.c index ae8deb8..727f141 100644 --- a/src/glsl/nir/nir_validate.c +++ b/src/glsl/nir/nir_validate.c @@ -49,6 +49,9

[Mesa-dev] [PATCH 074/133] i965/fs_nir: Use an array rather than a hash table for register lookup

2014-12-15 Thread Jason Ekstrand
--- src/mesa/drivers/dri/i965/brw_fs.h | 4 +-- src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 46 +++- src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 5 +-- 3 files changed, 30 insertions(+), 25 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/s

[Mesa-dev] [PATCH 077/133] nir: Add a helper for rewriting an instruction source

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir.c | 61 ++ src/glsl/nir/nir.h | 1 + 2 files changed, 62 insertions(+) diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index 1566e7c..5d7d21a 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c @@ -1677,6 +1677,67

[Mesa-dev] [PATCH 067/133] nir/nir: Patch up phi predecessors in move_successors

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir.c | 25 +++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index 32473e0..1566e7c 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c @@ -724,6 +724,23 @@ split_block_beginning(nir_block *block)

[Mesa-dev] [PATCH 049/133] nir: Add a function to detect if a block is immediately followed by an if

2014-12-15 Thread Jason Ekstrand
Since we don't actually have an "if" instruction, this is a very common pattern when iterating over instructions. This adds a helper function for it to make things a little less painful. --- src/glsl/nir/nir.c | 17 + src/glsl/nir/nir.h | 5 + src/glsl/nir/n

[Mesa-dev] [PATCH 039/133] i965/fs: Don't take an ir_variable for emit_general_interpolation

2014-12-15 Thread Jason Ekstrand
Previously, emit_general_interpolation took an ir_variable and pulled the information it needed from that. This meant that in fs_fp, we were constructing a dummy ir_variable just to pass into it. This commit makes emit_general_interpolation take only the information it needs and gets rid of the f

[Mesa-dev] [PATCH 064/133] nir/nir: Fix a bug in move_successors

2014-12-15 Thread Jason Ekstrand
The unlink_blocks function moves successors around to make sure that, if there is a remaining successor, it is in the first successors slot and not the second. To fix this, we simply get both successors up front. --- src/glsl/nir/nir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

[Mesa-dev] [PATCH 053/133] nir: Automatically handle SSA uses when an instruction is inserted

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir.c| 16 +--- src/glsl/nir/nir_to_ssa.c | 16 +--- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index 8c734fc..f30d75a 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c @@ -1138,12

[Mesa-dev] [PATCH 062/133] nir: Differentiate between signed and unsigned versions of find_msb

2014-12-15 Thread Jason Ekstrand
We also make the return types match GLSL. The GLSL spec specifies that findMSB and findLSB return a signed integer. Previously, nir had them return unsigned. This updates nir's behavior to match what GLSL expects. We also update the nir-to-fs generator to take the new instructions. While we're

[Mesa-dev] [PATCH 056/133] nir: Add a function for comparing two sources

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir.c | 27 +++ src/glsl/nir/nir.h | 2 ++ 2 files changed, 29 insertions(+) diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index d3fd084..f7bee9d 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c @@ -1628,6 +1628,33 @@ nir_foreach_src(nir_in

[Mesa-dev] [PATCH 068/133] nir: Add a peephole select optimization

2014-12-15 Thread Jason Ekstrand
--- src/glsl/Makefile.sources | 1 + src/glsl/nir/nir.h | 2 + src/glsl/nir/nir_opt_peephole_select.c | 214 + 3 files changed, 217 insertions(+) create mode 100644 src/glsl/nir/nir_opt_peephole_select.c diff --git a/src/glsl/M

[Mesa-dev] [PATCH 063/133] i965/fs_nir: Validate optimization passes

2014-12-15 Thread Jason Ekstrand
--- src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index 561c709..d7a2d0b 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cp

[Mesa-dev] [PATCH 060/133] nir: Validate all lists in the validator

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir_validate.c | 13 + 1 file changed, 13 insertions(+) diff --git a/src/glsl/nir/nir_validate.c b/src/glsl/nir/nir_validate.c index 200c85a..ae8deb8 100644 --- a/src/glsl/nir/nir_validate.c +++ b/src/glsl/nir/nir_validate.c @@ -452,6 +452,7 @@ validate_phi_src(nir_ph

[Mesa-dev] [PATCH 052/133] nir: Add an initialization function for SSA definitions

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir.c| 14 ++ src/glsl/nir/nir.h| 4 src/glsl/nir/nir_to_ssa.c | 28 +++- 3 files changed, 25 insertions(+), 21 deletions(-) diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index 2c06d7e..8c734fc 100644 --- a/src/glsl

[Mesa-dev] [PATCH 069/133] i965/fs_nir: Turn on the peephole select optimization

2014-12-15 Thread Jason Ekstrand
--- src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index d7a2d0b..b2c5863 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp +++ b/src/mesa/drivers/dri/i965/brw_f

[Mesa-dev] [PATCH 075/133] i965/fs_nir: Handle SSA constants

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir_from_ssa.c | 40 - src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 50 +--- 2 files changed, 65 insertions(+), 25 deletions(-) diff --git a/src/glsl/nir/nir_from_ssa.c b/src/glsl/nir/nir_from_ssa.c index 62a54fe..931

[Mesa-dev] [PATCH 041/133] nir: Add a naieve from-SSA pass

2014-12-15 Thread Jason Ekstrand
This pass is kind of stupidly implemented but it should be enough to get us up and going. We probably want something better that doesn't generate all of the redundant moves eventually. However, the i965 backend should be able to handle the movs, so I'm not too worried about it in the short term.

[Mesa-dev] [PATCH 036/133] i965/fs: Allow reinterpretation in constant propagation

2014-12-15 Thread Jason Ekstrand
Because NIR is typeless, it treats all constants as uint32 values and reinterprets them when they are used later. This commit allows those values to be properly propagated. --- src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --

[Mesa-dev] [PATCH 055/133] nir: Add a parallel copy instruction type

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir.c | 45 - src/glsl/nir/nir.h | 23 +++ src/glsl/nir/nir_print.c | 21 + 3 files changed, 88 insertions(+), 1 deletion(-) diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index

[Mesa-dev] [PATCH 051/133] nir: Add an SSA-based liveness analysis pass.

2014-12-15 Thread Jason Ekstrand
--- src/glsl/Makefile.sources | 1 + src/glsl/nir/nir.h| 13 ++ src/glsl/nir/nir_live_variables.c | 282 ++ src/glsl/nir/nir_metadata.c | 2 + src/mesa/main/bitset.h| 1 + 5 files changed, 299 insertions(+) creat

[Mesa-dev] [PATCH 047/133] nir/foreach_block: Return false if the callback on the last block fails

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index 3c897b2..a12c209 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c @@ -1654,9 +1654,7 @@ nir_foreach_block(nir_function_impl *impl, nir_foreach_block_

[Mesa-dev] [PATCH 043/133] i965/fs_nir: Convert the shader to/from SSA

2014-12-15 Thread Jason Ekstrand
--- src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 9 + 1 file changed, 9 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index efe06d7..99094c7 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp +++ b/src/mesa/drivers/dri/i96

[Mesa-dev] [PATCH 029/133] i965/fs_nir: Add support for sample_pos and sample_id

2014-12-15 Thread Jason Ekstrand
--- src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index 22f4c0f..677bd8f 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp +++

[Mesa-dev] [PATCH 054/133] nir: Add a function for rewriting all the uses of a SSA def

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir.c | 54 ++ src/glsl/nir/nir.h | 1 + 2 files changed, 55 insertions(+) diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index f30d75a..27e903e 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c @@ -1599,6 +1599,60

[Mesa-dev] [PATCH 038/133] nir: Add intrinsics to do alternate interpolation on inputs

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir_intrinsics.h | 52 +-- 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/src/glsl/nir/nir_intrinsics.h b/src/glsl/nir/nir_intrinsics.h index e82152c..e4ad8cd 100644 --- a/src/glsl/nir/nir_intrinsics.h +++ b/src/glsl/nir/nir

[Mesa-dev] [PATCH 048/133] nir: Add a foreach_block_reverse function

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir.c | 79 +- 1 file changed, 54 insertions(+), 25 deletions(-) diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index a12c209..5dbcc77 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c @@ -1591,51 +1591,65 @@ nir_fo

[Mesa-dev] [PATCH 027/133] Fix what I think are a few NIR typos

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir_opcodes.h| 6 +++--- src/glsl/nir/nir_opt_copy_propagate.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/glsl/nir/nir_opcodes.h b/src/glsl/nir/nir_opcodes.h index 36a50d7..bee4bd1 100644 --- a/src/glsl/nir/nir_opcodes.h +++ b/src/glsl/n

[Mesa-dev] [PATCH 059/133] glsl/list: Fix the exec_list_validate function

2014-12-15 Thread Jason Ekstrand
Some time while refactoring things to make it look nicer before pushing to master, I completely broke the function. This fixes it to be correct. Just goes to show you why you souldn't push code that has no users yet... Signed-off-by: Jason Ekstrand --- src/glsl/list.h | 4 +--- 1 file changed,

[Mesa-dev] [PATCH 042/133] nir: Add a lower_vec_to_movs pass

2014-12-15 Thread Jason Ekstrand
--- src/glsl/Makefile.sources| 1 + src/glsl/nir/nir.h | 2 + src/glsl/nir/nir_lower_vec_to_movs.c | 96 3 files changed, 99 insertions(+) create mode 100644 src/glsl/nir/nir_lower_vec_to_movs.c diff --git a/src/glsl/Makefile.s

[Mesa-dev] [PATCH 061/133] nir/print: Don't reindex things

2014-12-15 Thread Jason Ekstrand
These indices should now be reasonably stable/consistent. Redoing the indices in the print functions makes it harder to debug problems. --- src/glsl/nir/nir_print.c | 4 1 file changed, 4 deletions(-) diff --git a/src/glsl/nir/nir_print.c b/src/glsl/nir/nir_print.c index 0140f4e..dd57116 10

[Mesa-dev] [PATCH 046/133] nir: Add an assert

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index 0124799..3c897b2 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c @@ -840,6 +840,7 @@ handle_jump(nir_block *block) unlink_blocks(last_block, after_block);

[Mesa-dev] [PATCH 030/133] nir/glsl: Add support for saturate

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/glsl_to_nir.cpp | 5 + 1 file changed, 5 insertions(+) diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp index c4dff0d..60a24bc 100644 --- a/src/glsl/nir/glsl_to_nir.cpp +++ b/src/glsl/nir/glsl_to_nir.cpp @@ -1012,6 +1012,11 @@ nir_visitor::visit(ir_exp

[Mesa-dev] [PATCH 045/133] nir: Add a basic metadata management system

2014-12-15 Thread Jason Ekstrand
--- src/glsl/Makefile.sources| 1 + src/glsl/nir/nir.c | 19 +++- src/glsl/nir/nir.h | 21 -- src/glsl/nir/nir_dominance.c | 6 ++--- src/glsl/nir/nir_metadata.c | 52 5 files changed, 82 insertions

[Mesa-dev] [PATCH 044/133] nir/lower_variables_scalar: Silence a compiler warning

2014-12-15 Thread Jason Ekstrand
--- src/glsl/nir/nir_lower_variables_scalar.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/glsl/nir/nir_lower_variables_scalar.c b/src/glsl/nir/nir_lower_variables_scalar.c index 52e1ce6..92b716a 100644 --- a/src/glsl/nir/nir_lower_variables_scalar.c +++ b/src/glsl/nir/nir_lower_vari

  1   2   3   >