Re: [Mesa-dev] [PATCH] TransformFeedback: Assign transform feedback varying slots in linker.

2011-10-24 Thread Dan McCabe
On 10/23/2011 01:19 PM, Marek Olšák wrote: On Sat, Oct 22, 2011 at 2:14 AM, Dan McCabezen3d.li...@gmail.com wrote: Modify the linker to assign additional slots for varying variables used by transform feedback. This is done after other varyings are already assigned slots. Since this is done

[Mesa-dev] [PATCH] TransformFeedback: Assign transform feedback varying slots in linker.

2011-10-21 Thread Dan McCabe
Modify the linker to assign additional slots for varying variables used by transform feedback. This is done after other varyings are already assigned slots. Since this is done after previous varying slot assignments, the code needs to know how many varyings are already assigned slots. A new

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 Dan McCabe
What are the implications for other architectures that support doubles? On 08/19/2011 05:56 PM, Eric Anholt wrote: At least for Intel, all our uniform components are of uint32_t size, either float or signed or unsigned int. For uploading uniform data in the driver, it's much easier to upload a

Re: [Mesa-dev] [PATCH 4/5] mesa: Fix glGetUniformfv of native integer uniforms.

2011-08-20 Thread Dan McCabe
On 08/20/2011 12:16 AM, Kenneth Graunke wrote: On 08/19/2011 05:56 PM, Eric Anholt wrote: We have to actually convert the values on the way out. Fixes piglit ARB_shader_objects/getuniform. --- src/mesa/main/uniforms.c | 32 1 files changed, 28

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 Dan McCabe
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 - that is the operative word. You can buy GPUs

Re: [Mesa-dev] [PATCH] intel: Emit assertion failure ASAP when DRI2 separate stencil handshake fails

2011-08-19 Thread Dan McCabe
On 08/19/2011 10:44 AM, Chad Versace wrote: On 08/19/2011 10:35 AM, Eric Anholt wrote: On Thu, 18 Aug 2011 14:02:46 -0700, Chad Versacec...@chad-versace.us wrote: When intel_verify_dri2_has_hiz() discovers that DRI2 (that is, the DDX driver) cannot provide a separate stencil buffer, but

Re: [Mesa-dev] [PATCH 3/4] i965/vs: Add simple dead code elimination.

