Re: [Mesa-dev] [PATCH 06/19] glsl: Refactor code to check that identifier names are valid.

2013-10-08 Thread Paul Berry
On 5 October 2013 12:12, Kenneth Graunke wrote: > On 10/02/2013 05:45 PM, Paul Berry wrote: > > GLSL reserves identifiers beginning with "gl_" or containing "__", but > > we haven't been consistent about enforcing this rule. This patch > > makes a

[Mesa-dev] [PATCH] glsl: Rename the fourth argument to get_interface_instance.

2013-10-08 Thread Paul Berry
Interface declarations have two names associated with them: the block name and the instance name. It's the block name that needs to be passed to get_interface_instance(). This patch renames the argument so that there's no confusion. --- src/glsl/glsl_types.cpp | 8 src/glsl/glsl_types.h

Re: [Mesa-dev] [PATCH 02/19] glsl: Fix block name of built-in gl_PerVertex interface block.

2013-10-08 Thread Paul Berry
On 5 October 2013 12:10, Kenneth Graunke wrote: > On 10/02/2013 05:45 PM, Paul Berry wrote: > > Previously, we erroneously used the name "gl_in" for both the block > > name and the instance name. > > --- > > src/glsl/builtin_variables.cpp | 2 +- > >

Re: [Mesa-dev] [PATCH v2] i965: Initialize brw_blorp_const_color_program::prog_data.

2013-10-07 Thread Paul Berry
On 27 September 2013 22:24, Vinson Lee wrote: > Fixes "Uninitialized scalar field" defect reported by Coverity. > > Signed-off-by: Vinson Lee > --- > src/mesa/drivers/dri/i965/brw_blorp_clear.cpp | 2 ++ > 1 file changed, 2 insertions(+) > Reviewed-by: Paul Ber

Re: [Mesa-dev] [PATCH] i965/blorp: Fix the register types on blorp's push constants.

2013-10-07 Thread Paul Berry
, and it meant if you used the push constant as the first operand > you would have been disappointed. > --- > src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 32 > ++-- > 1 file changed, 16 insertions(+), 16 deletions(-) > Reviewed-by: Paul Berry > &g

Re: [Mesa-dev] [PATCH 3/4] glsl/gs: handle gl_ClipDistance geometry input in lower_clip_distance.

2013-10-05 Thread Paul Berry
On 28 September 2013 14:59, Paul Berry wrote: > On 27 September 2013 14:32, Ian Romanick wrote: > >> There are some bits of this patch I'm trying to understand. I think >> they can be cleared up by one question below... >> >> On 09/14/2013 01:00 PM, Paul

Re: [Mesa-dev] [PATCH 09/10] i965/fs: Add a peephole pass to combine ADD with ADDC/SUBB.

2013-10-04 Thread Paul Berry
On 4 October 2013 14:24, Matt Turner wrote: > On Fri, Oct 4, 2013 at 2:19 PM, Paul Berry > wrote: > > On 4 October 2013 13:51, Paul Berry wrote: > >> > >> On 3 October 2013 10:59, Matt Turner wrote: > >>> > >>> v2: Check fixed_hw_reg.

Re: [Mesa-dev] [PATCH 10/10] i965/vs: Add a peephole pass to combine ADD with ADDC/SUBB.

2013-10-04 Thread Paul Berry
On 3 October 2013 11:00, Matt Turner wrote: > v2: Check fixed_hw_reg.{file,nr} instead of dst.reg. > v3: Store the bool emitted_addc_or_subb in the class, not static. > --- > src/mesa/drivers/dri/i965/brw_vec4.h | 3 + > src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 104 >

Re: [Mesa-dev] [PATCH 09/10] i965/fs: Add a peephole pass to combine ADD with ADDC/SUBB.

2013-10-04 Thread Paul Berry
On 4 October 2013 13:51, Paul Berry wrote: > On 3 October 2013 10:59, Matt Turner wrote: > >> v2: Check fixed_hw_reg.{file,nr} instead of dst.reg. >> v3: Store the bool emitted_addc_or_subb in the class, not static. >> --- >> src/mesa/drivers/dri/i965/brw_fs.h

Re: [Mesa-dev] [PATCH 09/10] i965/fs: Add a peephole pass to combine ADD with ADDC/SUBB.

2013-10-04 Thread Paul Berry
sitor.cpp | 104 > +++ > 2 files changed, 107 insertions(+) > Reviewed-by: Paul Berry > > diff --git a/src/mesa/drivers/dri/i965/brw_fs.h > b/src/mesa/drivers/dri/i965/brw_fs.h > index 6a53e59..c703c2b 100644 > --- a/src/mesa/drivers/dri/i965/brw_fs.h >

Re: [Mesa-dev] [PATCH 06/10] i965: Don't dead-code eliminate instructions that write to the accumulator.

2013-10-04 Thread Paul Berry
On 27 September 2013 18:17, Matt Turner wrote: > v2: Set destination register using brw_null_reg(). > Reviewed-by: Paul Berry > --- > src/mesa/drivers/dri/i965/brw_fs.cpp | 15 ++- > src/mesa/drivers/dri/i965/brw_vec4.cpp | 15 ++- > 2 files chan

[Mesa-dev] [PATCH 03/19] glsl: Refactor code for creating gl_PerVertex interface block.

2013-10-02 Thread Paul Berry
Currently, we create just a single gl_PerVertex interface block for geometry shader inputs. In later patches, we'll also need to create an interface block for geometry and vertex shader outputs. Moving the code into its own class will make reuse easier. --- src/glsl/builtin_variables.cpp | 72 ++

