Re: [Mesa-dev] [PATCH 3/3] egl/main: expose the EGL_RECORDABLE_ANDROID extension

2015-06-19 Thread Eric Anholt
Chih-Wei Huang writes: The commit message needs some explanation: Why are we doing this? What does EGL_ANDROID_recordable get us, if we don't have any configs exposing it? What tests do we have for it? > Signed-off-by: Chih-Wei Huang > --- > src/egl/main/eglconfig.c | 5 - > src/egl/main

Re: [Mesa-dev] [PATCH 08/11] confiigure: drop unused variable GBM_BACKEND_DIRS

2015-06-19 Thread Eric Anholt
Emil Velikov writes: > Signed-off-by: Emil Velikov s/confiigure/configure/ in the subject. After that, and some cleanup of the commit message in 4, patches 1-8 will be: Reviewed-by: Eric Anholt I find 9/10 weird -- if the DRI drivers need libglapi, why aren't they just linking

[Mesa-dev] [PATCH] tgsi_to_nir: Fix translation of TXF on MSAA targets.

2015-06-23 Thread Eric Anholt
Noticed while trying to add GL_ARB_texture_multisample support to vc4. --- src/gallium/auxiliary/nir/tgsi_to_nir.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c index 061f39a..065

Re: [Mesa-dev] [RFC] i965: Don't consider uniform value locations in program uploads

2015-06-29 Thread Eric Anholt
Kenneth Graunke writes: > On Wednesday, June 03, 2015 09:21:11 PM Topi Pohjolainen wrote: >> Shader programs are cached per stage (FS, VS, GS) using the >> corresponding shader source identifier and compile time choices >> as key. However, one not only stores the program binary but >> a pair cons

Re: [Mesa-dev] [PATCH 2/4] gallium/ttn: IN/OUT are only array if ArrayID != 0

2015-07-01 Thread Eric Anholt
a "num_decls" and "array_size[_per_decl]" would have clarified things for me), and I'm kind of bothered that we're not just splitting non-variable-indexed array declarations at the NIR level (which would also solve the problem it seems), but this seems correct, so:

Re: [Mesa-dev] [PATCH 4/4] gallium/ttn: mark location specially in nir for color0-writes-all

2015-07-01 Thread Eric Anholt
nny location and decode on the other end. > > Signed-off-by: Ilia Mirkin Yeah, seems like an OK patch for now, though we really need to start using common enums instead. Reviewed-by: Eric Anholt signature.asc Description: PGP signature ___ m

Re: [Mesa-dev] Extension to get Mesa IRs (Was: [Bug 91173])

2015-07-02 Thread Eric Anholt
Ilia Mirkin writes: > On Thu, Jul 2, 2015 at 2:31 PM, Jose Fonseca wrote: >> On 02/07/15 17:49, Ilia Mirkin wrote: >>> >>> On Thu, Jul 2, 2015 at 12:40 PM, Jose Fonseca wrote: On 02/07/15 17:24, Ilia Mirkin wrote: > > > On Thu, Jul 2, 2015 at 12:17 PM, Jose Fonseca >

Re: [Mesa-dev] [PATCH 05/11] mesa: implement _mesa_GetTextureSubImage()

2015-07-02 Thread Eric Anholt
Brian Paul writes: > The main issue is I need to do additional work for cube and/or cube > array textures. This is still on my to-do list. Do you need this? FWIW, I just wanted this extension in X yesterday. signature.asc Description: PGP signature __

Re: [Mesa-dev] [RFC] loader: libudev vs sysfs vs libdrm

2015-07-08 Thread Eric Anholt
Emil Velikov writes: > Hello all, > > A recent patch by Chris, fixing some libudev fun in our loader, made > me think if we can clear it up a bit. > > Having three different ways of retrieving the vendor/device ID does > feel a bit excessive. Plus as one gets fixed others are likely to > break -

Re: [Mesa-dev] [PATCH 4/4] vc4: unref old fence

2015-07-08 Thread Eric Anholt
Rob Clark writes: > From: Rob Clark > > Some, but not all, state trackers will explicitly unref (and set to > NULL) the previous *fence before calling pipe->flush(). So driver > should use fence_ref() which will unref the old fence if not NULL. > > Signed-off-by: Ro

Re: [Mesa-dev] [PATCH] glsl: use the fast hash table for ir_validate

2015-07-09 Thread Eric Anholt
Timothy Arceri writes: > --- > > Some of the AoA tests currently get stuck in an optimisation > loop for a long time and this was taking a large amount of time. > Its a symptom not a cause but I don't see any issue with using the faster > version. > > src/glsl/ir_validate.cpp | 17 --

Re: [Mesa-dev] [PATCH] xa: don't leak fences

2015-07-10 Thread Eric Anholt
Rob Clark writes: > well, freedreno and vmware ddx still use XA.. they both could probably > be ported to use glamor instead, but that hasn't been done yet.. > > At least for freedreno with upstream drm/kms driver, one can just use > -modesetting ddx instead. But that doesn't work w/ android fbd

[Mesa-dev] [PATCH 1/2] mesa: Detect and provide macros for function attributes pure and const.

2015-07-14 Thread Eric Anholt
These are really useful hints to the compiler in the absence of link-time optimization, and I'm going to use them in VC4. I've made the const attribute be ATTRIBUTE_CONST unlike other function attributes, because we have other things in the tree #defining CONST for their own unrelated purposes. --