2011-08-19 Thread Dan McCabe
On 08/18/2011 01:23 PM, Kenneth Graunke wrote: On 08/18/2011 12:02 PM, Matt Turner wrote: On Thu, Aug 18, 2011 at 2:38 PM, Eric Anholte...@anholt.net wrote: + bool progress = true; + while (progress) { + progress = false; + progress = dead_code_eliminate() || progress; ||

Re: [Mesa-dev] [PATCH] Implementing varying packing

2011-08-16 Thread Dan McCabe
On 08/16/2011 07:06 AM, vlj wrote: From: Vincent Lejeunev...@ovi.com This optimisation pass will look for and pack together float, vec2, vec3 varyings in fragment shaders and transform the vertex shader accordingly. It might improve performance depending on the hardware. Do you have any

Re: [Mesa-dev] [PATCH] glsl: Fix type error when lowering integer divisions

2011-08-15 Thread Dan McCabe
On 08/15/2011 10:45 AM, Paul Berry wrote: On 15 August 2011 10:11, Dan McCabezen3d.li...@gmail.com wrote: You might also want to consider implementing quotient = int((float(x) + 0.5 * float(y)) * reciprocal(float(y))); This rounds the result to the nearest integer rather then flooring the

Re: [Mesa-dev] [PATCH 0/5] glsl: Add switch statement support to the GLSL compiler.

2011-08-03 Thread Dan McCabe
On 08/03/2011 12:39 PM, Paul Berry wrote: On 1 August 2011 17:29, Dan McCabezen3d.li...@gmail.com wrote: This patch set adds support for switch statements to the GLSL compiler. We modify the grammar for the compiler with productions for switch statements and case labels, while adding

[Mesa-dev] [PATCH 0/5] glsl: Add switch statement support to the GLSL compiler.

2011-08-01 Thread Dan McCabe
This patch set adds support for switch statements to the GLSL compiler. We modify the grammar for the compiler with productions for switch statements and case labels, while adding supporting supporting productions not already present. New AST classes are defined to support those productions.

[Mesa-dev] [PATCH 1/5] glsl: Create AST data structures for switch statement and case label

2011-08-01 Thread Dan McCabe
Data structures for switch statement and case label are created that parallel the structure of other AST data. --- src/glsl/ast.h | 24 1 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/glsl/ast.h b/src/glsl/ast.h index 878f48b..2ee0b11 100644 ---

[Mesa-dev] [PATCH 2/5] glsl: Add productions to GLSL grammar for switch statement

2011-08-01 Thread Dan McCabe
The grammar is modified to support switch statements. Rather than follow the grammar in the appendix, which allows case labels to be placed ANYWHERE as a regular statement, we follow the development of the grammar as described in the body of the GLSL spec. In this variation, the switch statement

[Mesa-dev] [PATCH 3/5] glsl: Create AST structs corresponding to new productions in grammar

2011-08-01 Thread Dan McCabe
Previously we added productions for: switch_body case_label_list case_statement case_statement_list Now add AST structs corresponding to those productions. --- src/glsl/ast.h | 59 1 files changed, 59

Re: [Mesa-dev] [PATCH 1/3] intel: Fix span functions for stencil buffer

2011-07-11 Thread Dan McCabe
On 07/09/2011 08:56 AM, Chad Versace wrote: Up until this point, we incorrectly believed that the stencil buffer is Y-tiled. In fact, it is W tiled. From PRM Vol 1 Part 2 Section 4.5.2.1 W-Major Tile Format: W-Major Tile Format is used for separate stencil. Since the stencil buffer is

Re: [Mesa-dev] [PATCH 1/3] intel: Fix span functions for stencil buffer

2011-07-11 Thread Dan McCabe
On 07/11/2011 04:03 PM, Chad Versace wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/11/2011 12:49 PM, Dan McCabe wrote: On 07/09/2011 08:56 AM, Chad Versace wrote: Up until this point, we incorrectly believed that the stencil buffer is Y-tiled. In fact, it is W tiled. From PRM Vol

[Mesa-dev] Building internal glsl_compiler with builtin_function.o instead of builtin-stubs.o?

2011-07-07 Thread Dan McCabe
Is there a good reason not to build the internal glsl_compiler (in mesa/src/glsl) and link it with builtin_function.o? It is currently being built with builtin_stubs.o. I can understand why builtin_compiler uses builtin_stubs.o instead of builtin_function.o (to avoid conflicts while building

Re: [Mesa-dev] [PATCH 3/5] glsl: Create AST structs corresponding to new productions in grammar

2011-06-29 Thread Dan McCabe
On 06/28/2011 10:47 PM, Kenneth Graunke wrote: On 06/28/2011 02:48 PM, Dan McCabe wrote: Previously we added productions for: switch_body case_label_list case_statement case_statement_list Now add AST structs corresponding to those productions. Both 1/3 and 3/3

Re: [Mesa-dev] [PATCH 5/5] glsl: Generate IR for switch statements

2011-06-29 Thread Dan McCabe
Right back at ya', comments in-line, in response to your in-line comments. Thanks for the good feedback and review. cheers, danm On 06/29/2011 12:53 PM, Kenneth Graunke wrote: On 06/28/2011 02:48 PM, Dan McCabe wrote: Up until now modifying the GLSL compiler has been pretty straightforward

Re: [Mesa-dev] [PATCH 6/6] glsl: Generate IR for switch statements

2011-06-28 Thread Dan McCabe
On 06/28/2011 09:12 AM, Paul Berry wrote: On 27 June 2011 17:35, Keith Packardkei...@keithp.com wrote: I'd write the simplest possible code that works now and then consider optimizing it later. This has the advantage that you can get a bunch of tests working and then use those to validate a

[Mesa-dev] [PATCH 0/5] glsl: Add switch statement support to GLSL compiler

2011-06-28 Thread Dan McCabe
This patch set adds support for switch statements to the GLSL compiler. We modify the grammar for the compiler with productions for switch statements and case labels, while adding supporting supporting productions not already present. New AST classes are defined to support those productions.

[Mesa-dev] [PATCH 2/5] glsl: Add productions to GLSL grammar for switch statement

2011-06-28 Thread Dan McCabe
The grammar is modified to support switch statements. Rather than follow the grammar in the appendix, which allows case labels to be placed ANYWHERE as a regular statement, we follow the development of the grammar as described in the body of the GLSL. In this variation, the switch statement has a

[Mesa-dev] [PATCH 3/5] glsl: Create AST structs corresponding to new productions in grammar

2011-06-28 Thread Dan McCabe
Previously we added productions for: switch_body case_label_list case_statement case_statement_list Now add AST structs corresponding to those productions. --- src/glsl/ast.h | 59 1 files changed, 59

[Mesa-dev] [PATCH 4/5] glsl: Reference data structure ctors in grammar

2011-06-28 Thread Dan McCabe
We now tie the grammar to the ctors of the ASTs they reference. This requires that we actually have definitions of the ctors. In addition, we also need to define print and hir methods for the AST classes. The Print methods are pretty simple to flesh out. However, at this stage of the

Re: [Mesa-dev] [PATCH 0/6] glsl: Add support for switch statements

2011-06-28 Thread Dan McCabe
Comments at the end (where they are supposed to be :). On 06/17/2011 05:54 PM, Dan McCabe wrote: There are three changes from the patch set I published on 6/15: 1) Removed IR pointers from AST classes and moved them to glsl_parser_state, 2) Manage the new IR in a stack-like manner to properly