[Mesa-dev] [PATCH 19/19] glsl: Don't allow gl_PerVertex to be redeclared after it's been used.

2013-10-02 Thread Paul Berry
Fixes piglit tests: - spec/glsl-1.50/compiler/gs-redeclares-pervertex-in-after-other-usage.geom - spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-after-other-usage.geom - spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-after-usage.geom - spec/glsl-1.50/compiler/vs-redeclares-pervertex-out-a

[Mesa-dev] [PATCH 18/19] glsl: Support redeclaration of GS gl_PerVertex input.

2013-10-02 Thread Paul Berry
Fixes piglit test spec/glsl-1.50/execution/redeclare-pervertex-subset-vs-to-gs. --- src/glsl/ast_to_hir.cpp | 23 +-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index f44e97d..a4af562 100644 --- a/src/glsl/as

[Mesa-dev] [PATCH 17/19] glsl: Catch redeclaration of interface block instance names at compile time.

2013-10-02 Thread Paul Berry
>From section 4.1.9 (Arrays) of the GLSL 4.40 spec (as of revision 7): However, unless noted otherwise, blocks cannot be redeclared; an unsized array in a user-declared block cannot be sized through redeclaration. The only place where the spec notes that interface blocks can be redecl

[Mesa-dev] [PATCH 16/19] glsl: Support redeclaration of VS and GS gl_PerVertex output.

2013-10-02 Thread Paul Berry
Fixes piglit tests: - spec/glsl-1.50/execution/redeclare-pervertex-out-subset-gs - spec/glsl-1.50/execution/redeclare-pervertex-subset-vs --- src/glsl/ast_to_hir.cpp | 62 +++-- 1 file changed, 60 insertions(+), 2 deletions(-) diff --git a/src/glsl/ast_

[Mesa-dev] [PATCH 15/19] glsl: Error check redeclarations of gl_PerVertex.

2013-10-02 Thread Paul Berry
This patch verifies that: - The gl_PerVertex input interface block may only be redeclared in a geometry shader, and that it may only be redeclared as gl_in[]. - The gl_PerVertex output interface block may only be redeclared in a vertex or geometry shader, and that it may only be redeclared as

[Mesa-dev] [PATCH 14/19] glsl: Make it possible to remove a variable from the symbol table.

2013-10-02 Thread Paul Berry
In later patches, we'll use this in order to implement the required behaviour that after the gl_PerVertex interface block has been redeclared, only members of the redeclared interface block may be used. --- src/glsl/glsl_symbol_table.cpp | 9 + src/glsl/glsl_symbol_table.h | 7 +++ 2

[Mesa-dev] [PATCH 13/19] glsl: Add an ir_variable::reinit_interface_type() function.

2013-10-02 Thread Paul Berry
This will be used by future patches to change an ir_variable's interface type when the gl_PerVertex built-in interface block is redeclared. --- src/glsl/ir.h | 25 + 1 file changed, 25 insertions(+) diff --git a/src/glsl/ir.h b/src/glsl/ir.h index 25c7e82..595c935 100644 -

[Mesa-dev] [PATCH 12/19] glsl: Generalize processing of variable redeclarations.

2013-10-02 Thread Paul Berry
This patch modifies the get_variable_being_redeclared() function so that it no longer relies on the ast_declaration for the variable being redeclared. In future patches, this will allow get_variable_being_redeclared() to be used for processing redeclarations of the built-in gl_PerVertex interface

[Mesa-dev] [PATCH 11/19] glsl: Don't allow invalid identifiers as struct names.

2013-10-02 Thread Paul Berry
Fixes piglit test spec/glsl-1.10/compiler/struct/struct-name-uses-gl-prefix.vert. --- src/glsl/ast_to_hir.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index bb14fc9..8fb7f2f 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hi

[Mesa-dev] [PATCH 10/19] glsl: Don't allow invalid identifiers as interface block instance names.

2013-10-02 Thread Paul Berry
Note: we need to make an exception for the gl_PerVertex interface block, since in geometry shaders it is allowed to be redeclared with the instance name gl_in. Future patches will make redeclaration of gl_PerVertex work properly. Fixes piglit test spec/glsl-1.50/compiler/interface-block-instance-

[Mesa-dev] [PATCH 09/19] glsl: Don't allow invalid identifier names in struct/interface fields.

2013-10-02 Thread Paul Berry
Note: we need to make an exception for the gl_PerVertex interface block, since built-in variables are allowed to be redeclared inside it. Future patches will make redeclaration of gl_PerVertex work properly. Fixes piglit tests: - spec/glsl-1.50/compiler/interface-block-array-elem-uses-gl-prefix.v

[Mesa-dev] [PATCH 08/19] glsl: Don't allow invalid identifiers as interface block names.

2013-10-02 Thread Paul Berry
Note: we need to make an exception for the gl_PerVertex interface block, since this is allowed to be redeclared. Future patches will make redeclaration of gl_PerVertex work properly. Fixes piglit test spec/glsl-1.50/compiler/interface-block-name-uses-gl-prefix.vert. --- src/glsl/ast_to_hir.cpp |

[Mesa-dev] [PATCH 07/19] glsl: Don't allow unnamed interface blocks to redeclare variables.