[Mesa-dev] [PATCH 2/2] vc4: Use the pure/const attributes on a bunch of our QPU functions.

2015-07-14 Thread Eric Anholt
On a release build, this makes the rest of vc4_qpu_validate.c go away (the compiler didn't know that our qpu helper function calls had no side effects). --- src/gallium/drivers/vc4/vc4_qpu.h| 30 +++--- src/gallium/drivers/vc4/vc4_tiling.h | 6 +++--- 2 files changed,

Re: [Mesa-dev] [PATCH 06/13] gallium/auxiliary: Avoid double promotion.

2015-07-14 Thread Eric Anholt
y/util/u_math.h > +++ b/src/gallium/auxiliary/util/u_math.h > @@ -240,7 +240,7 @@ util_iround(float f) > static INLINE boolean > util_is_approx(float a, float b, float tol) > { > - return fabs(b - a) <= tol; > + return fabsf(b - a) <= tol; > } Reviewed-by: Eri

Re: [Mesa-dev] Seeking advice speeding up glsl optimisation passes for AoA

2015-07-15 Thread Eric Anholt
Timothy Arceri writes: > Hi guys, > > As I've mentioned a couple of times in previous patches some of the cts AoA > tests are taking very long time to compile. This is due to excessive > optimisation passes mainly in the glsl optimisations (there are some slowdowns > in the intel backend too but

Re: [Mesa-dev] [PATCH 1/5] utils: automake: remove uncommon $()

2015-07-17 Thread Eric Anholt
Matt Turner writes: > On Fri, Jul 17, 2015 at 10:17 AM, Emil Velikov > wrote: >> Cc: Eric Anholt >> Signed-off-by: Emil Velikov >> --- >> src/util/tests/hash_table/Makefile.am | 3 +-- >> 1 file changed, 1 insertion(+), 2 deletions(-) >> >> di

Re: [Mesa-dev] [PATCH 1/2] mesa: Detect and provide macros for function attributes pure and const.

2015-07-17 Thread Eric Anholt
Emil Velikov writes: > On 14/07/15 19:45, Eric Anholt wrote: >> These are really useful hints to the compiler in the absence of link-time >> optimization, and I'm going to use them in VC4. >> >> I've made the const attribute be ATTRIBUTE_CONST unlike oth

Re: [Mesa-dev] [PATCH] swrast: remove unneeded & operators in _swrast_choose_texture_sample_func()

2015-07-20 Thread Eric Anholt
re_complete(t, sampler)) { > - return &null_sample_func; > + return null_sample_func; Much prettier. Reviewed-by: Eric Anholt signature.asc Description: PGP signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH 3/6] mesa: move check for no-op glShadeModel call earlier

2015-07-20 Thread Eric Anholt
&& mode != GL_SMOOTH) { >_mesa_error(ctx, GL_INVALID_ENUM, "glShadeModel"); >return; > } > > - if (ctx->Light.ShadeModel == mode) > - return; > - > FLUSH_VERTICES(ctx, _NEW_LIGHT); > ctx->Light.Shade

Re: [Mesa-dev] [PATCH] glx: Fix image size computation for EXT_texture_integer (v2)

2015-07-21 Thread Eric Anholt
Adam Jackson writes: > Without this this extension basically can't work in indirect contexts, > TexImage2D will compute the image size as 0 and we'll send no image data > to the server. > > v2: Add EXT_texture_integer to the client extension list too (Ian)

[Mesa-dev] [PATCH] glx: Fix build warnings for PURE being redefined.

2015-07-22 Thread Eric Anholt
We can't completely drop this #define because it's used in the xserver generated code. Until someone gets around to putting xml generation directly in the server, we're stuck #defining it for them. --- src/mapi/glapi/gen/gl_XML.py | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-)

Re: [Mesa-dev] [PATCH 07/10] mesa: fix incorrect error string in _mesa_BlendEquationiARB()

2015-10-14 Thread Eric Anholt
Brian Paul writes: > --- > src/mesa/main/blend.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c > index d225f3d..f14949f 100644 > --- a/src/mesa/main/blend.c > +++ b/src/mesa/main/blend.c > @@ -407,7 +407,7 @@ _mesa_BlendEqu

Re: [Mesa-dev] [PATCH 02/10] mesa: short-cut new_state == _NEW_LINE in _mesa_update_state_locked()

2015-10-14 Thread Eric Anholt
thing like: GLbitfield computed_states = ~(_NEW_CURRENT_ATTRIB | _NEW_LINE); if (!(new_state & computed_states)) goto out; making the optimization slightly more general and more self-documenting? Either way, other than the comment on #7, R

Re: [Mesa-dev] Fuzz testing the stand alone glsl compiler

2015-10-20 Thread Eric Anholt
Steve Lynch writes: > Hi, > > I've been using afl (http://lcamtuf.coredump.cx/afl/) on the standalone > glsl compiler. > > It found four different crashes in the latest code in master and I have > minimised the test cases that cause the crashes. I spent a couple of hours > poking around but haven

Re: [Mesa-dev] [PATCH 2/2] vc4: Use nir_foreach_variable

2015-10-20 Thread Eric Anholt
Boyan Ding writes: > Signed-off-by: Boyan Ding > --- > src/gallium/drivers/vc4/vc4_nir_lower_blend.c | 2 +- > src/gallium/drivers/vc4/vc4_nir_lower_io.c| 4 ++-- > src/gallium/drivers/vc4/vc4_program.c | 8 > 3 files changed, 7 insertions(+), 7 deletions(-) Pushed the vc4

