Re: [Mesa-dev] [PATCH] nir: fix sampler lowering pass for arrays

2015-05-08 Thread Tapani Pälli
On 05/08/2015 09:56 AM, Pohjolainen, Topi wrote: On Fri, May 08, 2015 at 09:51:54AM +0300, Tapani P?lli wrote: This fixes bugs with special cases where we have arrays of structures containing samplers or arrays of samplers. I've verified that patch results in calculating same index value as r

Re: [Mesa-dev] [PATCH v2 1/6] mesa/es3.1: enable GL_ARB_shader_image_load_store for gles3.1

2015-05-08 Thread marta . lofstedt
> > > On 05/08/2015 12:13 AM, Ian Romanick wrote: >> On 05/07/2015 12:57 AM, Marta Lofstedt wrote: >>> From: Marta Lofstedt >>> >>> v2: only expose enums from GL_ARB_shader_image_load_store >>> for gles 3.1 and GL core >>> >>> Signed-off-by: Marta Lofstedt >>> --- >>> src/mesa/main/get.c

Re: [Mesa-dev] [PATCH] i965: Use NIR by default for vertex shaders on GEN8+

2015-05-08 Thread Kenneth Graunke
On Thursday, May 07, 2015 06:17:46 PM Matt Turner wrote: > On Thu, May 7, 2015 at 4:50 PM, Jason Ekstrand wrote: > > GLSL IR vs. NIR shader-db results for SIMD8 vertex shaders on Broadwell: > > > >total instructions in shared programs: 2724483 -> 2711790 (-0.47%) > >instructions in affecte

Re: [Mesa-dev] [PATCH] main: glGetIntegeri_v fails for GL_VERTEX_BINDING_STRIDE

2015-05-08 Thread Tapani Pälli
That is strange, it was introduced in fb370f89d but then has gone missing .. Reviewed-by: Tapani Pälli On 05/07/2015 06:13 PM, Marta Lofstedt wrote: The return type for GL_VERTEX_BINDING_STRIDE is missing, this cause glGetIntegeri_v to fail. Signed-off-by: Marta Lofstedt --- src/mesa/main

[Mesa-dev] [RFC PATCH] nir: Transform 4*x into x << 2 during late optimizations.

2015-05-08 Thread Kenneth Graunke
According to Glenn, shifts on R600 have 5x the throughput as multiplies. Intel GPUs have strange integer multiplication restrictions - on most hardware, MUL actually only does a 32-bit x 16-bit multiply. This means the arguments aren't commutative, which can limit our constant propagation options

Re: [Mesa-dev] [PATCH 03/27] i965: Enable hardware-generated binding tables on render path.

2015-05-08 Thread Abdiel Janulgue
On 05/07/2015 05:46 PM, Pohjolainen, Topi wrote: > On Thu, May 07, 2015 at 04:43:21PM +0300, Pohjolainen, Topi wrote: >> On Tue, Apr 28, 2015 at 11:08:00PM +0300, Abdiel Janulgue wrote: >>> This patch implements the binding table enable command which is also >>> used to allocate a binding table p

Re: [Mesa-dev] [PATCH 26/27] i965: Disable gather push constants for null constants

2015-05-08 Thread Abdiel Janulgue
On 05/07/2015 05:48 PM, Pohjolainen, Topi wrote: > On Tue, Apr 28, 2015 at 11:08:23PM +0300, Abdiel Janulgue wrote: >> Programming null constants with gather constant tables seems to >> be unsupported and results in a GPU lockup even with the prescribed >> GPU workarounds in the bspec. Found out

Re: [Mesa-dev] [PATCH 03/27] i965: Enable hardware-generated binding tables on render path.

2015-05-08 Thread Abdiel Janulgue
On 05/07/2015 04:43 PM, Pohjolainen, Topi wrote: > On Tue, Apr 28, 2015 at 11:08:00PM +0300, Abdiel Janulgue wrote: >> This patch implements the binding table enable command which is also >> used to allocate a binding table pool where hardware-generated >> binding table entries are flushed into.

Re: [Mesa-dev] [PATCH 13/13] mesa/main: Verify context creation on progress

2015-05-08 Thread Juha-Pekka Heikkilä
perjantai 8. toukokuuta 2015 Ian Romanick kirjoitti: > On 05/07/2015 05:21 AM, Pohjolainen, Topi wrote: > > On Tue, May 05, 2015 at 02:25:29PM +0300, Juha-Pekka Heikkila wrote: > >> Stop context creation if something failed. If something errored > >> during context creation we'd segfault. Now wil

Re: [Mesa-dev] [PATCH 11/27] i965: Store gather table information in the program data

2015-05-08 Thread Abdiel Janulgue
On 05/07/2015 06:17 PM, Pohjolainen, Topi wrote: > On Tue, Apr 28, 2015 at 11:08:08PM +0300, Abdiel Janulgue wrote: >> The resource streamer is able to gather and pack sparsely-located >> constant data from any buffer object by a referring to a gather table >> This patch adds support for keeping

Re: [Mesa-dev] [PATCH 13/13] mesa/main: Verify context creation on progress