2013-10-02 Thread Paul Berry
Note: some limited amount of redeclaration is actually allowed, provided the shader is redeclaring the built-in gl_PerVertex interface block. Support for this will be added in future patches. Fixes piglit tests spec/glsl-1.50/compiler/unnamed-interface-block-elem-conflicts-with-prev-{block-elem,g

[Mesa-dev] [PATCH 06/19] glsl: Refactor code to check that identifier names are valid.

2013-10-02 Thread Paul Berry
GLSL reserves identifiers beginning with "gl_" or containing "__", but we haven't been consistent about enforcing this rule. This patch makes a new function to check whether identifier names are valid. In the process it closes a loophole where we would previously allow function argument names to

[Mesa-dev] [PATCH 05/19] glsl: Account for location field when comparing interface blocks.

2013-10-02 Thread Paul Berry
In commit e2660770731b018411fbe1620cacddaf8dff5287 (glsl: Keep track of location for interface block fields), I neglected to update glsl_type::record_key_compare to account for the fact that interface types now contain location information. As a result, interface types that differ only by their lo

[Mesa-dev] [PATCH 04/19] glsl: Construct gl_PerVertex interfaces for GS and VS outputs.

2013-10-02 Thread Paul Berry
Although these interfaces can't be accessed directly by GLSL (since they don't have an instance name), they will be necessary in order to allow redeclarations of gl_PerVertex. --- src/glsl/builtin_variables.cpp | 26 +++--- 1 file changed, 19 insertions(+), 7 deletions(-) diff

[Mesa-dev] [PATCH 02/19] glsl: Fix block name of built-in gl_PerVertex interface block.

2013-10-02 Thread Paul Berry
Previously, we erroneously used the name "gl_in" for both the block name and the instance name. --- src/glsl/builtin_variables.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp index 3667dc8..91518ba 100644 --- a

[Mesa-dev] [PATCH 01/19] glsl: Construct gl_in with a location of -1.

2013-10-02 Thread Paul Berry
We use a location of -1 for variables which don't have their own assigned locations--this includes ir_variables which represent named interface blocks. Technically the location assigned to gl_in doesn't matter, since gl_in is only accessed via its members (which have their own locations). But it'

[Mesa-dev] [PATCH 00/19] glsl: Support redeclaration of gl_PerVertex interface blck.

2013-10-02 Thread Paul Berry
This patch series adds the necessary machinery to the GLSL compiler to allow shaders to redeclare the gl_PerVertex interface block. Although the precise rules for how to redeclare gl_PerVertex were not published until GLSL 4.10, it seems clear from context that this was intended as a clarification

Re: [Mesa-dev] [PATCH V4 01/13] mesa: add texture gather changes

2013-10-02 Thread Paul Berry
On 30 September 2013 03:08, Chris Forbes wrote: > From: Maxence Le Dore > > Reviewed-by: Kenneth Graunke > This patch broke "make check" for me. src/mesa/main/tests/test-suite.log shows: == Mesa 9.3.0-devel: src/mesa/main/tests/test-

[Mesa-dev] [PATCH] i965/fs: Improve accuracy of dFdy() to match dFdx().

2013-10-01 Thread Paul Berry
Previously, we computed dFdy() using the following instruction: add(8) dst<1>F src<4,4,0)F -src.2<4,4,0>F { align1 1Q } That had the disadvantage that it computed the same value for all 4 pixels of a 2x2 subspan, which meant that it was less accurate than dFdx(). This patch changes it to the f

Re: [Mesa-dev] [PATCH 3/4] glsl/gs: handle gl_ClipDistance geometry input in lower_clip_distance.

2013-09-28 Thread Paul Berry
On 27 September 2013 14:32, Ian Romanick wrote: > There are some bits of this patch I'm trying to understand. I think > they can be cleared up by one question below... > > On 09/14/2013 01:00 PM, Paul Berry wrote: > > From: Bryan Cain > > > > This corresponds

[Mesa-dev] [PATCH] i965/gs: Fix incorrect numbering of DWORDs in 3DSTATE_GS

2013-09-27 Thread Paul Berry
In commit 247f90c77e8f3894e963d796628246ba0bde27b5 (i965/gs: Set control data header size/format appropriately for EndPrimitive()), I incorrectly numbered the DWORDs in the 3DSTATE_GS command starting from 1 instead of starting from 0. This caused the control data format to be programmed into the

[Mesa-dev] [PATCH] i965/blorp: retype destination register for texture SEND instruction to UW.

2013-09-27 Thread Paul Berry
>From the bspec documentation of the SEND instruction: "destination region cannot cross the 256-bit register boundary." To avoid violating this restriction when executing SIMD16 texturing operations (such as those used by blorp), we need to ensure that the destination of the SEND instruction

[Mesa-dev] [PATCH 10/10] glsl: Modify array_sizing_visitor to handle unnamed interface blocks.

2013-09-27 Thread Paul Berry
We were already setting the array size of unsized arrays that appeared inside unnamed interface blocks, but we weren't updating ir_variable::interface_type to reflect the new array size, causing bogus link errors. This patch causes array_sizing_visitor to keep track of all the unnamed interface ty

[Mesa-dev] [PATCH 09/10] glsl: Update call_link_visitor to update max_ifc_array_access.

2013-09-27 Thread Paul Berry
When multiple shaders of the same type access an interface block containing an unsized array, we need to set the array size based on the maximum array element accessed across all the shaders. This is similar to what we already do with unsized arrays occurring outside of interface blocks. Note: on

[Mesa-dev] [PATCH 08/10] glsl/linker: Modify array_sizing_visitor to handle named interface blocks.