Re: [Mesa-dev] [PATCH] egl/x11/dri3: do not expose the preserved swap behavior (to be squashed)

2015-11-10 Thread Eric Anholt
Martin Peres writes: > The preserved swap behavior is currently untested in piglit and not supported > on the GLX side. Before working on implementing it for EGL/DRI3, let's > disable it until support comes. > > This patch is trivial enough and will likely be squashed in the commit > egl/x11: Imp

Re: [Mesa-dev] [PATCH] nir: fix typo in idiv lowering, causing large-udiv-udiv failures

2015-11-10 Thread Eric Anholt
ume you meant *-op-div-large-uint-uint.shader_test. vc4 doesn't have uge yet, but I've got a patch to add it and it does fix one subtest. What this lowering pass is actually doing has never really made sense to me, but it works, so: Acked-by: Eric Anholt signature.as

[Mesa-dev] [PATCH] nir: Add nir_lower_alu_scalar.

2015-01-22 Thread Eric Anholt
This is the equivalent of brw_fs_channel_expressions.cpp, which I wanted for vc4. v2: Use the nir_src_for_ssa() helper, and another instance of nir_alu_src_copy(). v3: Drop the non-SSA support. All intended callers will have SSA-only ALU ops. v4: Use insert_before, drop stale bcsel/fcsel

Re: [Mesa-dev] [PATCH] nir: Make vec-to-movs handle src/dest aliasing.

2015-01-23 Thread Eric Anholt
tiguous >> components is enough. >> >> On Thu, Jan 22, 2015 at 4:51 PM, Eric Anholt wrote: >>> +static unsigned >>> +insert_movs(nir_alu_instr *vec, unsigned start_channel, >>> +unsigned start_src_idx, void *mem_ctx) > > We need a comment

Re: [Mesa-dev] [PATCH] nir: Add nir_lower_alu_scalar.

2015-01-23 Thread Eric Anholt
Jason Ekstrand writes: > Also, Could we rename this to nir_lower_alu_to_scalar? That's more > descriptive. That's even better. Done. signature.asc Description: PGP signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.free

[Mesa-dev] [PATCH 2/2] gallium: Replace u_simple_list.h with util/simple_list.h

2015-01-23 Thread Eric Anholt
The code was exactly the same, except util/ has c++ guards and a struct simple_node declaration. --- For my NIR work, there were clashes between gallium's copy (from my driver) and Mesa's (from NIR) src/gallium/auxiliary/Makefile.sources| 1 - src/gallium/auxiliary/draw/draw_llvm.c

[Mesa-dev] [PATCH 1/2] mesa: Move simple_list.h to src/util.

2015-01-23 Thread Eric Anholt
We have two copies of it in the tree, I'm going to delete one. --- src/gallium/targets/dri/Makefile.am| 1 + src/mesa/Makefile.sources | 1 - src/mesa/drivers/dri/i915/i830_texblend.c | 2 +- src/mesa/drivers/dri/i915/intel_syncobj.c

[Mesa-dev] [PATCH 1/2] nir: When asked to print with a NULL state, just us bare variable names.

2015-01-23 Thread Eric Anholt
--- src/glsl/nir/nir_print.c | 22 -- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/glsl/nir/nir_print.c b/src/glsl/nir/nir_print.c index 1a50ae9..2ef55ed 100644 --- a/src/glsl/nir/nir_print.c +++ b/src/glsl/nir/nir_print.c @@ -210,7 +210,9 @@ print_var_dec

[Mesa-dev] [PATCH 2/2] nir: Expose nir_print_instr() for debug prints

2015-01-23 Thread Eric Anholt
It's nice to have this present in your default cases so you can see what instruction is triggering an abort. v2: Just pass a NULL state, now that it won't crash when you do. --- src/glsl/nir/nir.h | 1 + src/glsl/nir/nir_print.c | 9 +++-- 2 files changed, 8 insertions(+), 2 deletions(-

Re: [Mesa-dev] [PATCH] nir: Use pointers for nir_src_copy and nir_dest_copy

2015-01-26 Thread Eric Anholt
t) { > - ret->indirect = nir_src_copy(deref->indirect, mem_ctx); > + nir_src_copy(&ret->indirect, &deref->indirect, mem_ctx); > } > ret->deref.type = deref->deref.type; > if (deref->deref.child) Unintentional whitespace change? Other

Re: [Mesa-dev] [PATCH 2/2] nir/opcodes: Don't go through doubles when constant-folding iabs

2015-01-26 Thread Eric Anholt
Jason Ekstrand writes: > Previously, we called the abs() function in math.h. However, this involves > unnecessarily going through double. This commit changes it to use integers > directly with a ternary. Or just use fabs()? signature.asc Description: PGP signature ___

Re: [Mesa-dev] [PATCH v2 1/3] nir: Add a pass to lower vector phi nodes to scalar phi nodes