Re: [Mesa-dev] [PATCH 6/6] glsl: Generate IR for switch statements

2011-06-27 Thread Dan McCabe
On 06/27/2011 05:15 PM, Kenneth Graunke wrote: On 06/24/2011 05:11 PM, Dan McCabe wrote: Looking at a translation of my canonical example: switch (expr) { case c0: case c1: stmt0; case c2: case c3: stmt1; break; case c4: default: stmt2; } We can

Re: [Mesa-dev] [PATCH 6/6] glsl: Generate IR for switch statements

2011-06-27 Thread Dan McCabe
On 06/27/2011 04:40 PM, Kenneth Graunke wrote: Here's another case that I'm not sure you're handling correctly...conditional breaks: switch (expr) { case c0: case c1: stmt0; case c2: case c3: stmt1; break; case c4: stmt2; if (foo) break; stmt3;// happens

Re: [Mesa-dev] [PATCH 6/6] glsl: Generate IR for switch statements

2011-06-27 Thread Dan McCabe
On 06/27/2011 05:35 PM, Keith Packard wrote: On Mon, 27 Jun 2011 17:23:30 -0700, Dan McCabezen3d.li...@gmail.com wrote: Since I am just about to start modifying the IR generation, I'm open to suggestion. I'd write the simplest possible code that works now and then consider optimizing it

Re: [Mesa-dev] [PATCH 2/6] glsl: Add productions to GLSL grammar for switch statement

2011-06-24 Thread Dan McCabe
On 06/20/2011 03:39 PM, Ian Romanick wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/17/2011 05:43 PM, Dan McCabe wrote: The grammar is modified to support switch statements. Rather than follow the grammar in the appendix, which allows case labels to be placed ANYWHERE as a regular

Re: [Mesa-dev] [PATCH 3/6] glsl: Create AST structs corresponding to new productions in grammar

2011-06-24 Thread Dan McCabe
On 06/20/2011 03:31 PM, Ian Romanick wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/17/2011 05:43 PM, Dan McCabe wrote: + + exec_list cases; What types are in this list? If this is a list of ast_case_statements, there should be a comment to that effect. We've been really

Re: [Mesa-dev] [PATCH 4/6] glsl: Reference data structure ctors in grammar

2011-06-24 Thread Dan McCabe
On 06/20/2011 03:34 PM, Ian Romanick wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/17/2011 05:43 PM, Dan McCabe wrote: We now tie the grammar to the ctors of the ASTs they reference. This requires that we actually have definitions of the ctors. In addition, we also need

Re: [Mesa-dev] [PATCH 6/6] glsl: Generate IR for switch statements

