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 to

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

2011-11-16 Thread Bryan Cain
...@intel.com Cc: Vadim Girlin vadimgir...@gmail.com Cc: Bryan Cain bryanca...@gmail.com --- 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 b/src/mesa/state_tracker

[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

[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 ---

[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

[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 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 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

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 available clip

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 patch set I sent to the list a few hours ago. There is now a TGSI

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 bryanca...@gmail.com wrote: --- 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

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, Jose Fonseca wrote: - Original Message - This is an updated version

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 - On 12/13/2011 12:26 PM, Bryan Cain wrote: On 12/13/2011 02:11 PM, Jose

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 - On 12/13/2011 12:26 PM, Bryan Cain wrote: On 12/13/2011 02:11 PM, Jose

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

2011-12-13 Thread Bryan Cain
: - 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 patch set I sent to the list a few hours ago. There is now a TGSI property called

[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

[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 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

[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 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 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

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 the changes

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 patches in

[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-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

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

[Mesa-dev] Patches to make Gallium drivers respect the force_s3tc_enable environment variable

2011-07-20 Thread Bryan Cain
The purpose of the following two patches is to make st/mesa expose the S3TC extensions when the force_s3tc_enable environment variable is used. This is to match the behavior of the DRI drivers, in which force_s3tc_enable is an option in driconf. Although st/mesa can't use the driconf functions,

[Mesa-dev] [PATCH 1/2] st/mesa: respect force_s3tc_enable environment variable

2011-07-20 Thread Bryan Cain
--- src/mesa/state_tracker/st_extensions.c | 12 +++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 99b231d..073e72c 100644 --- a/src/mesa/state_tracker/st_extensions.c +++

[Mesa-dev] [PATCH 2/2] util: enable S3TC support when the force_s3tc_enable env var is set to true

2011-07-20 Thread Bryan Cain
--- src/gallium/auxiliary/util/u_format_s3tc.c | 11 +-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gallium/auxiliary/util/u_format_s3tc.c b/src/gallium/auxiliary/util/u_format_s3tc.c index bb989c2..d8a7c0d 100644 --- a/src/gallium/auxiliary/util/u_format_s3tc.c

Re: [Mesa-dev] [PATCH 1/2] st/mesa: respect force_s3tc_enable environment variable

2011-07-21 Thread Bryan Cain
On 07/21/2011 08:48 AM, Brian Paul wrote: On 07/20/2011 04:53 PM, Bryan Cain wrote: --- src/mesa/state_tracker/st_extensions.c | 12 +++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker

[Mesa-dev] Adding a UARL opcode to TGSI

2011-07-21 Thread Bryan Cain
TGSI's set of signed and unsigned integer opcodes is mostly complete and usable, but there is one important operation missing: loading an integer into the address register. Currently, the only way to do this is to use I2F followed by ARL. This is very counterproductive, since every driver has to

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

2011-07-25 Thread Bryan Cain
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 patch 1, and found that both patches are neeeded for force_s3tc_enable to work. Both of these are candidates for 7.10 and 7.11, since games

[Mesa-dev] [PATCH 1/2] st/mesa: respect force_s3tc_enable environment variable

2011-07-25 Thread Bryan Cain
NOTE: This is a candidate for the 7.10 and 7.11 branches. --- src/mesa/state_tracker/st_extensions.c | 11 ++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 99b231d..b5f6d35 100644

[Mesa-dev] [PATCH 2/2] util: enable S3TC support when the force_s3tc_enable env var is set to true

2011-07-25 Thread Bryan Cain
NOTE: This is a candidate for the 7.10 and 7.11 branches. --- src/gallium/auxiliary/util/u_format_s3tc.c | 11 +-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gallium/auxiliary/util/u_format_s3tc.c b/src/gallium/auxiliary/util/u_format_s3tc.c index

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 jfons...@vmware.com 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

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 i...@freedesktop.org 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

[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

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 regressions that I know of on any

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 divver...@xonotic.org wrote: Hi, I developed, together with Maik Merten, a replacement for S3TC with the following properties: - does not use any

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 bryanca...@gmail.com 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 merging the glsl-to-tgsi branch

[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,

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(-) diff

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: The array of src regs is of size 3, not 4. --- src/mesa

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 are of

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_value doesn't support doubles yet. Yet

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 i...@freedesktop.org CC: Bryan Cain bryanca...@gmail.com Signed-off

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, 0, 0, SAMPLE_B,

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 support splitting of samplers

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 bryanca...@gmail.com On 08/25/2011 09:46 AM, Dave Airlie wrote: From: Dave Airlie airl...@redhat.com GLSL uses TXS, call the gallium TXQ opcode. v2: fix indent from 4-3. Signed

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

2011-08-25 Thread Bryan Cain
++] = t-samplers[inst-sampler]; ureg_tex_insn(ureg, inst-op, Aside from those things, Reviewed-by: Bryan Cain bryanca...@gmail.com ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman

[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

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/state_tracker/st_glsl_to_tgsi.cpp | 45

[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] 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 bryanca...@gmail.com 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 GPUs

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 ++-- 2 files changed, 43

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 kenn...@whitecape.org wrote: From: Bryan Cain bryanca...@gmail.com Using multiply and reciprocal for integer division involves potentially lossy floating point conversions. This is okay for older

[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

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 instructions,

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

2011-08-31 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 +-

[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

[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 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 ---

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, instead

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 bryanca...@gmail.com 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

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 bryanca...@gmail.com 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

[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 ++

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 --git a/src/mesa

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.c | 30

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 On 09/02/2011 11:09 AM

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.rst More comments below... Bryan

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

2011-09-10 Thread Bryan Cain
Cain wrote: 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 On 09/02/2011

[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 +

[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 bri...@vmware.com ---

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

2011-09-14 Thread Bryan Cain
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 On Sat, Sep 10, 2011 at 7:36 PM, Bryan Cain bryanca...@gmail.com wrote

[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 ---

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 ian.d.roman...@intel.com Signed-off-by: Ian Romanick ian.d.roman...@intel.com Cc: Bryan Cain bryanca...@gmail.com --- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 119 +--- 1 files changed, 2

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 the

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 2/2] glsl: Short-circuit lower_if_to_cond_assign when MaxIfDepth is UINT_MAX.

2011-10-19 Thread Bryan Cain
...@whitecape.org Cc: Bryan Cain bryanca...@gmail.com Cc: Ian Romanick i...@freedesktop.org --- 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_assign.cpp index

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 bryanca...@gmail.com On 10/21/2011 01:49 PM, Ian Romanick wrote: From: Ian Romanick ian.d.roman...@intel.com Setting this flag prevents declarations of uniforms from being removed from the IR. Since the IR is directly

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 i...@freedesktop.org mailto:i...@freedesktop.org wrote: On 01/29/2013 09:02 AM, Brian Paul wrote: Hi Bryan, Back in July you announced your work on geometry shaders:

[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

[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 e0425...@student.tuwien.ac.at v2 (Bryan Cain bryanca...@gmail.com): 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

[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. ---

[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

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] 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

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,

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

2013-07-30 Thread Bryan Cain
come up as a result, they can be addressed then. - Original Message - From: Bryan Cain bryanca...@gmail.com Before, it accounted for the size of the vertices but not the other fields in the vertex_header struct, which caused memory corruption. --- src/gallium/auxiliary

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] 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 bryanca...@gmail.com 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 2 implementations - at glsl linker

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

2012-07-12 Thread Bryan Cain
On 07/11/2012 12:24 AM, Eric Anholt wrote: Kenneth Graunke k...@kemper.freedesktop.org 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

[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

[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

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 identify the

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

2012-10-15 Thread Bryan Cain
::get_opcode() we should have scalar operands, not arrays. It's not clear to me how to fix that. I'm hoping someone who's spent more time on glsl_to_tgsi.cpp (is Bryan Cain still around?) can take a look at this. Thanks. -Brian ___ mesa-dev

[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 +++

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_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index

[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

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_TYPE_FLOAT/INT/UINT/BOOL, so the function would use

  1   2   >