Re: [Mesa-dev] RFC: mesa/st dynamic sampler support in tgsi

2014-08-05 Thread Bryan Cain
On Tue, Aug 5, 2014 at 3:23 PM, Ilia Mirkin wrote: > On Tue, Aug 5, 2014 at 4:14 PM, Bryan Cain wrote: > > On Mon, Aug 4, 2014 at 11:54 PM, Ilia Mirkin > wrote: > >> > >> Another apporach I've tried is to just use a TEMP register as the > >> i

Re: [Mesa-dev] RFC: mesa/st dynamic sampler support in tgsi

2014-08-05 Thread Bryan Cain
On Mon, Aug 4, 2014 at 11:54 PM, Ilia Mirkin wrote: > Another apporach I've tried is to just use a TEMP register as the > indirect offset here. Unfortunately this gets destroyed by > st_glsl_to_tgsi's various optimizations which assume that temp > registers can't be reladdr's and so messes up the

[Mesa-dev] [PATCH] glsl_to_tgsi: remove unnecessary dead code elimination pass

2014-05-05 Thread Bryan Cain
With the more advanced dead code elimination pass already being run, eliminate_dead_code was making no difference in instruction count, and had an undesirable O(n^2) runtime. So remove it and rename eliminate_dead_code_advanced to eliminate_dead_code. --- src/mesa/state_tracker/st_glsl_to_tgsi.cpp

Re: [Mesa-dev] [PATCH] nv50: implement multisample textures

2013-10-25 Thread Bryan Cain
On 10/25/2013 05:05 PM, Christoph Bumiller wrote: > On 25.10.2013 23:51, Bryan Cain wrote: >> On 10/25/2013 04:11 PM, Christoph Bumiller wrote: >>> On 25.10.2013 20:35, Emil Velikov wrote: >>>> On 21/10/13 23:23, Bryan Cain wrote: >>>>> This is a port o

Re: [Mesa-dev] [PATCH] nv50: implement multisample textures

2013-10-25 Thread Bryan Cain
On 10/25/2013 04:11 PM, Christoph Bumiller wrote: > On 25.10.2013 20:35, Emil Velikov wrote: >> On 21/10/13 23:23, Bryan Cain wrote: >>> This is a port of 4da54c91d24da ("nvc0: implement multisample textures") to >>> nv50. >>> >>> When couple

Re: [Mesa-dev] [PATCH] nv50: implement multisample textures