2013-09-27 Thread Paul Berry
Unsized arrays appearing inside named interface blocks now get a proper size assigned by the array_sizing_visitor. Fixes piglit tests: - spec/glsl-1.50/execution/unsized-in-named-interface-block - spec/glsl-1.50/execution/unsized-in-named-interface-block-gs - spec/glsl-1.50/linker/unsized-in-named

[Mesa-dev] [PATCH 06/10] glsl: Sanity check max_ifc_array_access in ir_validate::visit(ir_variable *).

2013-09-27 Thread Paul Berry
--- src/glsl/ir_validate.cpp | 20 1 file changed, 20 insertions(+) diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp index 2c64f4e..93bc4d9 100644 --- a/src/glsl/ir_validate.cpp +++ b/src/glsl/ir_validate.cpp @@ -674,6 +674,26 @@ ir_validate::visit(ir_variable

[Mesa-dev] [PATCH 07/10] glsl: Update ir_variable::max_ifc_array_access properly.

2013-09-27 Thread Paul Berry
This patch adds an implementation of ir_dereference_record::update_max_array_access(), which ensures that ir_variable::max_ifc_array_access is properly updated to reflect the shader's use of arrays appearing within interface blocks. --- src/glsl/ir.cpp | 36 sr

[Mesa-dev] [PATCH 05/10] glsl: Add an ir_variable::max_ifc_array_access field.

2013-09-27 Thread Paul Berry
For interface blocks that contain arrays, this field will contain the maximum element of each contained array that is accessed by the shader. This is a first step toward supporting unsized arrays in interface blocks. --- src/glsl/ir.cpp | 3 ++- src/glsl/ir.h | 17 +

[Mesa-dev] [PATCH 03/10] glsl: Move update of max_array_access into a virtual function on ir_rvalue.

2013-09-27 Thread Paul Berry
Currently, when converting an access to an array element from ast to IR, we need to see if the array is an ir_dereference_variable, and if so update the variable's max_array_access. When we add support for unsized arrays in interface blocks, we'll also need to account for cases where the array is

[Mesa-dev] [PATCH 02/10] glsl: Link uniform-initializer-test with standalone_scaffolding.cpp.

2013-09-27 Thread Paul Berry
Future patches in this series will add calls to _mesa_glsl_error() to ir.cpp. _mesa_glsl_error() calls _mesa_glsl_msg(), which calls _mesa_shader_debug(), which is defined in mesa/main/errors.c (and hence not available when compiling GLSL unit tests). To avoid link errors, link uniform-initialize

[Mesa-dev] [PATCH 01/10] glsl: Add parser support for unsized arrays in interface blocks.

2013-09-27 Thread Paul Berry
Although it's not explicitly stated in the GLSL 1.50 spec, unsized arrays are allowed in interface blocks. section 1.2.3 (Changes from revision 5 of version 1.5) of the GLSL 1.50 spec says: * Completed full update to grammar section. Tested spec examples against it: ... *

[Mesa-dev] [PATCH 00/10] glsl: Support unsized arrays in interface blocks.

2013-09-27 Thread Paul Berry
Although it's not explicitly stated in the GLSL 1.50 spec, it is clearly implied that unsized arrays are allowed in interface blocks (the built-in interface gl_PerVertex contains an unsized array, gl_ClipDistance, and examples added in GLSL 4.30 make use of unsized arrays in interface blocks). >Fr

[Mesa-dev] [PATCH 04/10] glsl: Make accessor functions for ir_variable::interface_type.

2013-09-27 Thread Paul Berry
In a future patch, this will allow us to enforce invariants when the interface type is updated. --- src/glsl/ast_to_hir.cpp| 4 ++-- src/glsl/ir.h | 15 +++ src/glsl/link_interface_blocks.cpp | 17 +

Re: [Mesa-dev] [PATCH 24/24] i965: Simplify the shader time code by using atomic counter helpers.

2013-09-26 Thread Paul Berry
2, 5, 7, 11, 17, 20, 23, and 24) are: Reviewed-by: Paul Berry However, there are two things which I expected to see in this patch series but I didn't: - Do atomic_uints need similar handling to ir_sampler_replacement_visitor in opt_function_inlining? - Do we need to update schedule_node::s

Re: [Mesa-dev] [PATCH 22/24] i965/gen7: Handle atomic instructions from the VEC4 back-end.

2013-09-26 Thread Paul Berry
On 15 September 2013 00:19, Francisco Jerez wrote: > This can deal with all the 15 32-bit untyped atomic operations the > hardware supports, but only INC and PREDEC are going to be exposed > through the API for now. > --- > src/mesa/drivers/dri/i965/brw_vec4.h | 7 +++ > src/mesa/driv

Re: [Mesa-dev] [PATCH 21/24] i965/gen7: Handle atomic instructions from the FS back-end.

2013-09-26 Thread Paul Berry
On 15 September 2013 00:19, Francisco Jerez wrote: > This can deal with all the 15 32-bit untyped atomic operations the > hardware supports, but only INC and PREDEC are going to be exposed > through the API for now. > --- > src/mesa/drivers/dri/i965/brw_fs.h | 7 +++ > src/mesa/driver

Re: [Mesa-dev] [PATCH 18/24] i965: Add a 'has_side_effects' back-end instruction predicate.

2013-09-26 Thread Paul Berry
On 15 September 2013 00:10, Francisco Jerez wrote: > Analogous to the GLSL IR predicate with the same name. This patch > fixes the three dead code elimination passes and the VEC4/FS > instruction scheduling passes so they leave instructions with side > effects alone. > > At some point it might b