2015-05-08 Thread Pohjolainen, Topi
On Fri, May 08, 2015 at 03:23:52PM +0300, Juha-Pekka Heikkil? wrote: >perjantai 8. toukokuuta 2015 Ian Romanick kirjoitti: > > On 05/07/2015 05:21 AM, Pohjolainen, Topi wrote: > > On Tue, May 05, 2015 at 02:25:29PM +0300, Juha-Pekka Heikkila wrote: > >> Stop context creation if

Re: [Mesa-dev] [PATCH 7/9] egl/wayland: assume EGL_WINDOW_BIT

2015-05-08 Thread Axel Davy
Le 06/05/2015 03:00, Dave Airlie a écrit : On 2 May 2015 at 20:15, Axel Davy wrote: Only EGL_WINDOW_BIT is supported. Remove tests related. Is this there no plans to support pixmap/pbuffer/ or any of the other bits? Seems like a step in the wrong direction if we really should be supporting ot

Re: [Mesa-dev] [PATCH 4/5] nir: Translate image load, store and atomic intrinsics from GLSL IR.

2015-05-08 Thread Francisco Jerez
Connor Abbott writes: > On Tue, May 5, 2015 at 4:29 PM, Francisco Jerez wrote: >> --- >> src/glsl/nir/glsl_to_nir.cpp | 125 >> +++ >> 1 file changed, 114 insertions(+), 11 deletions(-) >> >> diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_

Re: [Mesa-dev] [PATCH 1/5] nir: Define image load, store and atomic intrinsics.

2015-05-08 Thread Francisco Jerez
Connor Abbott writes: > On IRC, Ken and I were discussing using a scheme inspired by SPIR-V, > which has an OpImagePointer instruction that forms a pointer to the > particular texel of the image as well as > OpAtomic{Load,Store,Exchange,etc.} that operate on an image or shared > buffer pointer. T

Re: [Mesa-dev] Mesa 10.6 release plan

2015-05-08 Thread Emil Velikov
Hello all, On 21 April 2015 at 13:40, Emil Velikov wrote: > Hi all, > > Here is the preliminary release schedule for Mesa 10.6. Personally I > would love if we can go up to Mesa 11.0 (Spinal Tap anyone ?) although > it might happen with the September release. > > May 15th 2015 - Feature freeze/Re

Re: [Mesa-dev] [PATCH 1/9] egl/wayland: properly destroy wayland objects

2015-05-08 Thread Emil Velikov
On 2 May 2015 at 11:15, Axel Davy wrote: > the wl_registry and the wl_queue allocated weren't destroyed. > Would this have any affect other than leaking memory ? If so can you please add the mesa-stable tag (prior to pushing). Thanks Emil ___ mesa-dev m

Re: [Mesa-dev] [PATCH 3/9] glx/dri3: Add additional check for gpu offloading case

2015-05-08 Thread Emil Velikov
On 2 May 2015 at 11:15, Axel Davy wrote: > Checks blitImage is implemented. > Initially having the __DRIimageExtension extension > at version 9 at least meant blitImage was supported. > However some implementations do advertise version >= 9 > without implementing it. > Afaict in the above mentione

[Mesa-dev] [PATCH] nir/search: handle explicitly sized sources in match_value

2015-05-08 Thread Jason Ekstrand
Previously, this case was being handled in match_expression prior to calling match_value. However, there is really no good reason for this given that match_value has all of the information it needs. Also, they weren't being handled properly in the commutative case and putting it in match_value gi

Re: [Mesa-dev] [PATCH 4/9] egl/wayland: Add support for render-nodes

2015-05-08 Thread Emil Velikov
On 2 May 2015 at 11:15, Axel Davy wrote: > It is possible the server advertises a render-node. > In that case no authentication is needed, > and Gem names are forbidden. > > Signed-off-by: Axel Davy > --- > diff --git a/src/egl/drivers/dri2/platform_wayland.c > b/src/egl/drivers/dri2/platform_w

Re: [Mesa-dev] [PATCH 4/5] nir: Translate image load, store and atomic intrinsics from GLSL IR.

2015-05-08 Thread Connor Abbott
On Fri, May 8, 2015 at 10:30 AM, Francisco Jerez wrote: > Connor Abbott writes: > >> On Tue, May 5, 2015 at 4:29 PM, Francisco Jerez >> wrote: >>> --- >>> src/glsl/nir/glsl_to_nir.cpp | 125 >>> +++ >>> 1 file changed, 114 insertions(+), 11 deletions(-)

[Mesa-dev] [PATCHv2 4/5] nir: Translate image load, store and atomic intrinsics from GLSL IR.

2015-05-08 Thread Francisco Jerez
v2: Undefine coordinate components not applicable to the target. --- src/glsl/nir/glsl_to_nir.cpp | 126 +++ 1 file changed, 115 insertions(+), 11 deletions(-) diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp index f6b8331..fab4508

Re: [Mesa-dev] [PATCH] nir/search: handle explicitly sized sources in match_value

2015-05-08 Thread Connor Abbott
Makes sense. Reviewed-by: Connor Abbott On Fri, May 8, 2015 at 11:38 AM, Jason Ekstrand wrote: > Previously, this case was being handled in match_expression prior to > calling match_value. However, there is really no good reason for this > given that match_value has all of the information it n