2015-01-26 Thread Eric Anholt
Jason Ekstrand writes: > diff --git a/src/glsl/nir/nir_lower_phis_to_scalar.c > b/src/glsl/nir/nir_lower_phis_to_scalar.c > new file mode 100644 > index 000..9f901d6 > --- /dev/null > +++ b/src/glsl/nir/nir_lower_phis_to_scalar.c > @@ -0,0 +1,238 @@ > +/* > + * Copyright © 2014 Intel Corporat

Re: [Mesa-dev] [PATCH 2/2] nir/opcodes: Don't go through doubles when constant-folding iabs

2015-01-26 Thread Eric Anholt
Jason Ekstrand writes: > On Mon, Jan 26, 2015 at 11:15 AM, Eric Anholt wrote: > >> Jason Ekstrand writes: >> >> > Previously, we called the abs() function in math.h. However, this >> involves >> > unnecessarily going through double. This commit c

Re: [Mesa-dev] [PATCH] nir: Make vec-to-movs handle src/dest aliasing.

2015-01-26 Thread Eric Anholt
Connor Abbott writes: > On Fri, Jan 23, 2015 at 5:34 PM, Eric Anholt wrote: >> Connor Abbott writes: >> >>> Argh, nevermind, I was reading it wrong... >>> >>> On Thu, Jan 22, 2015 at 8:18 PM, Connor Abbott wrote: >>>> What happens if you h

[Mesa-dev] [PATCH] mesa: Port a variant of 68afbe89c72d085dcbbf2b264f0201ab73fe339e to util/

2015-01-26 Thread Eric Anholt
The idea is that after a remove_from_list(), you might want to be able to do a remove_from_list() on it again or an is_empty_list(). This is apparently relied on by r300g. --- src/util/simple_list.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util/simple_list.h b/src/util/simple_list.

Re: [Mesa-dev] [PATCH v2 1/3] nir: Add a pass to lower vector phi nodes to scalar phi nodes

2015-01-26 Thread Eric Anholt
Jason Ekstrand writes: > On Mon, Jan 26, 2015 at 11:21 AM, Eric Anholt wrote: > >> Jason Ekstrand writes: >> > + case nir_instr_type_phi: { >> > + nir_phi_instr *src_phi = nir_instr_as_phi(src_instr); >> > + >> > + /* Ins

Re: [Mesa-dev] [PATCH v2 1/3] nir: Add a pass to lower vector phi nodes to scalar phi nodes

2015-01-27 Thread Eric Anholt
Jason Ekstrand writes: > On Mon, Jan 26, 2015 at 3:58 PM, Eric Anholt wrote: > >> Jason Ekstrand writes: >> >> > On Mon, Jan 26, 2015 at 11:21 AM, Eric Anholt wrote: >> > >> >> Jason Ekstrand writes: >> >> > + case

Re: [Mesa-dev] [PATCH v4 2/3] i965/fs: Use NIR's scalarizing abilities and stop handling vectors

2015-01-28 Thread Eric Anholt
Matt Turner writes: > On Tue, Jan 27, 2015 at 5:31 PM, Jason Ekstrand wrote: >> + emit(MUL(acc, op[0], op[1])); >> + emit(MACH(reg_null_d, op[0], op[1])); >> + emit(MOV(result, fs_reg(acc))); >>break; >> } >> >> @@ -773,72 +767,38 @@ fs_visitor::nir_emit_alu(nir_alu_in

[Mesa-dev] [PATCH 2/3] nir: Fix a bit of broken indentation.

2015-01-28 Thread Eric Anholt
--- src/glsl/nir/nir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index 25cdac0..10e6ed3 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c @@ -1295,7 +1295,7 @@ nir_instr_insert_before_cf(nir_cf_node *node, nir_instr *before)

[Mesa-dev] [PATCH 1/3] nir: Add a couple of helpers for glsl types.

2015-01-28 Thread Eric Anholt
This will be used by tgsi_to_nir, which needs to get vec4 types for declaring shader input/output variables. --- src/glsl/nir/nir_types.cpp | 12 src/glsl/nir/nir_types.h | 3 +++ 2 files changed, 15 insertions(+) diff --git a/src/glsl/nir/nir_types.cpp b/src/glsl/nir/nir_types.cp

[Mesa-dev] [PATCH 3/3] nir: Add an ALU op builder kind of like ir_builder.h

2015-01-28 Thread Eric Anholt
v2: Rebase on the nir_opcodes.h python code generation support. v3: Use SSA values, and set an appropriate writemask on dot products. --- src/glsl/Makefile.am | 5 ++ src/glsl/nir/.gitignore | 1 + src/glsl/nir/nir_builder.h| 95

[Mesa-dev] [PATCH] nir: Don't try to to-SSA ALU instructions that are already SSA.

2015-01-28 Thread Eric Anholt
--- The i965 driver apparently only has things all in ssa or all in non-ssa, while for TGSI I ended up doing some things directly in SSA before the to-SSA pass. src/glsl/nir/nir_to_ssa.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/glsl/nir/nir_to_ssa.c b/src/glsl/nir/nir_to_ssa.c in

[Mesa-dev] [PATCH] nir: Add variants of some of the comparison simplifications.

2015-01-28 Thread Eric Anholt
We end up with these from TGSI-to-NIR because the pass generating the comparisons doesn't know if the arg is actually a bool input or not. total instructions in shared programs: 41801 -> 41508 (-0.70%) instructions in affected programs: 4253 -> 3960 (-6.89%) --- src/glsl/nir/nir_opt_algebraic

Re: [Mesa-dev] [PATCH 3/3] nir: Add an ALU op builder kind of like ir_builder.h

2015-01-28 Thread Eric Anholt
Connor Abbott writes: > Hi Eric, > > A general suggestion: > > I think that we should rename these functions to "nir_op_create()" so > that we can make a more specific "nir_op()" function that takes and > returns a nir_ssa_def *, so that we can do stuff like: > > nir_builder *b = ... > > nir_ssa_

Re: [Mesa-dev] [PATCH] nir: Add variants of some of the comparison simplifications.

2015-01-28 Thread Eric Anholt
Jason Ekstrand writes: > I've got a patch I cooked up today that generalizes this a bit. I haven't > sent it yet because it lacks shader-db statistics. That said, I'm fine > with merging this in the mean time. Not sure what generalization you're working on, but something that let me have "any

Re: [Mesa-dev] killing off the address reg in tgsi

2015-01-29 Thread Eric Anholt
Roland Scheidegger writes: > Hi, > > the address reg in tgsi is quite a nuisance. glsl-to-tgsi code assumes > that indirections can only be done through the address reg and has quite > some extra code to deal with this. Even though hardware and apis which > worked like that are definitely old by

[Mesa-dev] [PATCH] nir: Add an ALU op builder kind of like ir_builder.h

2015-01-30 Thread Eric Anholt
v2: Rebase on the nir_opcodes.h python code generation support. v3: Use SSA values, and set an appropriate writemask on dot products. v4: Make the arguments be SSA references as well. This lets you stack up expressions in the arguments of other expressions, at the cost of having to insert

[Mesa-dev] [PATCH 3/9] nir: Add lowering of POW instructions if the lower flag is set.

2015-02-01 Thread Eric Anholt
This could be done in a separate pass like we do in GLSL IR, but it seems to me like having the definitions of the transformations in the two directions next to each other makes a lot of sense. --- src/glsl/nir/nir_opt_algebraic.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/glsl/nir/n

[Mesa-dev] [PATCH 5/9] nir: Add a flag for lowering fneg/ineg.

2015-02-01 Thread Eric Anholt
vc4 cse/algebraic-disabled stats: total instructions in shared programs: 44911 -> 44732 (-0.40%) instructions in affected programs: 11371 -> 11192 (-1.57%) --- src/gallium/drivers/vc4/vc4_program.c | 1 + src/glsl/nir/nir.h| 2 ++ src/glsl/nir/nir_opt_algebraic.py | 1

[Mesa-dev] [PATCH 2/9] nir: Conditionalize the POW reconstruction on shader compiler options.

2015-02-01 Thread Eric Anholt
Mesa has a shader compiler struct flagging whether GLSL IR's opt_algebraic and other passes should try and generate certain types of opcodes or patterns. Extend that to NIR by defining our own struct, which is automatically generated from the Mesa struct in glsl_to_nir and provided directly by the

[Mesa-dev] Target-aware nir_opt_algebraic.

2015-02-01 Thread Eric Anholt
I'm pretty happy with how it turned out. What I'm not sure on is that I've got a couple of places where I replicated another transformation, like fsat(fsat(a)) -> fsat(a) but with a lowered fsat. I could see potentially having only the canonical form appear in nir_opt_algebraic, and I'd have two

[Mesa-dev] [PATCH 4/9] nir: Add a flag for lowering fsqrt(x) to frcp(frsqrt(x)).

2015-02-01 Thread Eric Anholt
vc4 cse/algebraic-disabled stats: total uniforms in shared programs: 13972 -> 13966 (-0.04%) uniforms in affected programs: 408 -> 402 (-1.47%) total instructions in shared programs: 44973 -> 44911 (-0.14%) instructions in affected programs: 1551 -> 1489 (-4.00%) --- src/gallium/drivers/vc

[Mesa-dev] [PATCH 9/9] nir: Recognize and reduce duplicated fsats.

2015-02-01 Thread Eric Anholt
No effect on vc4 shader-db. --- src/glsl/nir/nir_opt_algebraic.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/glsl/nir/nir_opt_algebraic.py b/src/glsl/nir/nir_opt_algebraic.py index 9542ef3..fc7e47c 100644 --- a/src/glsl/nir/nir_opt_algebraic.py +++ b/src/glsl/nir/nir_opt_algebraic.

[Mesa-dev] [PATCH 7/9] nir: Fix broken fsat recognizer.

2015-02-01 Thread Eric Anholt
We've probably never seen this ridiculous pattern in the wild, so it didn't matter. --- src/glsl/nir/nir_opt_algebraic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glsl/nir/nir_opt_algebraic.py b/src/glsl/nir/nir_opt_algebraic.py index 8a14fe0..84c60ec 100644 --- a/s

[Mesa-dev] [PATCH 1/9] nir: Slightly simplify algebraic code generation by reusing a struct.

2015-02-01 Thread Eric Anholt
--- src/glsl/nir/nir_algebraic.py | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/glsl/nir/nir_algebraic.py b/src/glsl/nir/nir_algebraic.py index ea7f5fc..4929745 100644 --- a/src/glsl/nir/nir_algebraic.py +++ b/src/glsl/nir/nir_algebraic.py @@ -179,10 +179,7 @@ st

[Mesa-dev] [PATCH 8/9] nir: Add a flag for lowering fsat.

2015-02-01 Thread Eric Anholt
vc4 cse/algebraic-disabled stats: total instructions in shared programs: 44356 -> 44354 (-0.00%) instructions in affected programs: 55 -> 53 (-3.64%) --- src/gallium/drivers/vc4/vc4_program.c | 1 + src/glsl/nir/nir.h| 1 + src/glsl/nir/nir_opt_algebraic.py | 3 ++- 3 f

[Mesa-dev] [PATCH 6/9] nir: Add a flag for lowering ffma.

2015-02-01 Thread Eric Anholt
vc4 cse/algebraic-disabled stats: total uniforms in shared programs: 13966 -> 13791 (-1.25%) uniforms in affected programs: 435 -> 260 (-40.23%) total instructions in shared programs: 44732 -> 44356 (-0.84%) instructions in affected programs: 9599 -> 9223 (-3.92%) --- src/gallium/drivers/v

Re: [Mesa-dev] [PATCH 7/9] nir: Fix broken fsat recognizer.

2015-02-01 Thread Eric Anholt
Connor Abbott writes: > On Sun, Feb 1, 2015 at 4:17 PM, Eric Anholt wrote: >> We've probably never seen this ridiculous pattern in the wild, so it >> didn't matter. > > I don't think this pattern is 'ridiculous' at all -- GLSL doesn't have >

Re: [Mesa-dev] Naming conventions, DSA, and meta

2015-02-02 Thread Eric Anholt
Jason Ekstrand writes: > Hi all, > I wanted to send out a quick message about naming conventions for mesa > entrypoints and dd table fallbacks. There has been some confusion and > disagreement about this with some of the stuff Laura has been doing to > implement DSA. Instead of side-track one o

[Mesa-dev] [PATCH 1/2] gallium/ureg: Move ureg_dst_register() to the header.

2015-02-02 Thread Eric Anholt
I wanted to use it for nir-to-tgsi. The equivalent ureg_src_register() is also located here. --- src/gallium/auxiliary/tgsi/tgsi_ureg.c | 28 src/gallium/auxiliary/tgsi/tgsi_ureg.h | 25 + 2 files changed, 25 insertions(+), 28 deletions(-) dif

[Mesa-dev] [PATCH 2/2] gallium/ureg: Add missing some missing opcodes opcode_tmp.h

2015-02-02 Thread Eric Anholt
I wanted all of these for NIR-to-TGSI. --- src/gallium/auxiliary/tgsi/tgsi_opcode_tmp.h | 4 1 file changed, 4 insertions(+) diff --git a/src/gallium/auxiliary/tgsi/tgsi_opcode_tmp.h b/src/gallium/auxiliary/tgsi/tgsi_opcode_tmp.h index 147d989..d8752ce 100644 --- a/src/gallium/auxiliary/tgs

Re: [Mesa-dev] [PATCH] Revert "fs-discard-exit-3: New test for another bug in handling 1.30's discard rule."

2015-02-02 Thread Eric Anholt
Francisco Jerez writes: > Eric Anholt writes: > >> Francisco Jerez writes: >> >>> This reverts commit 3fad0868f023f1d726e230968a4df3327de38823. >>> >>> This test doesn't make any sense to me, it begins quoting the GLSL >>> 1.30 spec

Re: [Mesa-dev] Naming conventions, DSA, and meta

2015-02-02 Thread Eric Anholt
Thomas Helland writes: > 2015-02-02 19:18 GMT+01:00 Jason Ekstrand : >> Hi all, >> I wanted to send out a quick message about naming conventions for mesa >> entrypoints and dd table fallbacks. There has been some confusion and >> disagreement about this with some of the stuff Laura has been doin

Re: [Mesa-dev] [PATCH 2/2] gallium/ureg: Add missing some missing opcodes opcode_tmp.h

2015-02-02 Thread Eric Anholt
Roland Scheidegger writes: > Am 02.02.2015 um 20:39 schrieb Eric Anholt: >> I wanted all of these for NIR-to-TGSI. >> --- >> src/gallium/auxiliary/tgsi/tgsi_opcode_tmp.h | 4 >> 1 file changed, 4 insertions(+) >> >> diff --git a/src/gallium/aux

Re: [Mesa-dev] [PATCH 3/9] nir: Add lowering of POW instructions if the lower flag is set.

2015-02-02 Thread Eric Anholt
Erik Faye-Lund writes: > On Sun, Feb 1, 2015 at 10:17 PM, Eric Anholt wrote: >> This could be done in a separate pass like we do in GLSL IR, but it seems >> to me like having the definitions of the transformations in the two >> directions next to each other makes a lot of

[Mesa-dev] [PATCH 1/3] nir: Add a nir_shader_compiler_options struct pointed to by the shaders.

2015-02-02 Thread Eric Anholt
This will be used to give the optimization passes a chance to customize behavior for the particular target device. --- I had things as one giant patch before because I thought you couldn't have a struct with no members, and having a temporary version with a dummy member seemed ugly. Turns out you

[Mesa-dev] [PATCH 2/3] nir: Add an optional expression controlling nir_algebraic xforms.

2015-02-02 Thread Eric Anholt
This will be used so that we can customize the transforms for the target GPU, so we don't un-lower expressions that had already been lowered (or introduce new lowering transformations that not all GPUs want) --- src/glsl/nir/nir_algebraic.py | 44 --- 1 file

[Mesa-dev] [PATCH 3/3] nir: Conditionalize the POW reconstruction on shader compiler options.

2015-02-02 Thread Eric Anholt
Mesa has a shader compiler struct flagging whether GLSL IR's opt_algebraic and other passes should try and generate certain types of opcodes or patterns. Extend that to NIR by defining our own struct, which is automatically generated from the Mesa struct in glsl_to_nir and provided directly by the

Re: [Mesa-dev] [PATCH] nir: Add an ALU op builder kind of like ir_builder.h

2015-02-02 Thread Eric Anholt
Connor Abbott writes: > I mentioned this on IRC, but it would be good to add the ability to > append the sequence of instructions before/after an instruction as > well as at the beginning or end of a basic block. We would need to > store the current basic block, the current instruction, and an en

Re: [Mesa-dev] [PATCH 2/9] nir: Conditionalize the POW reconstruction on shader compiler options.

2015-02-02 Thread Eric Anholt
Connor Abbott writes: > A few comments here... > > 1. We should really split this up into a patch that adds > nir_shader_compiler_options (which would be empty at this point) and > the nir_algebraic infrastructure for conditionalizing transforms > (actually, maybe we should split these up into tw

Re: [Mesa-dev] [PATCH 5/9] nir: Add a flag for lowering fneg/ineg.

2015-02-03 Thread Eric Anholt
Connor Abbott writes: > I think this logic should be flipped around... you should have a flag > 'lower_sub' which is false for vc4 but true for i965, and then if the > flag is true we lower sub to add+neg and if false we try and > reconstruct sub (and do other things like pulling neg's out of > m

[Mesa-dev] [PATCH v6] nir: Add an ALU op builder kind of like ir_builder.h

2015-02-06 Thread Eric Anholt
v2: Rebase on the nir_opcodes.h python code generation support. v3: Use SSA values, and set an appropriate writemask on dot products. v4: Make the arguments be SSA references as well. This lets you stack up expressions in the arguments of other expressions, at the cost of having to insert

Re: [Mesa-dev] [PATCH 1/3] util/hash_table: Do a full search when adding new items

2015-02-06 Thread Eric Anholt
ming to the other repo. Series is: Reviewed-by: Eric Anholt signature.asc Description: PGP signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH 3/3] nir: Add algebraic optimizations for comparisons with identical operands.

2015-02-06 Thread Eric Anholt
No change on shader-db on i965. --- src/glsl/nir/nir_opt_algebraic.py | 9 + 1 file changed, 9 insertions(+) diff --git a/src/glsl/nir/nir_opt_algebraic.py b/src/glsl/nir/nir_opt_algebraic.py index a5fe19a..0512a8f 100644 --- a/src/glsl/nir/nir_opt_algebraic.py +++ b/src/glsl/nir/nir_opt

[Mesa-dev] [PATCH 1/3] nir: Add support for CSE on textures.

2015-02-06 Thread Eric Anholt
NIR instruction count results on i965: total instructions in shared programs: 1261954 -> 1261937 (-0.00%) instructions in affected programs: 455 -> 438 (-3.74%) One in yofrankie, two in tropics. Apparently i965 had also optimized all of these out anyway. --- src/glsl/nir/nir_opt_cse.c | 43 +

[Mesa-dev] [PATCH 2/3] nir: Fix load_const comparisons for CSE.

2015-02-06 Thread Eric Anholt
We want the size of a float per component, not the size of a whole vec4. NIR instructions on i965: total instructions in shared programs: 1261937 -> 1261929 (-0.00%) instructions in affected programs: 114 -> 106 (-7.02%) Looking at one of these examples (tesseract), it's from vec4 load_consts

Re: [Mesa-dev] [PATCH 1/3] nir: Add support for CSE on textures.

2015-02-10 Thread Eric Anholt
Connor Abbott writes: > On Sat, Feb 7, 2015 at 12:16 AM, Eric Anholt wrote: >> NIR instruction count results on i965: >> total instructions in shared programs: 1261954 -> 1261937 (-0.00%) >> instructions in affected programs: 455 -> 438 (-3.74%) >> &g

Re: [Mesa-dev] [PATCH] program: Remove _mesa_nop_vertex_program/_mesa_nop_fragment_program.

2015-02-11 Thread Eric Anholt
Kenneth Graunke writes: > On Tuesday, February 10, 2015 08:08:38 PM Matt Turner wrote: >> Dead since >> >>commit 284ce20901b0c2cfab1d952cc129b8f3cd068f12 >>Author: Eric Anholt >>Date: Fri Aug 20 10:52:14 2010 -0700 >> >>

Re: [Mesa-dev] [PATCH 1/3] nir: Add support for CSE on textures.

2015-02-11 Thread Eric Anholt
Connor Abbott writes: > On Tue, Feb 10, 2015 at 1:32 PM, Eric Anholt wrote: >> Connor Abbott writes: >> >>> On Sat, Feb 7, 2015 at 12:16 AM, Eric Anholt wrote: >>>> NIR instruction count results on i965: >>>> total instructions in shared program

Re: [Mesa-dev] [PATCH 1/3] nir: Add support for CSE on textures.

2015-02-11 Thread Eric Anholt
Connor Abbott writes: > On Wed, Feb 11, 2015 at 2:36 PM, Eric Anholt wrote: >> Connor Abbott writes: >> >>> On Tue, Feb 10, 2015 at 1:32 PM, Eric Anholt wrote: >>>> Connor Abbott writes: >>>> >>>>> On Sat, Feb 7, 2015 at 12:16

[Mesa-dev] [PATCH] nir: Zero-init our structures.

2015-02-11 Thread Eric Anholt
We were filling out almost all fields of almost all instructions, but leaving out a couple of them. This simplifies the source code, cuts 700 bytes from the compiled binary, and prevents developer surprise when one field of your otherwise-containing-defaults struct is actually uninitialized. ---

[Mesa-dev] [PATCH 5/5] r200: Drop unused variable.

2015-02-11 Thread Eric Anholt
Quiets compiler warning since e7f2f2dea5acdbd1a12ed88914e64a38a97432f0. --- src/mesa/drivers/dri/r200/r200_ioctl.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mesa/drivers/dri/r200/r200_ioctl.c b/src/mesa/drivers/dri/r200/r200_ioctl.c index 515be92..d665c8b 100644 --- a/src/mesa/driver

[Mesa-dev] [PATCH 3/5] i965: Move some asserts to unreachable.

2015-02-11 Thread Eric Anholt
If execution was supposed to be supported in this case, we'd run into trouble from completely uninitialized sat_imm values. Shuts up compiler warnings. --- src/mesa/drivers/dri/i965/brw_shader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/br

[Mesa-dev] [PATCH 1/5] gallium/dri: Shut up a compiler warning.

2015-02-11 Thread Eric Anholt
The compiler doesn't see that buffers is set in the !image case and used in the !image case. --- src/gallium/state_trackers/dri/dri2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c index aecc8eb..7

[Mesa-dev] [PATCH 2/5] i965: Shut up a compiler warning about uninitialized var.

2015-02-11 Thread Eric Anholt
We always pass this argument, even if it won't be used by the particular texture op. --- 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 da81b61..

[Mesa-dev] [PATCH 4/5] i965: Quiet another compiler warning about uninitialized values.

2015-02-11 Thread Eric Anholt
The compiler can't tell that we're always going to hit the first if block on the first time through the loop. --- src/mesa/drivers/dri/i965/brw_vec4.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_v

[Mesa-dev] [PATCH 2/7] gallium/util: Don't include unused debug functions from u_math.h

2015-02-11 Thread Eric Anholt
It introduces references to gallium util/ symbols which means we don't get to include it from outside-of-gallium code. --- src/gallium/auxiliary/util/u_math.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h index 5db5b66

[Mesa-dev] [PATCH 6/7] glsl: Only include mtypes from glsl_types.h for the C++ code that needs it.

2015-02-11 Thread Eric Anholt
It's used in one of the methods, not in the structure definitions. --- src/glsl/glsl_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h index 441015c..74a038a 100644 --- a/src/glsl/glsl_types.h +++ b/src/glsl/glsl_types.h @@ -2

[Mesa-dev] [PATCH 1/7] mesa: Add gallium include dirs to more parts of the tree.

2015-02-11 Thread Eric Anholt
--- src/glsl/Makefile.am | 2 ++ src/mesa/drivers/dri/common/Makefile.am | 2 ++ src/mesa/drivers/dri/i915/Makefile.am| 2 ++ src/mesa/drivers/dri/i965/Makefile.am| 2 ++ src/mesa/drivers/dri/nouveau/Makefile.am | 2 ++ src/mesa/drivers/dri/r200/Makefile.am| 2 ++

[Mesa-dev] gallium includes from Mesa, nir.h stops using Mesa main.

2015-02-11 Thread Eric Anholt
OK, I think this is kind of the next step from the gallium-versus-mesa includes discussion earlier: Accept that u_math.h is an OK name, and the parent directory is OK, too, and just start sharing code. Once that's in place, I can get bitset.h out of Mesa main and into util/, so that nir.h doesn't

[Mesa-dev] [PATCH 5/7] util: Move Mesa's bitset.h to util/.

2015-02-11 Thread Eric Anholt
--- src/glsl/nir/nir.h | 2 +- src/mesa/Makefile.sources | 1 - .../drivers/dri/i965/brw_fs_copy_propagation.cpp | 2 +- src/mesa/drivers/dri/i965/brw_fs_live_variables.h | 2 +- .../drivers/dri/i965/brw_performance_monitor.c | 2

[Mesa-dev] [PATCH 4/7] mesa: Make bitset.h not rely on Mesa-specific types and functions.

2015-02-11 Thread Eric Anholt
Note that we can't use u_math.h's align() because it's a function instead of a macro, while BITSET_DECLARE needs a constant expression for nouveau's usage in global declarations. --- src/mesa/main/bitset.h | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mesa/main/bit

[Mesa-dev] [PATCH 3/7] mesa: Use u_math.h from macros.h

2015-02-11 Thread Eric Anholt
This avoids duplication of some macros and other definitions across the tree. Note that COPY_4FV switches from a memcpy-based implementation to an assignment of 4 floats. --- src/mesa/drivers/dri/i915/intel_tris.c | 6 -- src/mesa/drivers/dri/nouveau/nouveau_util.h | 6 -- src/mesa

[Mesa-dev] [PATCH 7/7] mesa: Drop dependency on mtypes.h for core NIR.

2015-02-11 Thread Eric Anholt
One less new directory necessary for gallium code that wants to interact with NIR. --- src/glsl/nir/nir.h | 4 +++- src/glsl/nir/nir_lower_atomics.c | 1 + src/glsl/nir/nir_lower_system_values.c | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/glsl

  1   2   3   4   5   6   7   8   9   10   >