Re: [Mesa-dev] [PATCH 16/24] i965/gen7: Implement code generation for untyped atomic instructions.

2013-09-26 Thread Paul Berry
uld be nice to have a comment somewhere in the else block explaining that on IVB, SIMD4x2 atomic operations aren't available, so we implement them using SIMD8 messages, and we rely on the shader compiler to set the execution mask accordingly. With that comment added, this patch is: Reviewed-by: Paul B

Re: [Mesa-dev] [PATCH] i965: extend fast texture upload

2013-09-25 Thread Paul Berry
On 25 September 2013 10:18, Chad Versace wrote: > On 07/22/2013 03:54 PM, Frank Henigman wrote:> Extend the fast texture > upload from BGRA X-tiled to include RGBA, > > diff --git a/src/mesa/drivers/dri/i965/intel_tex_subimage.c > b/src/mesa/drivers/dri/i965/intel_tex_subimage.c > > index 05e684c.

Re: [Mesa-dev] [PATCH 3/7] mesa: Shrink the size of the enum string lookup struct.

2013-09-21 Thread Paul Berry
On 21 September 2013 09:03, Kenneth Graunke wrote: > On 09/21/2013 07:59 AM, Brian Paul wrote: > > On Fri, Sep 20, 2013 at 7:52 PM, Eric Anholt wrote: > >> Since it's only used for debug information, we can misalign the struct > and > >> save the disk space. Another 19k on a 64-bit build. > >>

[Mesa-dev] [RFC PATCH] i965/fs: Improve accuracy of dFdy().

2013-09-20 Thread Paul Berry
Previously, we computed dFdy() using the following instruction: add(8) dst<1>F src<4,4,0)F -src.2<4,4,0>F { align1 1Q } That had the disadvantage that it computed the same value for all 4 pixels of a 2x2 subspan, which meant that it was less accurate than dFdx(). This patch changes it to the f

Re: [Mesa-dev] [PATCH] i965/hsw: compute DDX in a subspan based only on top row

2013-09-20 Thread Paul Berry
On 17 September 2013 19:54, Chia-I Wu wrote: > Hi Paul, > > On Mon, Sep 16, 2013 at 3:46 PM, Chia-I Wu wrote: > > On Sat, Sep 14, 2013 at 5:15 AM, Paul Berry > wrote: > >> On 12 September 2013 22:06, Chia-I Wu wrote: > >>> > >>> From: Chia-I

Re: [Mesa-dev] [PATCH 15/24] i965: Implement ABO surface state emission.

2013-09-19 Thread Paul Berry
comments in the .emit functions showing where it refers to GL state, so that it's clear why each of the dirty bits is needed. So above this line there should be the comment "/* _NEW_PROGRAM */". Similar comments apply to brw_upload_{vs,wm}_abo_surfaces(). > + > + if (prog) > + b

Re: [Mesa-dev] [PATCH 14/24] i965: Define vtbl method that initializes an untyped R/W surface.

2013-09-19 Thread Paul Berry
gt; + bo, > + offset, > + BRW_SURFACEFORMAT_RAW, > + size - 1, > Note: if you land this patch after Ken's "

Re: [Mesa-dev] [PATCH 13/24] glsl: Linker support for ARB_shader_atomic_counters.

2013-09-19 Thread Paul Berry
t; + const unsigned max_atomic_buffers[MESA_SHADER_TYPES] = { > + ctx->Const.VertexProgram.MaxAtomicBuffers, > + ctx->Const.GeometryProgram.MaxAtomicBuffers, > + ctx->Const.FragmentProgram.MaxAtomicBuffers > + }; > + active_atomic_buffers_t abs = find_ac

Re: [Mesa-dev] More questions from a newbie

2013-09-19 Thread Paul Berry
On 19 September 2013 00:54, Rogovin, Kevin wrote: > Hello all, > > ** ** > > I thank all those that have answered my questions, I still have a few > more. Here goes. > > ** ** > > I saw that geometry shaders were landed recently in some form. My > questions are: > > **ยท **W

Re: [Mesa-dev] [PATCH 02/24] glsl: Initialize all member variables of _mesa_glsl_parse_state on construction.

2013-09-18 Thread Paul Berry
On 18 September 2013 13:15, Ian Romanick wrote: > On 09/18/2013 01:35 PM, Paul Berry wrote: > > On 18 September 2013 07:43, Ian Romanick > <mailto:i...@freedesktop.org>> wrote: > > > > On 09/15/2013 02:10 AM, Francisco Jerez wrote: > > > The _

Re: [Mesa-dev] [PATCH 11/17] mesa: Get GL_MAX_VARYING_FLOATS_ARB from VertexProgram.MaxOutputComponents

2013-09-18 Thread Paul Berry
On 18 September 2013 13:04, Ian Romanick wrote: > On 09/13/2013 01:45 PM, Paul Berry wrote: > > On 11 September 2013 16:28, Ian Romanick > <mailto:i...@freedesktop.org>> wrote: > > Another question which we haven't really addressed is how Mesa's front >

Re: [Mesa-dev] [PATCH 02/24] glsl: Initialize all member variables of _mesa_glsl_parse_state on construction.

2013-09-18 Thread Paul Berry
On 18 September 2013 07:43, Ian Romanick wrote: > On 09/15/2013 02:10 AM, Francisco Jerez wrote: > > The _mesa_glsl_parse_state object relies on the memory allocator > > zeroing out its contents before it's initialized, which seems rather > > risky. One of the following commits will homogenize i