Re: [Mesa-dev] [PATCHv2 4/5] nir: Translate image load, store and atomic intrinsics from GLSL IR.

2015-05-08 Thread Connor Abbott
Update the comment in patch 1, and the entire thing is Reviewed-by: Connor Abbott On Fri, May 8, 2015 at 12:40 PM, Francisco Jerez wrote: > v2: Undefine coordinate components not applicable to the target. > > --- > src/glsl/nir/glsl_to_nir.cpp | 126 > +++--

Re: [Mesa-dev] [PATCH 5/9] egl/wayland: Implement DRI_PRIME support

2015-05-08 Thread Emil Velikov
On 2 May 2015 at 11:15, Axel Davy wrote: > When the server gpu and requested gpu are different: > . They likely don't support the same tiling modes > . They likely do not have fast access to the same locations > > Thus we do: > . render to a tiled buffer we do not share with the server > . Copy th

[Mesa-dev] [PATCH] i965/fs_nir: Put the immediate in src1 for commutative ALU ops

2015-05-08 Thread Jason Ekstrand
Shader-db results for fragment shaders on Broadwell: total instructions in shared programs: 4310987 -> 4310663 (-0.01%) instructions in affected programs: 43242 -> 42918 (-0.75%) helped:142 HURT: 0 Shader-db results

Re: [Mesa-dev] [RFC PATCH] nir: Transform 4*x into x << 2 during late optimizations.

2015-05-08 Thread Jason Ekstrand
On Fri, May 8, 2015 at 3:36 AM, Kenneth Graunke wrote: > According to Glenn, shifts on R600 have 5x the throughput as multiplies. > > Intel GPUs have strange integer multiplication restrictions - on most > hardware, MUL actually only does a 32-bit x 16-bit multiply. This > means the arguments are

Re: [Mesa-dev] [PATCH] i965: Use NIR by default for vertex shaders on GEN8+

2015-05-08 Thread Jason Ekstrand
On Fri, May 8, 2015 at 3:27 AM, Kenneth Graunke wrote: > On Thursday, May 07, 2015 06:17:46 PM Matt Turner wrote: >> On Thu, May 7, 2015 at 4:50 PM, Jason Ekstrand wrote: >> > GLSL IR vs. NIR shader-db results for SIMD8 vertex shaders on Broadwell: >> > >> >total instructions in shared progra

[Mesa-dev] [PATCH] i965/fs: Disable opt_sampler_eot for textureGather

2015-05-08 Thread Neil Roberts
The opt_sampler_eot optimisation seems to break when the last instruction is SHADER_OPCODE_TG4. A bunch of Piglit tests end up doing this so it causes a lot of regressions. I can't find any documentation or known workarounds to indicate that this is expected behaviour, but considering that this is

Re: [Mesa-dev] [PATCH] i965/fs_nir: Put the immediate in src1 for commutative ALU ops

2015-05-08 Thread Matt Turner
On Fri, May 8, 2015 at 10:04 AM, Jason Ekstrand wrote: > Shader-db results for fragment shaders on Broadwell: > >total instructions in shared programs: 4310987 -> 4310663 (-0.01%) >instructions in affected programs: 43242 -> 42918 (-0.75%) >helped:14

Re: [Mesa-dev] [PATCH] i965/fs_nir: Put the immediate in src1 for commutative ALU ops

2015-05-08 Thread Matt Turner
On Fri, May 8, 2015 at 10:04 AM, Jason Ekstrand wrote: > Shader-db results for fragment shaders on Broadwell: > >total instructions in shared programs: 4310987 -> 4310663 (-0.01%) >instructions in affected programs: 43242 -> 42918 (-0.75%) >helped:14

Re: [Mesa-dev] [PATCH] i965: Use NIR by default for vertex shaders on GEN8+

2015-05-08 Thread Matt Turner
On Fri, May 8, 2015 at 10:08 AM, Jason Ekstrand wrote: > On Fri, May 8, 2015 at 3:27 AM, Kenneth Graunke wrote: >> On Thursday, May 07, 2015 06:17:46 PM Matt Turner wrote: >>> On Thu, May 7, 2015 at 4:50 PM, Jason Ekstrand wrote: >>> > GLSL IR vs. NIR shader-db results for SIMD8 vertex shaders o

Re: [Mesa-dev] [PATCH 9/9] egl/swrast: enable config extension for swrast

2015-05-08 Thread Emil Velikov
On 2 May 2015 at 11:15, Axel Davy wrote: > Enables to use dri config for swrast, like vblank_mode. > > Signed-off-by: Axel Davy > --- > src/egl/drivers/dri2/egl_dri2.c| 21 ++--- > src/gallium/state_trackers/dri/drisw.c | 1 + > src/mesa/drivers/dri/swrast/swrast.c |

Re: [Mesa-dev] [PATCH 5/9] egl/wayland: Implement DRI_PRIME support