2011-06-24 Thread Dan McCabe
On 06/20/2011 03:50 PM, Ian Romanick wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/17/2011 05:43 PM, Dan McCabe wrote: Beware! Here be dragons! I think this will generate the wrong code for: for (i = 0; i 10; i++) { switch (i

Re: [Mesa-dev] [PATCH 6/6] glsl: Generate IR for switch statements

2011-06-24 Thread Dan McCabe
On 06/24/2011 01:17 PM, Dan McCabe wrote: On 06/20/2011 03:50 PM, Ian Romanick wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/17/2011 05:43 PM, Dan McCabe wrote: Beware! Here be dragons! I think this will generate the wrong code for: for (i = 0; i 10; i

Re: [Mesa-dev] [PATCH 0/6] glsl: Add support for switch statements

2011-06-19 Thread Dan McCabe
On 06/19/2011 02:21 PM, Eric Anholt wrote: On Sat, 18 Jun 2011 09:29:32 +0200, Keith Packardkei...@keithp.com wrote: On Fri, 17 Jun 2011 17:43:14 -0700, Dan McCabezen3d.li...@gmail.com wrote: break; // implicit exit from loop at end of switch } while (true); Seems

[Mesa-dev] [PATCH 0/6] glsl: Add support for switch statements

2011-06-17 Thread Dan McCabe
This patch set adds support for switch statements to the GLSL compiler. We modify the grammar for the compiler with productions for switch statements and case labels, while adding supporting supporting productions not already present. New AST classes are defined to support those productions.

[Mesa-dev] [PATCH 1/6] glsl: Create AST data structures for switch statement and case label

2011-06-17 Thread Dan McCabe
Data structures for switch statement and case label are created that parallel the structure of other AST data. --- src/glsl/ast.h | 24 1 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/glsl/ast.h b/src/glsl/ast.h index 878f48b..39a59d4 100644 ---

[Mesa-dev] [PATCH 2/6] glsl: Add productions to GLSL grammar for switch statement

2011-06-17 Thread Dan McCabe
The grammar is modified to support switch statements. Rather than follow the grammar in the appendix, which allows case labels to be placed ANYWHERE as a regular statement, we follow the development of the grammar as described in the body of the GLSL. In this variation, the switch statement has a

[Mesa-dev] [PATCH 3/6] glsl: Create AST structs corresponding to new productions in grammar

2011-06-17 Thread Dan McCabe
Previously we added productions for: switch_body case_label_list case_statement case_statement_list Now add AST structs corresponding to those productions. --- src/glsl/ast.h | 49 + 1 files changed, 49

[Mesa-dev] [PATCH 4/6] glsl: Reference data structure ctors in grammar

2011-06-17 Thread Dan McCabe
We now tie the grammar to the ctors of the ASTs they reference. This requires that we actually have definitions of the ctors. In addition, we also need to define print and hir methods for the AST classes. At this stage of the development, we simply stub out the print and hir methods and flesh

[Mesa-dev] [PATCH 6/6] glsl: Generate IR for switch statements

2011-06-17 Thread Dan McCabe
Beware! Here be dragons! Up until now modyfing the GLSL compiler has been pretty straightforward. This is where things get interesting. Switch statement processing leverages infrastructure that was previously created (specifically for break statements, which are encountered in both loops and

[Mesa-dev] [PATCH 2/7] Add productions to GLSL grammar for switch statement

2011-06-15 Thread Dan McCabe
The grammar is modified to support switch statements. Rather than follow the grammar in the appendix, which allows case labels to be placed ANYWHERE as a regular statement, we follow the development of the grammar as described in the body of the GLSL. In this variation, the switch statement has a

[Mesa-dev] [PATCH 3/7] Create AST structs corresping to new productions in grammar

2011-06-15 Thread Dan McCabe
Previously we added productions for: switch_body case_label_list case_statement case_statement_list Now add AST structs corresponding to those productions. --- src/glsl/ast.h | 49 + 1 files changed, 49

[Mesa-dev] [PATCH 4/7] Reference data structure ctors in grammar

2011-06-15 Thread Dan McCabe
We now tie the grammar to the ctors of the ASTs they reference. This requires that we actually have definitions of the ctors. In addition, we also need to define print and hir methods for the AST classes. At this stage of the development, we simply stub out the print and hir methods and flesh

[Mesa-dev] [PATCH 5/7] Flesh out AST print methods

2011-06-15 Thread Dan McCabe
Pretty trivial stuff. Simply print the structure of the ASTs. No magic here. --- src/glsl/glsl_parser_extras.cpp | 38 -- 1 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp index

[Mesa-dev] [PATCH 6/7] Generate IR for switch statements

2011-06-15 Thread Dan McCabe
Beware! Here be dragons! Up until now modyfing the GLSL compiler has been pretty straightforward. This is where things get interesting. Switch statement processing leverages infrastructure that was previously created (specifically for break statements, which are encountered in both loops and

[Mesa-dev] Error building glxext.c

2011-05-04 Thread Dan McCabe
Hi all, Apologies if this is a stupid n00b question, but I'm getting errors building glxext.c in mesa/mesa/src/glx. Specific error msg is: glxext.c: In function ‘__glXWireToEvent’: glxext.c:141:35: error: ‘xGLXBufferSwapComplete’ has no member named ‘sbc_hi’

[Mesa-dev] Error building glxext.c

2011-05-04 Thread Dan McCabe
Hi all, Apologies if this is a stupid n00b question, but I'm getting errors building glxext.c in mesa/mesa/src/glx. Specific error msg is: glxext.c: In function ‘__glXWireToEvent’: glxext.c:141:35: error: ‘xGLXBufferSwapComplete’ has no member named ‘sbc_hi’