Re: [Mesa-dev] [PATCH 00/24] Support for ARB_shader_atomic_counters.

2013-09-17 Thread Paul Berry
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev > I'm halfway through the series and I'm out of time for code review today. I sent comments on patches 3, 4, 8, 9, 10, and 12. Patches 1, 2, 5, 7, and 11 are: Reviewed-by: Paul Berry Patch 6 deserves the attention of s

Re: [Mesa-dev] [PATCH 12/24] glsl: Add predicate to determine if an IR node has side effects.

2013-09-17 Thread Paul Berry
On 15 September 2013 00:10, Francisco Jerez wrote: > And fix the dead code elimination pass so atomic writes aren't > optimized out in cases where the return value isn't used by the > program. > As I mentioned in my comments on patch 9, I'd prefer if we went with a different approach where we do

Re: [Mesa-dev] [PATCH 10/24] glsl: Implement parser support for atomic counters.

2013-09-17 Thread Paul Berry
On 15 September 2013 00:10, Francisco Jerez wrote: > --- > src/glsl/ast.h| 15 ++ > src/glsl/ast_to_hir.cpp | 68 > +-- > src/glsl/ast_type.cpp | 13 +++-- > src/glsl/glsl_lexer.ll| 2 +- > src/glsl/glsl_p

Re: [Mesa-dev] [PATCH 09/24] glsl: Add IR node for atomic operations.

2013-09-17 Thread Paul Berry
On 15 September 2013 00:10, Francisco Jerez wrote: > Add a subclass of ir_rvalue that represents an atomic operation on > some ir_variable. Also define a new IR visitor method, and implement > IR builder, printer and reader support for it. > I don't think this approach is going to be reliable.

Re: [Mesa-dev] [PATCH 08/24] glsl: Add new atomic_uint built-in GLSL type.