2015-05-08 Thread Emil Velikov
On 8 May 2015 at 18:06, Axel Davy wrote: > On Fri, 8 May 2015, Emil Velikov wrote: > >> Shouldn't we authenticate with the correct gpu or master/render node ? >> This implementation will auth with GPU1, and then use GPU2 which seems >> a bit odd. I might be missing something ? >> >> > > The origin

Re: [Mesa-dev] [PATCH 7/9] egl/wayland: assume EGL_WINDOW_BIT

2015-05-08 Thread Emil Velikov
On 8 May 2015 at 14:34, Axel Davy wrote: > Le 06/05/2015 03:00, Dave Airlie a écrit : >> >> On 2 May 2015 at 20:15, Axel Davy wrote: >>> >>> Only EGL_WINDOW_BIT is supported. Remove tests related. >> >> Is this there no plans to support pixmap/pbuffer/ or any of the other >> bits? >> >> Seems lik

Re: [Mesa-dev] [PATCH 1/5] clover: Add threadsafe wrappers for pipe_screen and pipe_context

2015-05-08 Thread Francisco Jerez
Tom Stellard writes: > Events can be added to an OpenCL command queue concurrently from > multiple threads, but pipe_context and pipe_screen objects > are not threadsafe. The threadsafe wrappers protect all pipe_screen > and pipe_context function calls with a mutex, so we can safely use > them w

Re: [Mesa-dev] [PATCH] main: glGetIntegeri_v fails for GL_VERTEX_BINDING_STRIDE

2015-05-08 Thread Emil Velikov
On 8 May 2015 at 11:36, Tapani Pälli wrote: > That is strange, it was introduced in fb370f89d but then has gone missing .. > Seems like it broke shortly after it was introduced (around 10.1.0-devel) commit 902f9df36bec7d67a2d8bc4c24d89d9d57964903 Author: Francisco Jerez Date: Mon Nov 25 10:11:

Re: [Mesa-dev] [PATCH] clover: add --with-icd-file-dir option

2015-05-08 Thread Emil Velikov
On 8 May 2015 at 03:10, Michel Dänzer wrote: > On 08.05.2015 03:24, Tom Stellard wrote: >> For this particular situation, I'm happy with any solution that: >> >> 1. Allows a user to install the icd file to /etc if he or she wants to. > > --sysconfdir=/etc > > That covers drirc as well. > > >> 2. D

[Mesa-dev] [PATCH 0/2] i965: Do conditional rendering in hardware

2015-05-08 Thread Neil Roberts
I thought it might be a good idea to try posting these patches again since it's been 6 months since they were originally posted. The patches are a lot more useful now since the command parser in the kernel is working correctly for Haswell. This means the functionality is no longer restricted to onl

[Mesa-dev] [PATCH 2/2 v3] i965: Use predicate enable bit for conditional rendering w/o stalling

2015-05-08 Thread Neil Roberts
Previously whenever a primitive is drawn the driver would call _mesa_check_conditional_render which blocks waiting for the result of the query to determine whether to render. On Gen7+ there is a bit in the 3DPRIMITIVE command which can be used to disable the primitive based on the value of a state

Re: [Mesa-dev] [PATCH] i965/fs_nir: Put the immediate in src1 for commutative ALU ops

2015-05-08 Thread Kenneth Graunke
On Friday, May 08, 2015 10:18:44 AM Matt Turner wrote: > On Fri, May 8, 2015 at 10:04 AM, Jason Ekstrand wrote: > > Shader-db results for fragment shaders on Broadwell: > > > >total instructions in shared programs: 4310987 -> 4310663 (-0.01%) > >instructions in affected programs: 43242

[Mesa-dev] [PATCH 1/2] i965: Store the command parser version number in intel_screen

2015-05-08 Thread Neil Roberts
In order to detect whether the predicate source registers can be used in a later patch we will need to know the version number for the command parser. This patch just adds a member to intel_screen and does an ioctl to get the version. Reviewed-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/in

Re: [Mesa-dev] [RFC PATCH] nir: Transform 4*x into x << 2 during late optimizations.

2015-05-08 Thread Ian Romanick
On 05/08/2015 03:36 AM, Kenneth Graunke wrote: > According to Glenn, shifts on R600 have 5x the throughput as multiplies. > > Intel GPUs have strange integer multiplication restrictions - on most > hardware, MUL actually only does a 32-bit x 16-bit multiply. This > means the arguments aren't comm

Re: [Mesa-dev] [PATCH] i965/fs_nir: Put the immediate in src1 for commutative ALU ops

2015-05-08 Thread Matt Turner
On Fri, May 8, 2015 at 11:05 AM, Kenneth Graunke wrote: > On Friday, May 08, 2015 10:18:44 AM Matt Turner wrote: >> On Fri, May 8, 2015 at 10:04 AM, Jason Ekstrand wrote: >> > Shader-db results for fragment shaders on Broadwell: >> > >> >total instructions in shared programs: 4310987 -> 43106

Re: [Mesa-dev] [PATCH] i965/fs_nir: Put the immediate in src1 for commutative ALU ops

2015-05-08 Thread Jason Ekstrand
On Fri, May 8, 2015 at 11:05 AM, Kenneth Graunke wrote: > On Friday, May 08, 2015 10:18:44 AM Matt Turner wrote: >> On Fri, May 8, 2015 at 10:04 AM, Jason Ekstrand wrote: >> > Shader-db results for fragment shaders on Broadwell: >> > >> >total instructions in shared programs: 4310987 -> 43106