2013-10-25 Thread Bryan Cain
On 10/25/2013 01:35 PM, Emil Velikov wrote: > On 21/10/13 23:23, Bryan Cain wrote: >> This is a port of 4da54c91d24da ("nvc0: implement multisample textures") to >> nv50. >> >> When coupled with the patch to only report 16 texture samplers (to fix >>

[Mesa-dev] [PATCH] nv50: implement multisample textures

2013-10-21 Thread Bryan Cain
This is a port of 4da54c91d24da ("nvc0: implement multisample textures") to nv50. When coupled with the patch to only report 16 texture samplers (to fix crashes), all of the Piglit tests in spec/arb_texture_multisample pass. --- .../nouveau/codegen/nv50_ir_lowering_nv50.cpp |5 ++- src/g

Re: [Mesa-dev] [PATCH 06/34] draw/gs: fix allocation of buffer for GS output vertices

2013-07-30 Thread Bryan Cain
d it should be safe to leave this patch unmerged. If any problems come up as a result, they can be addressed then. > >> >> >> - Original Message - >> > From: Bryan Cain >> > >> > Before, it accounted for the size of the vertices but not the o

Re: [Mesa-dev] [PATCH] gallium/tgsi: clarify (possibly change) TGSI_OPCODE_UCMP definition

2013-05-08 Thread Bryan Cain
On 05/08/2013 03:26 PM, Roland Scheidegger wrote: > There's some other > somewhat bogus code with comments saying UCMP should be used instead of > some poor emulation with i2f instructions. Yeah, sorry about that. I wrote that code (and comment) a few days before the UCMP opcode was added to TGSI

[Mesa-dev] [PATCH] nouveau: emit and flush fence in fence_signalled if needed

2013-05-07 Thread Bryan Cain
The Mesa state tracker expects us to emit the fence even if it doesn't call fence_finish. Notably, this occurs when glClientWaitSync is called with timeout 0. Fixes Portal and Left 4 Dead 2, which were both stalling on startup by repeatedly calling glClientWaitSync with timeout 0 while waiting fo

Re: [Mesa-dev] [PATCH] mesa/st: Don't copy propagate from swizzles.

2013-04-24 Thread Bryan Cain
On 04/20/2013 12:40 PM, Fabian Bieler wrote: > Do not propagate a copy if source and destination are identical. > > Otherwise code like > > MOV TEMP[0].xyzw, TEMP[0].wzyx > mov TEMP[1].xyzw, TEMP[0].xyzw > > is changed to > > MOV TEMP[0].xyzw, TEMP[0].wzyx > mov TEMP[1].xyzw, TEMP[0].wzyx > --- >

[Mesa-dev] [PATCH 3/3] nv50: add support for geometry shaders

2013-04-17 Thread Bryan Cain
Layer output probably doesn't work yet, but other than that everything seems to be working. --- .../drivers/nv50/codegen/nv50_ir_emit_nv50.cpp | 25 +++- src/gallium/drivers/nv50/nv50_program.c| 17 + src/gallium/drivers/nv50/nv50_shader_state.c

[Mesa-dev] [PATCH 2/3] nv50/ir: delay calculation of indirect addresses

2013-04-17 Thread Bryan Cain
Instead of emitting an SHL 4 io an address register on the TGSI ARL and UARL instructions, emit the shift when the loaded address is actually used. This is necessary because input vertex and attribute indices in geometry shaders on nv50 need to be shifted left by 2 instead of 4. --- .../drivers/n

[Mesa-dev] [PATCH 1/3] nv50/ir: fix PFETCH and add RDSV to get VSTRIDE for GPs

2013-04-17 Thread Bryan Cain
From: Christoph Bumiller v2 (Bryan Cain ): Fix emission of PFETCH instructions using the SHL form. --- src/gallium/drivers/nv50/codegen/nv50_ir.h |1 + .../drivers/nv50/codegen/nv50_ir_emit_nv50.cpp | 62 ++-- src/gallium/drivers/nv50/codegen/nv50_ir_print.cpp

[Mesa-dev] Geometry shader support for nv50

2013-04-17 Thread Bryan Cain
The following patch set makes the necessary changes to support geometry shaders in the nv50 driver. There are no piglit tests yet for geometry shader corner cases yet, so these changes were tested with all of the GS demos in mesa/demos and several corner case tests, using Paul Berry's "gs" branch

Re: [Mesa-dev] GS plans?

2013-01-30 Thread Bryan Cain
On 01/29/2013 12:44 PM, Paul Berry wrote: > On 29 January 2013 09:33, Ian Romanick > wrote: > > On 01/29/2013 09:02 AM, Brian Paul wrote: > > > Hi Bryan, > > Back in July you announced your work on geometry shaders: > http://lists.freedeskto

Re: [Mesa-dev] [PATCH] glsl_to_tgsi: set correct register type for array and structure elements

2012-10-29 Thread Bryan Cain
On 10/29/2012 06:22 AM, Andreas Boll wrote: > 2012/10/24 Andreas Boll : >> 2012/10/24 Marek Olšák : >>> On Tue, Oct 23, 2012 at 11:52 PM, Bryan Cain wrote: >>>> On 10/23/2012 04:50 PM, Brian Paul wrote: >>>>> On 10/23/2012 10:58 AM, Bryan

Re: [Mesa-dev] [PATCH] glsl_to_tgsi: set correct register type for array and structure elements

2012-10-23 Thread Bryan Cain
On 10/23/2012 04:50 PM, Brian Paul wrote: > On 10/23/2012 10:58 AM, Bryan Cain wrote: >> This fixes an issue where glsl_to_tgsi_visior::get_opcode() would >> emit the >> wrong opcode because the register type was GLSL_TYPE_ARRAY/STRUCT >> instead of >> GLSL

[Mesa-dev] [PATCH] glsl_to_tgsi: set correct register type for array and structure elements

2012-10-23 Thread Bryan Cain
This fixes an issue where glsl_to_tgsi_visior::get_opcode() would emit the wrong opcode because the register type was GLSL_TYPE_ARRAY/STRUCT instead of GLSL_TYPE_FLOAT/INT/UINT/BOOL, so the function would use the float opcodes for operations on integer or boolean values dereferenced from an array o

Re: [Mesa-dev] [PATCH] glsl_to_tgsi: set correct register type for dereferenced array elements

2012-10-15 Thread Bryan Cain
On 10/15/2012 06:47 PM, Brian Paul wrote: > On 10/15/2012 04:06 PM, Bryan Cain wrote: >> --- >> src/mesa/state_tracker/st_glsl_to_tgsi.cpp |8 >> 1 file changed, 8 insertions(+) >> >> diff --git a/src/mesa/state_tracker/st_glsl_to_tgs

[Mesa-dev] [PATCH] glsl_to_tgsi: set correct register type for dereferenced array elements

2012-10-15 Thread Bryan Cain
--- src/mesa/state_tracker/st_glsl_to_tgsi.cpp |8 1 file changed, 8 insertions(+) diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 9146f24..caa7e94 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state

Re: [Mesa-dev] mishandling of bool comparisons in GLSL->TGSI translator

2012-10-15 Thread Bryan Cain
> 9: MOV OUT[0], IN[0] > 10: END > > The attached patch for glsl_to_tgsi_visitor::get_opcode() fixes the > issue but the first assert which I added fails if it's enabled. > AFAICT, by time we get into glsl_to_tgsi_visitor::get_opcode() we > should have scalar operands, not

Re: [Mesa-dev] [PATCH 0/16] Assorted gallium shader, sampler, sampler_view changes

2012-08-10 Thread Bryan Cain
On 08/09/2012 10:11 PM, Brian Paul wrote: > > The following patches are steps toward some gallium API clean-ups. > > 1. Eventually, replace > pipe_context::bind_fragment/vertex/geometry/compute_sampler_states() > with a single bind_sampler_states() entrypoint which takes a > PIPE_SHADER_x to identi

[Mesa-dev] Support for EXT/ARB_geometry_shader4

2012-07-27 Thread Bryan Cain
Some of you already know about this from IRC, but recently I've been working on adding support for GL_EXT_geometry_shader4 and GL_ARB_geometry_shader4 (which are essentially identical) to Mesa. A significant amount of the required code was already there from Zack Rusin's work on geometry shaders a

[Mesa-dev] [PATCH] nv50/ir: set position before i instead of i->next in NV50LoweringPreSSA::visit

2012-07-17 Thread Bryan Cain
Fixes rendering glitches in Psychonauts such as Raz's eyes flickering white. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=51962. --- .../drivers/nv50/codegen/nv50_ir_lowering_nv50.cpp |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/nv50/codegen/nv50

Re: [Mesa-dev] Mesa (master): docs: Update GL3.txt.

2012-07-11 Thread Bryan Cain
On 07/11/2012 12:24 AM, Eric Anholt wrote: > Kenneth Graunke writes: >> inverse() has been done for a while. > Does the inverse() builtin constant expression handling work for > you? It doesn't here. > >> None of us know what "highp change" means; > GLSL 1.40 spec: "Make the default precision qua

Re: [Mesa-dev] [PATCH] st/mesa: fix transform feedback of unsubscripted gl_ClipDistance array

2012-06-18 Thread Bryan Cain
On Jun 17, 2012 6:55 PM, "Bryan Cain" wrote: > > On 6/16/2012 5:43 PM, Marcin Slusarz wrote: >> >> gl_ClipDistance needs special treatment in form of lowering pass >> which transforms gl_ClipDistance representation from float[] to >> vec4[]. There are

Re: [Mesa-dev] [PATCH] st/mesa: fix transform feedback of unsubscripted gl_ClipDistance array

2012-06-17 Thread Bryan Cain
On 6/16/2012 5:43 PM, Marcin Slusarz wrote: gl_ClipDistance needs special treatment in form of lowering pass which transforms gl_ClipDistance representation from float[] to vec4[]. There are 2 implementations - at glsl linker level (enabled by LowerClipDistance option) and at glsl_to_tgsi level (

Re: [Mesa-dev] [PATCH 1/3] glsl_to_tgsi: Create a new variable_store class replacing variables field in glsl_to_tgsi_visitor

2012-01-07 Thread Bryan Cain
This is good work. I just have a few suggested changes. On 01/07/2012 12:26 PM, Vincent Lejeune wrote: > --- > src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 414 > +--- > 1 files changed, 309 insertions(+), 105 deletions(-) > > diff --git a/src/mesa/state_tracker/st_glsl

Re: [Mesa-dev] softpipe GL3 status

2012-01-07 Thread Bryan Cain
On 01/07/2012 02:44 AM, Dave Airlie wrote: >> Let's add new opcodes for things like this. > I'll add IABS. I sent a patch to the mailing list that adds IABS about an hour ago, before reading this message. Bryan ___ mesa-dev mailing list mesa-dev@lists.

[Mesa-dev] [PATCH] gallium: add an IABS opcode to TGSI

2012-01-07 Thread Bryan Cain
This is a necessary operation that is missing from TGSI. --- src/gallium/auxiliary/tgsi/tgsi_exec.c |4 src/gallium/auxiliary/tgsi/tgsi_info.c |1 + src/gallium/docs/source/tgsi.rst | 13 + src/gallium/include/pipe/p_shader_tokens.h |3 ++- 4 files

Re: [Mesa-dev] softpipe GL3 status

2012-01-06 Thread Bryan Cain
On 01/06/2012 01:26 PM, Ian Romanick wrote: > On 01/06/2012 09:04 AM, Dave Airlie wrote: >> Hi guys, >> >> Just a quick note, I've just spent a week or so trying to see where >> gallium and softpipe were w.r.t GL3.0 support. >> >> I've pushed a branch to my repo called softpipe-gl3. It contains >>

Re: [Mesa-dev] [PATCH 0/2 v4] Add support for clip distances in Gallium

2012-01-04 Thread Bryan Cain
On 01/02/2012 02:58 PM, Bryan Cain wrote: > This is the fourth revision of my changes to add support for gl_ClipDistance > with Gallium. The first three revisions were sent in closer succession about > two weeks ago. This revision is identical to v3 except for the inclusion of >

[Mesa-dev] [PATCH 2/2] st/mesa: add support for gl_ClipDistance

2012-01-02 Thread Bryan Cain
--- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 48 +--- src/mesa/state_tracker/st_program.c| 18 ++ 2 files changed, 61 insertions(+), 5 deletions(-) diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp

[Mesa-dev] [PATCH 1/2] gallium: add support for clip distances

2012-01-02 Thread Bryan Cain
--- src/gallium/auxiliary/tgsi/tgsi_dump.c |3 +- src/gallium/auxiliary/tgsi/tgsi_text.c |3 +- src/gallium/auxiliary/tgsi/tgsi_ureg.c | 38 +-- src/gallium/auxiliary/tgsi/tgsi_ureg.h |6 src/gallium/include/pipe/p_shader_tokens.h |3 +

[Mesa-dev] [PATCH 0/2 v4] Add support for clip distances in Gallium

2012-01-02 Thread Bryan Cain
This is the fourth revision of my changes to add support for gl_ClipDistance with Gallium. The first three revisions were sent in closer succession about two weeks ago. This revision is identical to v3 except for the inclusion of the changes suggested by Brian Paul in reply to the v3 patches. __

[Mesa-dev] [PATCH 2/2] st/mesa: add support for gl_ClipDistance

2011-12-17 Thread Bryan Cain
--- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 49 +--- src/mesa/state_tracker/st_program.c| 18 ++ 2 files changed, 62 insertions(+), 5 deletions(-) diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp

[Mesa-dev] [PATCH 1/2] gallium: add support for clip distances

2011-12-17 Thread Bryan Cain
--- src/gallium/auxiliary/tgsi/tgsi_dump.c |3 +- src/gallium/auxiliary/tgsi/tgsi_text.c |3 +- src/gallium/auxiliary/tgsi/tgsi_ureg.c | 36 +--- src/gallium/auxiliary/tgsi/tgsi_ureg.h |6 src/gallium/include/pipe/p_shader_tokens.h |3

[Mesa-dev] [PATCH 0/2 v3] Add support for clip distances in Gallium

2011-12-17 Thread Bryan Cain
This is the third revision of my changes to add support for gl_ClipDistance with Gallium. The difference between this set and v2 is that this set does not add a new TGSI_PROPERTY indicating the number of clip distances used. Instead, the UsageMask of the CLIPDIST output registers is set to indicat

Re: [Mesa-dev] [PATCH 0/2 v2] Add support for clip distances in Gallium

2011-12-13 Thread Bryan Cain
gt;>>>>> - Original Message - >>>>>>> On 12/13/2011 03:09 PM, Jose Fonseca wrote: >>>>>>>> - Original Message - >>>>>>>>> On 12/13/2011 12:26 PM, Bryan Cain wrote: >>>>>>&

Re: [Mesa-dev] [PATCH 0/2 v2] Add support for clip distances in Gallium

2011-12-13 Thread Bryan Cain
On 12/13/2011 03:48 PM, Jose Fonseca wrote: > - Original Message - >> On 12/13/2011 03:25 PM, Jose Fonseca wrote: >>> - Original Message - >>>> On 12/13/2011 03:09 PM, Jose Fonseca wrote: >>>>> - Original Message ----- >>>&g

Re: [Mesa-dev] [PATCH 0/2 v2] Add support for clip distances in Gallium

2011-12-13 Thread Bryan Cain
On 12/13/2011 03:48 PM, Jose Fonseca wrote: > - Original Message - >> On 12/13/2011 03:25 PM, Jose Fonseca wrote: >>> - Original Message - >>>> On 12/13/2011 03:09 PM, Jose Fonseca wrote: >>>>> - Original Message ----- >>>&g

Re: [Mesa-dev] [PATCH 0/2 v2] Add support for clip distances in Gallium

2011-12-13 Thread Bryan Cain
On 12/13/2011 03:25 PM, Jose Fonseca wrote: > > - Original Message - >> On 12/13/2011 03:09 PM, Jose Fonseca wrote: >>> - Original Message - >>>> On 12/13/2011 12:26 PM, Bryan Cain wrote: >>>>> On 12/13/2011 02:11 PM, J

Re: [Mesa-dev] [PATCH 1/2] gallium: add TGSI_SEMANTIC_CLIPDIST for clip distance

2011-12-13 Thread Bryan Cain
On 12/13/2011 03:07 PM, Brian Paul wrote: > On Tue, Dec 13, 2011 at 9:59 AM, Bryan Cain wrote: >> --- >> src/gallium/auxiliary/tgsi/tgsi_dump.c |3 ++- >> src/gallium/include/pipe/p_shader_tokens.h |3 ++- >> 2 files changed, 4 insertions(+), 2 deletion

Re: [Mesa-dev] [PATCH 0/2 v2] Add support for clip distances in Gallium

2011-12-13 Thread Bryan Cain
On 12/13/2011 03:09 PM, Jose Fonseca wrote: > > - Original Message - >> On 12/13/2011 12:26 PM, Bryan Cain wrote: >>> On 12/13/2011 02:11 PM, Jose Fonseca wrote: >>>> - Original Message - >>>>> This is an updated version of the patc

Re: [Mesa-dev] [PATCH 0/2 v2] Add support for clip distances in Gallium

2011-12-13 Thread Bryan Cain
On 12/13/2011 02:11 PM, Jose Fonseca wrote: > - Original Message - >> This is an updated version of the patch set I sent to the list a few >> hours >> ago. >> There is now a TGSI property called >> TGSI_PROPERTY_NUM_CLIP_DISTANCES >> that drivers can use to determine how many of the 8 ava

[Mesa-dev] [PATCH 2/2] st/mesa: add support for gl_ClipDistance

2011-12-13 Thread Bryan Cain
--- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 39 ++- src/mesa/state_tracker/st_program.c| 18 + 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.c

[Mesa-dev] [PATCH 1/2] gallium: add support for clip distances

2011-12-13 Thread Bryan Cain
--- src/gallium/auxiliary/tgsi/tgsi_dump.c |6 -- src/gallium/auxiliary/tgsi/tgsi_text.c |3 ++- src/gallium/auxiliary/tgsi/tgsi_ureg.c | 14 ++ src/gallium/auxiliary/tgsi/tgsi_ureg.h |3 +++ src/gallium/include/pipe/p_shader_tokens.h |6 -- 5

[Mesa-dev] [PATCH 0/2 v2] Add support for clip distances in Gallium

2011-12-13 Thread Bryan Cain
This is an updated version of the patch set I sent to the list a few hours ago. There is now a TGSI property called TGSI_PROPERTY_NUM_CLIP_DISTANCES that drivers can use to determine how many of the 8 available clip distances are actually used by a shader.

[Mesa-dev] [PATCH 2/2] st/mesa: add support for gl_ClipDistance

2011-12-13 Thread Bryan Cain
--- src/mesa/state_tracker/st_glsl_to_tgsi.cpp |1 + src/mesa/state_tracker/st_program.c| 18 ++ 2 files changed, 19 insertions(+), 0 deletions(-) diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 9ef65c8..d50

[Mesa-dev] [PATCH 1/2] gallium: add TGSI_SEMANTIC_CLIPDIST for clip distance

2011-12-13 Thread Bryan Cain
--- src/gallium/auxiliary/tgsi/tgsi_dump.c |3 ++- src/gallium/include/pipe/p_shader_tokens.h |3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallium/auxiliary/tgsi/tgsi_dump.c b/src/gallium/auxiliary/tgsi/tgsi_dump.c index e830aa5..bd299b0 100644 --- a/src/

[Mesa-dev] [PATCH 0/2] Add support for clip distances in Gallium

2011-12-13 Thread Bryan Cain
These patches add support for clip distances in the Gallium interface and the Mesa state tracker, respectively. This should take care of gl_ClipDistance, one of the few GLSL 1.30 features not yet implemented in Gallium. If this is merged, driver developers will need to add support to their driver

Re: [Mesa-dev] [PATCH] glsl_to_tgsi: Invalidate and revalidate uniform backing storage

2011-11-16 Thread Bryan Cain
to me. > > Signed-off-by: Ian Romanick > Cc: Vadim Girlin > Cc: Bryan Cain > --- > src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 14 ++ > 1 files changed, 14 insertions(+), 0 deletions(-) > > diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp >

Re: [Mesa-dev] TGSI declarations missing type info

2011-11-13 Thread Bryan Cain
On 11/13/2011 09:06 AM, Dave Airlie wrote: > Hi guys, > > Just been looking at llvmpipe integer support and it seems like we > lose some information about the type of data stored into temporaries, > > after st_glsl_to_cpp we no longer know what type the temporaries are, > and llvm would really like

Re: [Mesa-dev] [PATCH 1/2] glsl: Add uniform_locations_assigned parameter to do_dead_code opt pass

2011-10-21 Thread Bryan Cain
If it's worth anything, the glsl_to_tgsi part is Reviewed-by: Bryan Cain On 10/21/2011 01:49 PM, Ian Romanick wrote: > From: Ian Romanick > > Setting this flag prevents declarations of uniforms from being removed > from the IR. Since the IR is directly used by several API

Re: [Mesa-dev] [PATCH 2/2] glsl: Short-circuit lower_if_to_cond_assign when MaxIfDepth is UINT_MAX.

2011-10-18 Thread Bryan Cain
> > Signed-off-by: Kenneth Graunke > Cc: Bryan Cain > Cc: Ian Romanick > --- > src/glsl/lower_if_to_cond_assign.cpp |3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/src/glsl/lower_if_to_cond_assign.cpp > b/src/glsl/lower_if_to_cond_as

Re: [Mesa-dev] [PATCH] st/mesa: kill instruction if writemask=0 in eliminate_dead_code_advanced()

2011-10-09 Thread Bryan Cain
What does it do if there's no destination register? In any case, I don't think glsl_to_tgsi emits any ARLs of that form, so it shouldn't be a problem. Bryan On 10/07/2011 01:06 PM, Marek Olšák wrote: > I think ARL is allowed to have no destination register, right? In that > case, there should be

Re: [Mesa-dev] [PATCH] st/mesa: kill instruction if writemask=0 in eliminate_dead_code_advanced()

2011-10-09 Thread Bryan Cain
I don't think there's any reason we can't eliminate a dead instruction when the writemask is zero. I do wonder, though, why this patch actually makes a difference. There's an "if (!inst->dead_mask || !inst->dst.writemask)" three lines before the code visible in the patch that makes it not kill th

Re: [Mesa-dev] [PATCH 6/6] glsl_to_tgsi: Use _mesa_generate_parameters_list_for_uniforms

2011-10-07 Thread Bryan Cain
On 10/07/2011 07:06 PM, Ian Romanick wrote: > From: Ian Romanick > > Signed-off-by: Ian Romanick > Cc: Bryan Cain > --- > src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 119 > +--- > 1 files changed, 2 insertions(+), 117 deletions(-) &g

[Mesa-dev] [PATCH] glsl_to_tgsi: implement ir_binop_all_equal and ir_binop_any_nequal for native integers

2011-09-19 Thread Bryan Cain
--- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 119 1 files changed, 85 insertions(+), 34 deletions(-) diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 8921698..f68270d 100644 --- a/src/mesa/state_tracker/s

Re: [Mesa-dev] [PATCH v2 2/2] glsl_to_tgsi: use UARL instead of I2F and ARL

2011-09-14 Thread Bryan Cain
t; > Maybe you can see better than me what's wrong. > > This is a side-by-side diff of the failing TGSI shader. The right-hand > one is from Mesa master. The left-hand one is with the commit > reverted. > http://pastebin.com/raw.php?i=QXB3SZAE > > Thanks, > Marek

[Mesa-dev] [PATCH v2 2/2] glsl_to_tgsi: use UARL instead of I2F and ARL

2011-09-10 Thread Bryan Cain
Since TGSI now has a UARL opcode that takes an integer as the source, it is no longer necessary to hack around the lack of an integer ARL opcode using I2F. UARL is only emitted when native integers are enabled; ARL is still used otherwise. Reviewed-by: Brian Paul --- src/mesa/state_tracker/st_gl

[Mesa-dev] [PATCH v2 1/2] gallium: add TGSI opcodes UARL and UCMP

2011-09-10 Thread Bryan Cain
They are needed by glsl_to_tgsi for an efficient implementation using native integers. --- src/gallium/auxiliary/tgsi/tgsi_exec.c | 30 src/gallium/auxiliary/tgsi/tgsi_info.c |3 ++ src/gallium/docs/source/tgsi.rst | 19 + src/

Re: [Mesa-dev] [PATCH 2/2] glsl_to_tgsi: use UARL instead of I2F and ARL

2011-09-10 Thread Bryan Cain
my question is: do the drivers need to be updated for > TGSI_OPCODE_UARL? Or will this only be emitted when the driver > supports integer operations? If that's the case, please say so in the > commit message or code. > > Otherwise: Reviewed-by: Brian Paul > > > On 09/10

Re: [Mesa-dev] [PATCH 1/2] gallium: add TGSI opcodes UARL and UCMP

2011-09-10 Thread Bryan Cain
On 09/10/2011 12:05 PM, Brian Paul wrote: > On 09/10/2011 10:47 AM, Bryan Cain wrote: >> Can one of the Gallium interface maintainers please review this patch so >> I can push it? > > > We need documentation for these new instructions in > src/gallium/docs/source/tgsi.

Re: [Mesa-dev] [PATCH 2/2] glsl_to_tgsi: use UARL instead of I2F and ARL

2011-09-10 Thread Bryan Cain
Disregard this, I meant to send this for patch 1/2 and not 2/2. This patch doesn't contain any Gallium interface changes. Bryan On 09/10/2011 11:43 AM, Bryan Cain wrote: > Can one of the Gallium interface maintainers please review this patch so > I can push it? > > Bryan > &

Re: [Mesa-dev] [PATCH 1/2] gallium: add TGSI opcodes UARL and UCMP

2011-09-10 Thread Bryan Cain
Can one of the Gallium interface maintainers please review this patch so I can push it? Bryan On 09/02/2011 11:09 AM, Bryan Cain wrote: > They are needed by glsl_to_tgsi for an efficient implementation using native > integers. > --- > src/gallium/auxiliary/tgsi/tgsi_exec.

Re: [Mesa-dev] [PATCH 2/2] glsl_to_tgsi: use UARL instead of I2F and ARL

2011-09-10 Thread Bryan Cain
Can one of the Gallium interface maintainers please review this patch so I can push it? Bryan On 09/02/2011 11:09 AM, Bryan Cain wrote: > --- > src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 18 +++--- > 1 files changed, 7 insertions(+), 11 deletions(-) > > diff -

[Mesa-dev] [PATCH] mesa: add a UniformBooleanTrue option

2011-09-05 Thread Bryan Cain
Drivers supporting native integers set UniformBooleanTrue to the integer value that should be used for true when uploading uniform booleans. This is ~0 for Gallium and 1 for i965. --- src/mesa/drivers/dri/i965/brw_context.c |4 +++- src/mesa/main/mtypes.h |6 ++ src/m

Re: [Mesa-dev] [PATCH v2] glsl_to_tgsi, mesa: fixes for native integers and integer booleans

2011-09-03 Thread Bryan Cain
On 09/02/2011 06:13 PM, Eric Anholt wrote: > On Wed, 31 Aug 2011 01:33:59 -0500, Bryan Cain wrote: >> With this patch, there are no piglit regressions on softpipe with native >> integers enabled. Unlike my previous patch, this uses integer values of >> ~0 and 0 for true an

Re: [Mesa-dev] [PATCH v2] glsl_to_tgsi, mesa: fixes for native integers and integer booleans

2011-09-02 Thread Bryan Cain
On 09/02/2011 06:13 PM, Eric Anholt wrote: > On Wed, 31 Aug 2011 01:33:59 -0500, Bryan Cain wrote: >> With this patch, there are no piglit regressions on softpipe with native >> integers enabled. Unlike my previous patch, this uses integer values of >> ~0 and 0 for true an

Re: [Mesa-dev] [PATCH v2] glsl_to_tgsi, mesa: fixes for native integers and integer booleans

2011-09-02 Thread Bryan Cain
Are there any objections to pushing this? Bryan On 08/31/2011 01:33 AM, Bryan Cain wrote: > With this patch, there are no piglit regressions on softpipe with native > integers enabled. Unlike my previous patch, this uses integer values of > ~0 and 0 for true and false, respectively, i

[Mesa-dev] [PATCH 2/2] glsl_to_tgsi: use UARL instead of I2F and ARL

2011-09-02 Thread Bryan Cain
--- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 18 +++--- 1 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index e2857ed..05d4d33 100644 --- a/src/mesa/state_tracker/st_glsl_to_t

[Mesa-dev] [PATCH 1/2] gallium: add TGSI opcodes UARL and UCMP

2011-09-02 Thread Bryan Cain
They are needed by glsl_to_tgsi for an efficient implementation using native integers. --- src/gallium/auxiliary/tgsi/tgsi_exec.c | 30 src/gallium/auxiliary/tgsi/tgsi_info.c |3 ++ src/gallium/include/pipe/p_shader_tokens.h |5 +++- 3 files changed,

[Mesa-dev] [PATCH] mesa: Replace the EmitNoIfs compiler flag with a MaxIfLevel flag.

2011-08-31 Thread Bryan Cain
This is a better, more fine-grained way of lowering if statements. Fixes the game And Yet It Moves on nv50. --- src/mesa/drivers/dri/i915/i915_context.c |2 +- src/mesa/main/mtypes.h |6 +- src/mesa/program/ir_to_mesa.cpp|8 src/mesa/stat

[Mesa-dev] [PATCH v2] glsl_to_tgsi, mesa: fixes for native integers and integer booleans

2011-08-30 Thread Bryan Cain
With this patch, there are no piglit regressions on softpipe with native integers enabled. Unlike my previous patch, this uses integer values of ~0 and 0 for true and false, respectively, instead of the float values 1.0 and 0.0. --- src/mesa/main/uniforms.c |6 +- src/mesa/s

Re: [Mesa-dev] Missing integer "set" opcodes in Gallium

2011-08-29 Thread Bryan Cain
On 08/29/2011 03:41 PM, Zack Rusin wrote: > On Monday, August 29, 2011 04:02:08 PM Zack Rusin wrote: >> Either way though if GL needs those ops then, like Brian mentioned, it'd be >> a good idea to add them. > Actually I think it seems easier to just flip the ops rather than add new > instruction

[Mesa-dev] Missing integer "set" opcodes in Gallium

2011-08-29 Thread Bryan Cain
I somehow didn't notice this until now, but why are there no Gallium "set" opcodes for integers that are equivalent to the SGT or SLE opcodes for floats? Does it have to do with available hardware features? Bryan ___ mesa-dev mailing list mesa-dev@lists

Re: [Mesa-dev] [PATCH] glsl: Use a separate div_to_mul_rcp lowering flag for integers.

2011-08-28 Thread Bryan Cain
On 08/28/2011 07:38 PM, Eric Anholt wrote: > On Sat, 27 Aug 2011 20:18:55 -0700, Kenneth Graunke > wrote: >> From: Bryan Cain >> >> Using multiply and reciprocal for integer division involves potentially >> lossy floating point conversions. This is okay fo

Re: [Mesa-dev] [PATCH] mesa, glsl_to_tgsi: fixes for native integers

2011-08-28 Thread Bryan Cain
On 08/26/2011 09:58 PM, Bryan Cain wrote: > This fixes all of the piglit regressions in softpipe when native integers are > enabled. > --- > src/mesa/main/uniforms.c |8 + > src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 45 > +

Re: [Mesa-dev] [PATCH] glsl: Use a separate div_to_mul_rcp lowering flag for integers.

2011-08-28 Thread Bryan Cain
On 08/27/2011 10:18 PM, Kenneth Graunke wrote: > From: Bryan Cain > > Using multiply and reciprocal for integer division involves potentially > lossy floating point conversions. This is okay for older GPUs that > represent integers as floating point, but undesirable for GPU

[Mesa-dev] [PATCH] glsl: use a separate div_to_mul_rcp lowering flag for integers

2011-08-27 Thread Bryan Cain
TGSI, at the very least, has UDIV/IDIV instructions for integer division. --- src/glsl/ir_optimization.h | 13 +++-- src/glsl/lower_instructions.cpp|4 +++- src/mesa/drivers/dri/i965/brw_shader.cpp |1 + src/mesa/program/ir_to_mesa.cpp|

Re: [Mesa-dev] [PATCH] mesa, glsl_to_tgsi: fixes for native integers

2011-08-27 Thread Bryan Cain
On 08/27/2011 05:39 AM, Christoph Bumiller wrote: > On 27.08.2011 04:58, Bryan Cain wrote: >> This fixes all of the piglit regressions in softpipe when native integers are >> enabled. >> --- >> src/mesa/main/uniforms.c |8 + >> src/mesa/

[Mesa-dev] [PATCH] mesa, glsl_to_tgsi: fixes for native integers

2011-08-26 Thread Bryan Cain
This fixes all of the piglit regressions in softpipe when native integers are enabled. --- src/mesa/main/uniforms.c |8 + src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 45 ++-- 2 files changed, 43 insertions(+), 10 deletions(-) diff --git a/src/m

Re: [Mesa-dev] [PATCH 3/3] glsl->tgsi: add TXF support.

2011-08-25 Thread Bryan Cain
tgsi_instruction(struct st_translate *t, > case TGSI_OPCODE_TXL: > case TGSI_OPCODE_TXP: > case TGSI_OPCODE_TXQ: > + case TGSI_OPCODE_TXF: >src[num_src++] = t->samplers[inst->sampler]; >ureg_tex_insn(ureg, > inst->op, Aside

Re: [Mesa-dev] [PATCH 3/3] st_glsl_to_tgsi: implement TXS/TXQ. (v2)

2011-08-25 Thread Bryan Cain
The usual commit prefix for the GLSL->TGSI translator is "glsl_to_tgsi". Other than that, Reviewed-by: Bryan Cain On 08/25/2011 09:46 AM, Dave Airlie wrote: > From: Dave Airlie > > GLSL uses TXS, call the gallium TXQ opcode. > > v2: fix indent from 4->3.

Re: [Mesa-dev] is_tex bit for TGSI sampling instructions

2011-08-24 Thread Bryan Cain
On 08/24/2011 11:42 PM, Zack Rusin wrote: > On Wednesday, August 24, 2011 10:14:48 PM Bryan Cain wrote: >> Like Dave said, the GLSL->TGSI translator needs to account for this. > Probably not, at least yet. All of those instructions are DX10.1 level > instructions which su

Re: [Mesa-dev] is_tex bit for TGSI sampling instructions

2011-08-24 Thread Bryan Cain
On 08/24/2011 07:26 AM, Michal Krol wrote: > - Original Message - >> Any reasons >> >>{ 1, 2, 0, 0, 0, 0, "LOAD",TGSI_OPCODE_LOAD }, >>{ 1, 2, 0, 0, 0, 0, "LOAD_MS", TGSI_OPCODE_LOAD_MS }, >>{ 1, 3, 0, 0, 0, 0, "SAMPLE", TGSI_OPCODE_SAMPLE }, >>{ 1, 4, 0, 0,

Re: [Mesa-dev] [PATCH 1/2] Change return type of try_emit_* methods to bool.

2011-08-24 Thread Bryan Cain
On 08/23/2011 03:48 AM, Kai Wasserbäch wrote: > Ian Romanick explained (Message-Id: <4e528973.6080...@freedesktop.org>), > that the return type of non-API methods shouldn't use GLboolean but a > standard C++ bool. > > CC: Ian Romanick > CC: Bryan Cain &g

Re: [Mesa-dev] [PATCH 3/5] mesa: Make the gl_constant_value's bool occupy the same space as float/int.

2011-08-20 Thread Bryan Cain
On 08/20/2011 05:10 PM, Dan McCabe wrote: > On 08/20/2011 01:30 PM, Bryan Cain wrote: >> On 08/20/2011 03:05 PM, Dan McCabe wrote: >>> What are the implications for other architectures that support doubles? >> >> I don't see what you mean. gl_constant_v

Re: [Mesa-dev] [PATCH 3/5] mesa: Make the gl_constant_value's bool occupy the same space as float/int.

2011-08-20 Thread Bryan Cain
On 08/20/2011 03:05 PM, Dan McCabe wrote: > What are the implications for other architectures that support doubles? I don't see what you mean. gl_constant_value doesn't support doubles yet. Bryan > > On 08/19/2011 05:56 PM, Eric Anholt wrote: >> At least for Intel, all our uniform components ar

Re: [Mesa-dev] [PATCH] st/mesa: fix incorrect loop over instruction src regs

2011-08-17 Thread Bryan Cain
On 08/17/2011 09:47 AM, Keith Whitwell wrote: > On Wed, 2011-08-17 at 09:36 -0500, Bryan Cain wrote: >> The usual commit message prefix for changes to glsl_to_tgsi is >> "glsl_to_tgsi", not "st/mesa". >> >> On 08/16/2011 05:33 PM, Brian Paul wrote

Re: [Mesa-dev] [PATCH] st/mesa: fix incorrect loop over instruction src regs

2011-08-17 Thread Bryan Cain
The usual commit message prefix for changes to glsl_to_tgsi is "glsl_to_tgsi", not "st/mesa". On 08/16/2011 05:33 PM, Brian Paul wrote: > The array of src regs is of size 3, not 4. > --- > src/mesa/state_tracker/st_glsl_to_tgsi.cpp |2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > >

[Mesa-dev] [PATCH] st/mesa: inline st_prepare_fragment_program in st_translate_fragment_program

2011-08-07 Thread Bryan Cain
This reverts an unnecessary part of commit 4683529048ee and fixes misrendering and an assertion failure in Cogs. Fixes freedesktop.org bug 39888. --- src/mesa/state_tracker/st_program.c | 326 +-- src/mesa/state_tracker/st_program.h | 15 -- 2 files changed, 162

Re: [Mesa-dev] Status of the GLSL->TGSI translator, part 2

2011-08-04 Thread Bryan Cain
On 08/04/2011 08:24 AM, Brian Paul wrote: > On Tue, Aug 2, 2011 at 3:50 PM, Bryan Cain wrote: >> On 08/02/2011 11:27 AM, Brian Paul wrote: >>> On 08/01/2011 12:38 PM, Bryan Cain wrote: >>>> Since Mesa 7.11 is released now, I figure it's time to discuss merg

Re: [Mesa-dev] S2TC - yet another attempt to solve the "S3TC issue"

2011-08-03 Thread Bryan Cain
On 08/03/2011 01:58 PM, Ian Romanick wrote: > On 08/03/2011 08:04 AM, Brian Paul wrote: > > On Mon, Aug 1, 2011 at 11:44 AM, Rudolf Polzer > wrote: > >> Hi, > >> > >> I developed, together with Maik Merten, a replacement for S3TC with the > >> following properties: > >> > >> - does not use any "in

Re: [Mesa-dev] Status of the GLSL->TGSI translator, part 2

2011-08-02 Thread Bryan Cain
On 08/02/2011 11:27 AM, Brian Paul wrote: > On 08/01/2011 12:38 PM, Bryan Cain wrote: >> Since Mesa 7.11 is released now, I figure it's time to discuss merging >> the glsl-to-tgsi branch to master again. The translator is more mature >> than last time. There are no reg

[Mesa-dev] Status of the GLSL->TGSI translator, part 2

2011-08-01 Thread Bryan Cain
Since Mesa 7.11 is released now, I figure it's time to discuss merging the glsl-to-tgsi branch to master again. The translator is more mature than last time. There are no regressions that I know of on any driver. The code generation has improved so that it's the same as or better than ir_to_mesa

Re: [Mesa-dev] Mesa 7.11 release candidate 3

2011-07-26 Thread Bryan Cain
On Mon, Jul 25, 2011 at 9:54 PM, Ian Romanick wrote: > The only changes in the 7.11 branch (until the final release) should be > low-risk fixes for significant bugs.  Other than updates to the release > notes and changing the version, RC3 should represent 7.11 final. Would my patches for making G

Re: [Mesa-dev] [PATCH 0/2] Make Gallium drivers respect the force_s3tc_enable environment variable

2011-07-26 Thread Bryan Cain
On Mon, Jul 25, 2011 at 1:50 PM, Jose Fonseca wrote: > I have no objection FWIW. > > Jose > > - Original Message - >> This is a revised version of my previous patches.  Patch 1 >> incorporates >> Brian's feedback, and patch 2 is unchanged from before.  I did test >> patch 2 >> without patc

  1   2   >