2013-09-17 Thread Paul Berry
On 17 September 2013 12:18, Paul Berry wrote: > On 15 September 2013 00:10, Francisco Jerez wrote: > >> >> /** >> +* Return the amount of atomic counter storage required for a type. >> +*/ >> + unsigned atomic_size() const >> + { >&g

Re: [Mesa-dev] [PATCH 08/24] glsl: Add new atomic_uint built-in GLSL type.

2013-09-17 Thread Paul Berry
On 15 September 2013 00:10, Francisco Jerez wrote: > --- > src/glsl/ast_to_hir.cpp | 1 + > src/glsl/builtin_type_macros.h | 2 ++ > src/glsl/builtin_types.cpp | 6 ++ > src/glsl/glsl_types.cpp | 2 ++ > src/glsl/g

Re: [Mesa-dev] [PATCH 04/24] ralloc: Unify overloads of the new operator and guarantee object destruction.

2013-09-17 Thread Paul Berry
On 15 September 2013 00:10, Francisco Jerez wrote: > This patch introduces a pair of helper functions providing a common > implementation of the "new" and "delete" operators for all C++ classes > that are allocated by ralloc via placement new. The 'ralloc_new' > helper function takes care of set

Re: [Mesa-dev] [PATCH 03/24] i965: Initialize all member variables of vec4_instruction on construction.

2013-09-17 Thread Paul Berry
2. I'd prefer to see each commit message stand on its own, since commits often wind up getting cherry-picked into alternate orders, or viewed in isolation, so it won't always be obvious to the reader what "ditto" means. With that fixed, the patch is: Reviewed-by: Paul B

Re: [Mesa-dev] a newbie asking newbie questions

2013-09-17 Thread Paul Berry
On 17 September 2013 05:13, Rogovin, Kevin wrote: > Hello, > > Thank you for the very fast answers, some more questions: > > > > It's not a preference question. The registers are 8 floats wide. > > Vertex shaders get invoked 2 vertices at a time, with a register > containing these values: > > >

Re: [Mesa-dev] [PATCH 4/4] i965: Refactor Gen4-6 SURFACE_STATE setup for buffer surfaces.

2013-09-16 Thread Paul Berry
with buffer_size that I mentioned in patch 1 applies to this patch too. With that fixed, the patch is: Reviewed-by: Paul Berry > > Signed-off-by: Kenneth Graunke > --- > src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 98 > +--- > 1 file chan

Re: [Mesa-dev] [PATCH 3/4] i965: Remove MIPLAYOUT_BELOW from Gen4-6 constant buffer surface state.

2013-09-16 Thread Paul Berry
On 13 September 2013 23:10, Kenneth Graunke wrote: > Specifying a miptree layout makes no sense for constant buffers. > You might want to mention in the commit message that there's no functional change since BRW_SURFACE_MIPMAPLAYOUT_BELOW == 0. In any case, the patch is: Review

Re: [Mesa-dev] [PATCH 1/4] i965: Refactor Gen7+ SURFACE_STATE setup for buffer surfaces.

2013-09-16 Thread Paul Berry
On 16 September 2013 09:38, Eric Anholt wrote: > Kenneth Graunke writes: > > > This was an embarassingly large amount of copy and pasted code, > > and it wasn't particularly simple code either. By factoring it out > > into a helper function, we consolidate the complexity. > > > > Signed-off-by:

Re: [Mesa-dev] [PATCH 2/4] i965: Share Gen7+ SURFACE_STATE setup for textures and renderbuffers.

2013-09-16 Thread Paul Berry
t of drm_intel_bo_emit_reloc(), but the code you're removing passed I915_GEM_DOMAIN_RENDER. Is this a problem? > - > - gen7_check_surface_setup(surf, true /* is_render_target */); > + gen7_emit_image_surface_state(brw, > +

Re: [Mesa-dev] [PATCH 3/3] i965: Use gen7_upload_constant_state for 3DSTATE_CONSTANT_PS as well.

2013-09-16 Thread Paul Berry
On 13 September 2013 16:05, Kenneth Graunke wrote: > Now we use gen7_upload_constant_state() for all three shader stages. > > Signed-off-by: Kenneth Graunke > Cc: Paul Berry > Series is: Reviewed-by: Paul Berry ___ mesa-dev mailin

Re: [Mesa-dev] [PATCH 1/4] i965: Refactor Gen7+ SURFACE_STATE setup for buffer surfaces.

2013-09-16 Thread Paul Berry
On 13 September 2013 23:10, Kenneth Graunke wrote: > This was an embarassingly large amount of copy and pasted code, > and it wasn't particularly simple code either. By factoring it out > into a helper function, we consolidate the complexity. > > Signed-off-by: Kenneth Graunke > I really like

Re: [Mesa-dev] [PATCH 3/3] glsl: Drop shader_bit_encoding version checks.

2013-09-16 Thread Paul Berry
On 13 September 2013 11:25, Kenneth Graunke wrote: > We now set the ARB_shader_bit_encoding flag for versions that support > this functionality, so we don't need to double check it here. > > Signed-off-by: Kenneth Graunke > Cc: Ian Romanick > --- > src/glsl/builtin_functions.cpp | 3 +-- > 1 f

Re: [Mesa-dev] Could use your help with a bug involving piglit, waffle, and egl.

2013-09-16 Thread Paul Berry
(CC'ing Mesa-dev since this is a Mesa bug). On 16 September 2013 11:00, Chad Versace wrote: > CC'ing Piglit. > > > On 09/14/2013 08:54 AM, Paul Berry wrote: > >> I'm investigating a failure in spec/OES_fixed_point/**attribute-arrays, >> specifically t

Re: [Mesa-dev] [PATCH 11/15] i965/fs: When >64 input components, order them to match prev pipeline stage.

2013-09-16 Thread Paul Berry
On 15 September 2013 21:16, Kenneth Graunke wrote: > On 09/03/2013 04:18 PM, Paul Berry wrote: > > Since the SF/SBE stage is only capable of performing arbitrary > > reorderings of 16 varying slots, we can't arrange the fragment shader > > inputs in an arbitrary order

[Mesa-dev] [PATCH 2/2] i965/gs: New gs primitive types are supported by HW primitive restart.

2013-09-14 Thread Paul Berry
When we previously implemented primitive restart, we didn't add cases to brw_primitive_restart.c's can_cut_index_handle_prims() for the primitive types that are introduced with geometry shaders. It turns out that all of the new primitive types are supported by hardware primitive restart. --- src/

[Mesa-dev] [PATCH 1/2] i965/gs: Add new primitive types.

2013-09-14 Thread Paul Berry
As part of its support for geometry shaders, GL 3.2 introduces four new primitive types: GL_LINES_ADJACENCY, GL_LINE_STRIP_ADJACENCY, GL_TRIANGLES_ADJACENCY, and GL_TRIANGLE_STRIP_ADJACENCY. --- src/mesa/drivers/dri/i965/brw_context.h | 2 +- src/mesa/drivers/dri/i965/brw_draw.c| 8 ++-- 2

[Mesa-dev] [PATCH 4/4] i965/gs: Fixup gl_PointSize on entry to geometry shaders.

2013-09-14 Thread Paul Berry
gl_PointSize is stored in the w component of VARYING_SLOT_PSIZ, but the geometry shader infrastructure assumes that it should look for all geometry shader inputs of type float in the x component. So when compiling a geomtery shader that uses a gl_PointSize input, fix it up during the shader prolog

[Mesa-dev] [PATCH 3/4] glsl/gs: handle gl_ClipDistance geometry input in lower_clip_distance.

2013-09-14 Thread Paul Berry
interface block (gl_in[vertex].gl_ClipDistance[clip_plane]). v2 (Paul Berry ): Fix indexing order for gl_ClipDistance input lowering. Properly lower bulk assignment of gl_ClipDistance inputs. Rework for GLSL 1.50 style geometry shaders. --- src/glsl/lower_clip_distance.cpp | 223

[Mesa-dev] [PATCH 2/4] glsl/gs: add gl_in support to builtin_variables.cpp.

2013-09-14 Thread Paul Berry
Previously, builtin_variables.cpp was written assuming that we supported ARB_geometry_shader4 style geometry shader inputs, meaning that each built-in varying input to a geometry was supplied via an array variable whose name ended in "In", e.g. gl_PositionIn or gl_PointSizeIn. However, in GLSL 1.5

[Mesa-dev] [PATCH 1/4] glsl: Keep track of location for interface block fields.

2013-09-14 Thread Paul Berry
This patch adds a "location" element to struct glsl_struct_field, so that we can keep track of the gl_varying_slot associated with each built-in geometry shader input. In lower_named_interface_blocks, we use this value to populate the "location" field in the ir_variable that stores each geometry s

[Mesa-dev] [PATCH] i965/gs: Implement basic gl_PrimitiveIDIn functionality.

2013-09-14 Thread Paul Berry
If the geometry shader refers to the built-in variable gl_PrimitiveIDIn, we need to set a bit in 3DSTATE_GS to tell the hardware to dispatch primitive ID to r1, and we need to leave room for it when allocating registers. Note: this feature doesn't yet work properly when software primitive restart

[Mesa-dev] [PATCH] i965: Add some missing bits to {mesa, brw, cache}_bits[].

2013-09-14 Thread Paul Berry
These data structures are used for debug output, so it wasn't hurting anything that there were missing bits. But it's good to keep things up to date. This patch also adds static asserts so that the {brw,cache}_bits[] arrays are the proper size, so that we don't forget to add to them in the future

Re: [Mesa-dev] [PATCH] i965/hsw: compute DDX in a subspan based only on top row

2013-09-13 Thread Paul Berry
On 12 September 2013 22:06, Chia-I Wu wrote: > From: Chia-I Wu > > Consider only the top-left and top-right pixels to approximate DDX in a 2x2 > subspan, unless the application or the user requests a more accurate > approximation. This results in a less accurate approximation. However, it > im

Re: [Mesa-dev] [PATCH 11/17] mesa: Get GL_MAX_VARYING_FLOATS_ARB from VertexProgram.MaxOutputComponents

2013-09-13 Thread Paul Berry
On 11 September 2013 16:28, Ian Romanick wrote: > On 09/11/2013 04:05 PM, Paul Berry wrote: > > On 10 September 2013 12:10, Ian Romanick > <mailto:i...@freedesktop.org>> wrote: > > > > From: Ian Romanick > <mailto:ian.d.roman...@intel.com>

[Mesa-dev] [PATCH] glsl/builtins: Fix {texture1D, texture2D, shadow1D}ArrayLod availibility.

2013-09-12 Thread Paul Berry
These functions are defined in EXT_texture_array, which makes no mention of what shader types they should be allowed in. At the time EXT_texture_array was introduced, functions ending in "Lod" were available only in vertex shaders, however this restriction was lifted in later spec versions and ext

Re: [Mesa-dev] [PATCH 09/17] mesa: Expose MAX_GEOMETRY_{INPUT, OUTPUT}_COMPONENTS on OpenGL 3.2

2013-09-11 Thread Paul Berry
On 10 September 2013 12:10, Ian Romanick wrote: > From: Ian Romanick > > Signed-off-by: Ian Romanick > Cc: Paul Berry > --- > src/mesa/main/get_hash_params.py | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/src/mesa/main/get_hash_

Re: [Mesa-dev] [PATCH 11/17] mesa: Get GL_MAX_VARYING_FLOATS_ARB from VertexProgram.MaxOutputComponents

2013-09-11 Thread Paul Berry
On 10 September 2013 12:10, Ian Romanick wrote: > From: Ian Romanick > > Signed-off-by: Ian Romanick > --- > src/mesa/main/get.c | 4 > src/mesa/main/get_hash_params.py | 2 +- > 2 files changed, 1 insertion(+), 5 deletions(-) > > diff --git a/src/mesa/main/get.c b/src/mesa/m

Re: [Mesa-dev] [PATCH 17/17] glsl: Remove glsl_parser_state MaxVaryingFloats field

2013-09-11 Thread Paul Berry
signed MaxTextureImageUnits; > -- > 1.8.1.4 I sent comments on patches 3, 9, and 11. With Brian Paul's suggested fix to patch 16, the remainder are: Reviewed-by: Paul Berry ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH 03/17] mesa: Use correct data for MAX_{VERTEX, GEOMETRY}_VARYING_COMPONENTS_ARB queries

2013-09-11 Thread Paul Berry
27;s the case both before and after this patch (and it looks like you fix it in patch 5), but you might want to make a mention of it in the commit message. Either way, the patch is: Reviewed-by: Paul Berry ___ mesa-dev mailing list mesa-dev@lists.free

Re: [Mesa-dev] [PATCH 5/5] glsl: Add frexp signatures and implementation.

2013-09-11 Thread Paul Berry
orary variable "bits" like this places unnecessary constraints on the register allocator, since it forces every instance of the variable to be assigned to the same register. There's a slight chance that by using three separate temporaries we could reduce register pressure.

Re: [Mesa-dev] [PATCH 9/9] i965/gs: implement EndPrimitive() functionality in the visitor.

2013-09-10 Thread Paul Berry
On 10 September 2013 12:44, Kenneth Graunke wrote: > On 09/09/2013 08:20 AM, Paul Berry wrote: > > +void > > +vec4_gs_visitor::emit_control_data_bits() > > +{ > > + assert(c->control_data_bits_per_vertex != 0); > > + > > + /* Since the URB_WRITE

Re: [Mesa-dev] [PATCH 7/9] i965/gs: Add opcodes needed for EndPrimitive().

2013-09-10 Thread Paul Berry
On 10 September 2013 21:23, Kenneth Graunke wrote: > On 09/10/2013 09:07 PM, Paul Berry wrote: > > Good point. I've added a comment that says: > > > > * Note: this relies on the source register having zeros in (a) bits > > 7:4 of > > * DWORD 0 and

Re: [Mesa-dev] [PATCH 7/9] i965/gs: Add opcodes needed for EndPrimitive().

2013-09-10 Thread Paul Berry
On 9 September 2013 23:39, Kenneth Graunke wrote: > On 09/09/2013 08:20 AM, Paul Berry wrote: > > +void > > +vec4_generator::generate_gs_set_channel_masks(struct brw_reg dst, > > + struct brw_reg src) > > +{ > > +

<    1   2   3   4   5   6   7   8   9   10   >