Re: [Mesa-dev] [PATCH 1/5] nir: Define image load, store and atomic intrinsics.

2015-05-08 Thread Kenneth Graunke
On Tuesday, May 05, 2015 11:29:52 PM Francisco Jerez wrote: > --- > src/glsl/nir/nir_intrinsics.h | 27 +++ > 1 file changed, 27 insertions(+) > > diff --git a/src/glsl/nir/nir_intrinsics.h b/src/glsl/nir/nir_intrinsics.h > index 8e28765..4b13c75 100644 > --- a/src/glsl/ni

Re: [Mesa-dev] [PATCH] i965/fs_nir: Put the immediate in src1 for commutative ALU ops

2015-05-08 Thread Matt Turner
On Fri, May 8, 2015 at 11:13 AM, Jason Ekstrand wrote: > On Fri, May 8, 2015 at 11:05 AM, Kenneth Graunke > wrote: >> On Friday, May 08, 2015 10:18:44 AM Matt Turner wrote: >>> On Fri, May 8, 2015 at 10:04 AM, Jason Ekstrand >>> wrote: >>> > Shader-db results for fragment shaders on Broadwell:

Re: [Mesa-dev] [PATCH] i965/fs_nir: Put the immediate in src1 for commutative ALU ops

2015-05-08 Thread Jason Ekstrand
On Fri, May 8, 2015 at 11:15 AM, Matt Turner wrote: > On Fri, May 8, 2015 at 11:13 AM, Jason Ekstrand wrote: >> On Fri, May 8, 2015 at 11:05 AM, Kenneth Graunke >> wrote: >>> On Friday, May 08, 2015 10:18:44 AM Matt Turner wrote: On Fri, May 8, 2015 at 10:04 AM, Jason Ekstrand wrote

Re: [Mesa-dev] [RFC PATCH] nir: Transform 4*x into x << 2 during late optimizations.

2015-05-08 Thread Ilia Mirkin
On Fri, May 8, 2015 at 6:36 AM, Kenneth Graunke wrote: > + # Multiplication by 4 comes up fairly often in indirect offset > calculations. > + # Some GPUs have weird integer multiplication limitations, but shifts > should work > + # equally well everywhere. > + (('imul', 4, a), ('ishl', a

Re: [Mesa-dev] [PATCH 1/5] clover: Add threadsafe wrappers for pipe_screen and pipe_context

2015-05-08 Thread Emil Velikov
Hi Tom, On 8 May 2015 at 00:36, Tom Stellard wrote: > Events can be added to an OpenCL command queue concurrently from > multiple threads, but pipe_context and pipe_screen objects > are not threadsafe. The threadsafe wrappers protect all pipe_screen > and pipe_context function calls with a mutex

Re: [Mesa-dev] [PATCH 2/2 v3] i965: Use predicate enable bit for conditional rendering w/o stalling

2015-05-08 Thread Kenneth Graunke
On Friday, May 08, 2015 07:04:31 PM Neil Roberts wrote: > Previously whenever a primitive is drawn the driver would call > _mesa_check_conditional_render which blocks waiting for the result of > the query to determine whether to render. On Gen7+ there is a bit in > the 3DPRIMITIVE command which can

Re: [Mesa-dev] [PATCH] i965/fs: Disable opt_sampler_eot for textureGather

2015-05-08 Thread Chris Forbes
I don't have CHV or SKL hw or docs to try and confirm this, but this does what it claims to. Reviewed-by: Chris Forbes On Sat, May 9, 2015 at 5:10 AM, Neil Roberts wrote: > The opt_sampler_eot optimisation seems to break when the last > instruction is SHADER_OPCODE_TG4. A bunch of Piglit tests

[Mesa-dev] [PATCH] nir/search: Save/restore the variables_seen bitmask when matching

2015-05-08 Thread Jason Ekstrand
total instructions in shared programs: 7152330 -> 7137006 (-0.21%) instructions in affected programs: 1330548 -> 1315224 (-1.15%) helped:5797 HURT: 76 GAINED:0 LOST:

Re: [Mesa-dev] [PATCH] nir/search: Save/restore the variables_seen bitmask when matching

2015-05-08 Thread Jason Ekstrand
On Fri, May 8, 2015 at 11:53 AM, Jason Ekstrand wrote: > total instructions in shared programs: 7152330 -> 7137006 (-0.21%) > instructions in affected programs: 1330548 -> 1315224 (-1.15%) > helped:5797 > HURT: 76 I'm doing some

Re: [Mesa-dev] [RFC PATCH] nir: Transform 4*x into x << 2 during late optimizations.

2015-05-08 Thread Jason Ekstrand
On Fri, May 8, 2015 at 11:11 AM, Ian Romanick wrote: > On 05/08/2015 03:36 AM, Kenneth Graunke wrote: >> According to Glenn, shifts on R600 have 5x the throughput as multiplies. >> >> Intel GPUs have strange integer multiplication restrictions - on most >> hardware, MUL actually only does a 32-bit

[Mesa-dev] [PATCH] nir/search: Assert that variable id's are in range

2015-05-08 Thread Jason Ekstrand
--- src/glsl/nir/nir_search.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/glsl/nir/nir_search.c b/src/glsl/nir/nir_search.c index 5ba0160..d86655b 100644 --- a/src/glsl/nir/nir_search.c +++ b/src/glsl/nir/nir_search.c @@ -90,6 +90,7 @@ match_value(const nir_search_value *value, nir_alu

Re: [Mesa-dev] [RFC PATCH] nir: Transform 4*x into x << 2 during late optimizations.

2015-05-08 Thread Eric Anholt
Ilia Mirkin writes: > On Fri, May 8, 2015 at 6:36 AM, Kenneth Graunke wrote: >> + # Multiplication by 4 comes up fairly often in indirect offset >> calculations. >> + # Some GPUs have weird integer multiplication limitations, but shifts >> should work >> + # equally well everywhere. >> +

Re: [Mesa-dev] [PATCH] nir: fix sampler lowering pass for arrays

2015-05-08 Thread Jason Ekstrand
Over-all, I think this is on the right track, but I still don't think it's 100% correct. On Fri, May 8, 2015 at 12:04 AM, Tapani Pälli wrote: > > > On 05/08/2015 09:56 AM, Pohjolainen, Topi wrote: >> >> On Fri, May 08, 2015 at 09:51:54AM +0300, Tapani P?lli wrote: >>> >>> This fixes bugs with spe

Re: [Mesa-dev] [PATCH 11/23] glsl/types: add new subroutine type

2015-05-08 Thread Chris Forbes
Patches 11-13 are: Reviewed-by: Chris Forbes On Fri, Apr 24, 2015 at 1:42 PM, Dave Airlie wrote: > From: Dave Airlie > > This type will be used to store the name of subroutine types > > as in subroutine void myfunc(void); > will store myfunc into a subroutine type. > > This is required to the

[Mesa-dev] Stable libEGL ABI ?

2015-05-08 Thread Emil Velikov
Hi all, Just had a quick look at Debian's repo and noticed something rather worrying - the ABI of our libEGL is not stable. Stable in the sense of - we provide a growing list of static symbols for each new function an EGL extension adds. This comes as we set EGL_EGLEXT_PROTOTYPES, prior to includ

Re: [Mesa-dev] [PATCH] nir/search: Save/restore the variables_seen bitmask when matching

2015-05-08 Thread Connor Abbott
On Fri, May 8, 2015 at 2:53 PM, Jason Ekstrand wrote: > total instructions in shared programs: 7152330 -> 7137006 (-0.21%) > instructions in affected programs: 1330548 -> 1315224 (-1.15%) > helped:5797 > HURT: 76 > GAINED:

Re: [Mesa-dev] [PATCH] nir/search: Assert that variable id's are in range

2015-05-08 Thread Connor Abbott
Reviewed-by: Connor Abbott On Fri, May 8, 2015 at 3:13 PM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir_search.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/glsl/nir/nir_search.c b/src/glsl/nir/nir_search.c > index 5ba0160..d86655b 100644 > --- a/src/glsl/nir/nir_search.c > +

Re: [Mesa-dev] [PATCH 4/5] clover: Add a mutex to guard queue::queued_events

2015-05-08 Thread Francisco Jerez
Tom Stellard writes: > This fixes a potential crash where on a sequence like this: > > Thread 0: Check if queue is not empty. > Thread 1: Remove item from queue, making it empty. > Thread 0: Do something assuming queue is not empty. > --- > src/gallium/state_trackers/clover/core/queue.cpp | 2 ++

Re: [Mesa-dev] [PATCH] nir/search: Save/restore the variables_seen bitmask when matching

2015-05-08 Thread Ian Romanick
On 05/08/2015 11:55 AM, Jason Ekstrand wrote: > On Fri, May 8, 2015 at 11:53 AM, Jason Ekstrand wrote: >> total instructions in shared programs: 7152330 -> 7137006 (-0.21%) >> instructions in affected programs: 1330548 -> 1315224 (-1.15%) >> helped:5797 >> HURT:

Re: [Mesa-dev] [PATCH] nir/search: Save/restore the variables_seen bitmask when matching

2015-05-08 Thread Jason Ekstrand
On Fri, May 8, 2015 at 3:20 PM, Ian Romanick wrote: > On 05/08/2015 11:55 AM, Jason Ekstrand wrote: >> On Fri, May 8, 2015 at 11:53 AM, Jason Ekstrand wrote: >>> total instructions in shared programs: 7152330 -> 7137006 (-0.21%) >>> instructions in affected programs: 1330548 -> 1315224 (-1.15

Re: [Mesa-dev] [PATCH] nir/search: Save/restore the variables_seen bitmask when matching

2015-05-08 Thread Ian Romanick
On 05/08/2015 03:25 PM, Jason Ekstrand wrote: > On Fri, May 8, 2015 at 3:20 PM, Ian Romanick wrote: >> On 05/08/2015 11:55 AM, Jason Ekstrand wrote: >>> On Fri, May 8, 2015 at 11:53 AM, Jason Ekstrand >>> wrote: total instructions in shared programs: 7152330 -> 7137006 (-0.21%) instruc

Re: [Mesa-dev] [PATCH] nir/search: Save/restore the variables_seen bitmask when matching

2015-05-08 Thread Ian Romanick
On 05/08/2015 03:31 PM, Ian Romanick wrote: > On 05/08/2015 03:25 PM, Jason Ekstrand wrote: >> On Fri, May 8, 2015 at 3:20 PM, Ian Romanick wrote: >>> On 05/08/2015 11:55 AM, Jason Ekstrand wrote: On Fri, May 8, 2015 at 11:53 AM, Jason Ekstrand wrote: > total instructions in shared

Re: [Mesa-dev] [PATCH] nir/search: Save/restore the variables_seen bitmask when matching

2015-05-08 Thread Jason Ekstrand
On Fri, May 8, 2015 at 3:32 PM, Ian Romanick wrote: > On 05/08/2015 03:31 PM, Ian Romanick wrote: >> On 05/08/2015 03:25 PM, Jason Ekstrand wrote: >>> On Fri, May 8, 2015 at 3:20 PM, Ian Romanick wrote: On 05/08/2015 11:55 AM, Jason Ekstrand wrote: > On Fri, May 8, 2015 at 11:53 AM, Jaso

[Mesa-dev] [PATCH] i965/fs: Add support for removing NOT.NZ and NOT.Z instructions.

2015-05-08 Thread Ian Romanick
From: Ian Romanick Shader-db results: GM45 and Iron Lake: total instructions in shared programs: 7888585 -> 7888585 (0.00%) instructions in affected programs: 0 -> 0 Sandy Bridge, Ivy Bridge, Haswell, and Broadwell: total instructions in shared programs: 9598608 -> 9598572 (-0.00%) instruct

Re: [Mesa-dev] [PATCH] i965/fs: Add support for removing NOT.NZ and NOT.Z instructions.

2015-05-08 Thread Ian Romanick
This was not fully baked. I'll send out a fixed version later. On 05/08/2015 07:05 PM, Ian Romanick wrote: > From: Ian Romanick > > Shader-db results: > > GM45 and Iron Lake: > total instructions in shared programs: 7888585 -> 7888585 (0.00%) > instructions in affected programs: 0 -> 0 >

Re: [Mesa-dev] [xf86-video-nouveau] dri2: Enable BufferAge support

2015-05-08 Thread Mario Kleiner
On 01/19/2015 12:00 PM, Chris Wilson wrote: For enable BufferAge support, we just have to be not using the DRI2Buffer->flags field for any purpose (i.e. it is always expected to be 0, as it is now) and to be sure to swap the flags field whenever we exchange buffers. As nouveau does not exactly

[Mesa-dev] [PATCH 4/9] nir/validate: validate successors at the end of a loop

2015-05-08 Thread Connor Abbott
I found this useful while debugging some control flow bugs while working on the dead control flow pass. Signed-off-by: Connor Abbott --- src/glsl/nir/nir_validate.c | 21 + 1 file changed, 21 insertions(+) diff --git a/src/glsl/nir/nir_validate.c b/src/glsl/nir/nir_validate.

[Mesa-dev] [PATCH 7/9] nir: add a helper for iterating over blocks in a cf node

2015-05-08 Thread Connor Abbott
We were already doing this internally for iterating over a function implementation, so just expose it directly. Signed-off-by: Connor Abbott --- src/glsl/nir/nir.c | 7 +++ src/glsl/nir/nir.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index

[Mesa-dev] [PATCH 0/9] NIR dead control-flow removal

2015-05-08 Thread Connor Abbott
This series implements a bunch of related optimizations that run at once as part of the same pass to eliminate control flow that is useless. This includes both unreachable code and useless loops, i.e. loops that don't compute a result used by the rest of the code. To do this, I needed to change som

[Mesa-dev] [PATCH 1/9] nir/vars_to_ssa: don't rewrite removed instructions

2015-05-08 Thread Connor Abbott
We were rewriting the uses of the intrinsic instruction to point to something else after removing it, which only happened to work since we were lax about having dangling uses when removing instructions. Fix that up. Signed-off-by: Connor Abbott --- src/glsl/nir/nir_lower_vars_to_ssa.c | 3 ++- 1

[Mesa-dev] [PATCH 2/9] nir: insert ssa_undef instructions when cleanup up defs/uses

2015-05-08 Thread Connor Abbott
The point of cleanup_defs_uses() is to make an instruction safe to remove by removing any references that the rest of the shader may have to it. Previously, it was handling register use/def sets and removing the instruction from the use sets of any SSA sources it had, but if the instruction defined

[Mesa-dev] [PATCH 9/9] i965/fs/nir: enable the dead control flow optimization

2015-05-08 Thread Connor Abbott
Doesn't do anything on the public shader-db. Signed-off-by: Connor Abbott --- src/glsl/Makefile.sources | 1 + src/mesa/drivers/dri/i965/brw_nir.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/glsl/Makefile.sources b/src/glsl/Makefile.sources index d784a81..7bdd895 100644

[Mesa-dev] [PATCH 6/9] nir: add nir_block_get_following_loop() helper

2015-05-08 Thread Connor Abbott
Signed-off-by: Connor Abbott --- src/glsl/nir/nir.c | 16 src/glsl/nir/nir.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index efc3f01..e3c37dd 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c @@ -2097,6 +2097,22 @@ nir

[Mesa-dev] [PATCH 8/9] nir/dead_cf: add support for removing useless loops

2015-05-08 Thread Connor Abbott
Signed-off-by: Connor Abbott --- src/glsl/nir/nir_opt_dead_cf.c | 96 -- 1 file changed, 84 insertions(+), 12 deletions(-) diff --git a/src/glsl/nir/nir_opt_dead_cf.c b/src/glsl/nir/nir_opt_dead_cf.c index 17eadbd..f96bf63 100644 --- a/src/glsl/nir/nir_opt

[Mesa-dev] [PATCH 3/9] nir: add an optimization for removing dead control flow

2015-05-08 Thread Connor Abbott
I'm not so sure about where to put the helper currently in nir.c... on the one hand, it's pretty specific to this pass, but on the other hand it needs to do some very fiddly low-level things to the control flow which is why it needs access to a static function in nir.c (stitch_blocks()) that I'd ra

[Mesa-dev] [PATCH 5/9] nir/dead_cf: delete code that's unreachable due to jumps

2015-05-08 Thread Connor Abbott
Signed-off-by: Connor Abbott --- src/glsl/nir/nir_opt_dead_cf.c | 126 ++--- 1 file changed, 118 insertions(+), 8 deletions(-) diff --git a/src/glsl/nir/nir_opt_dead_cf.c b/src/glsl/nir/nir_opt_dead_cf.c index 3fbb794..17eadbd 100644 --- a/src/glsl/nir/nir_opt

[Mesa-dev] [PATCH 3/4] nvc0/ir: optimize set & 1.0 to produce boolean-float sets

2015-05-08 Thread Ilia Mirkin
This has started to happen more now that the backend is producing KILL_IF more often. Signed-off-by: Ilia Mirkin --- .../drivers/nouveau/codegen/nv50_ir_peephole.cpp | 29 ++ .../nouveau/codegen/nv50_ir_target_nv50.cpp| 2 ++ 2 files changed, 31 insertions(+) diff

[Mesa-dev] [PATCH 4/4] nv50/ir: allow OP_SET to merge with OP_SET_AND/etc as well as a neg

2015-05-08 Thread Ilia Mirkin
This covers the pattern where a KILL_IF is used, which triggers a comparison of -x to 0. This can usually be folded into the comparison whose result is being compared to 0, however it may, itself, have already been combined with another comparison. That shouldn't impact the logic of this pass howev

[Mesa-dev] [PATCH 2/4] nvc0/ir: allow iset to produce a boolean float

2015-05-08 Thread Ilia Mirkin
Signed-off-by: Ilia Mirkin --- src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp | 12 src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp | 1 + src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp | 8 +++- 3 files changed, 16 insertions(+), 5 deletions(

[Mesa-dev] [PATCH 1/4] nvc0/ir: avoid jumping to a sched instruction

2015-05-08 Thread Ilia Mirkin
Signed-off-by: Ilia Mirkin --- Pretty sure there's nothing wrong with it, but it looks odd in the code. src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp | 2 ++ src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp | 7 +-- src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0

Re: [Mesa-dev] [PATCH 1/9] nir/vars_to_ssa: don't rewrite removed instructions

2015-05-08 Thread Jason Ekstrand
Reviewed-by: Jason Ekstrand wrote: > We were rewriting the uses of the intrinsic instruction to point to > something else after removing it, which only happened to work since we > were lax about having dangling uses when removing instructions. Fix that > up. > > Signed-off-by: Connor Abbott > ---

Re: [Mesa-dev] [PATCH 2/9] nir: insert ssa_undef instructions when cleanup up defs/uses

2015-05-08 Thread Jason Ekstrand
On Fri, May 8, 2015 at 10:03 PM, Connor Abbott wrote: > The point of cleanup_defs_uses() is to make an instruction safe to > remove by removing any references that the rest of the shader may have > to it. Previously, it was handling register use/def sets and removing > the instruction from the use

Re: [Mesa-dev] [PATCH 2/9] nir: insert ssa_undef instructions when cleanup up defs/uses

2015-05-08 Thread Connor Abbott
On Sat, May 9, 2015 at 1:52 AM, Jason Ekstrand wrote: > On Fri, May 8, 2015 at 10:03 PM, Connor Abbott wrote: >> The point of cleanup_defs_uses() is to make an instruction safe to >> remove by removing any references that the rest of the shader may have >> to it. Previously, it was handling regis

Re: [Mesa-dev] [PATCH 0/9] NIR dead control-flow removal

2015-05-08 Thread Jason Ekstrand
On Fri, May 8, 2015 at 10:03 PM, Connor Abbott wrote: > This series implements a bunch of related optimizations that run at > once as part of the same pass to eliminate control flow that is > useless. This includes both unreachable code and useless loops, i.e. > loops that don't compute a result u