Re: [Mesa-dev] [PATCH 29/34] glsl: Export the compiler's GS layout qualifiers to the gl_shader.

2013-08-01 Thread Paul Berry
On 31 July 2013 17:42, Ian Romanick i...@freedesktop.org wrote: On 07/28/2013 11:03 PM, Paul Berry wrote: From: Eric Anholt e...@anholt.net Next step is to validate them at link time. v2 (Paul Berry stereotype...@gmail.com): Don't attempt to export the layout qualifiers in the event

Re: [Mesa-dev] [PATCH 32/34] glsl: Allow geometry shader input instance arrays to be unsized.

2013-08-01 Thread Paul Berry
On 31 July 2013 18:17, Ian Romanick i...@freedesktop.org wrote: On 07/28/2013 11:03 PM, Paul Berry wrote: --- src/glsl/ast.h | 24 src/glsl/ast_to_hir.cpp | 31 +-**- src/glsl/glsl_parser.yy | 11 --- 3 files

Re: [Mesa-dev] [PATCH 33/34] glsl: Implement rules for geometry shader input sizes.

2013-08-01 Thread Paul Berry
On 31 July 2013 18:05, Ian Romanick i...@freedesktop.org wrote: On 07/28/2013 11:03 PM, Paul Berry wrote: Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec contains some tricky rules for how the sizes of geometry shader input arrays are related to the input layout specification

Re: [Mesa-dev] [PATCH 5/8] glsl: Extract marking functions from ir_set_program_inouts.

2013-08-01 Thread Paul Berry
On 31 July 2013 18:16, Ian Romanick i...@freedesktop.org wrote: On 07/31/2013 02:17 PM, Paul Berry wrote: This patch extracts the functions mark_whole_variable() and try_mark_partial_variable() from the ir_set_program_inouts visitor functions. This will make the code easier to follow when

Re: [Mesa-dev] [PATCH 29/34] glsl: Export the compiler's GS layout qualifiers to the gl_shader.

2013-08-01 Thread Paul Berry
On 1 August 2013 09:34, Ian Romanick i...@freedesktop.org wrote: On 08/01/2013 07:17 AM, Paul Berry wrote: On 31 July 2013 17:42, Ian Romanick i...@freedesktop.org mailto:i...@freedesktop.org wrote: On 07/28/2013 11:03 PM, Paul Berry wrote: From: Eric Anholt e...@anholt.net

Re: [Mesa-dev] [PATCH 8/8] glsl: Modify ir_set_program_inouts to handle geometry shaders.

2013-08-01 Thread Paul Berry
On 1 August 2013 16:03, Ian Romanick i...@freedesktop.org wrote: A couple of comments below. Other than that, Reviewed-by: Ian Romanick ian.d.roman...@intel.com On 07/31/2013 02:18 PM, Paul Berry wrote: --- src/glsl/ir_set_program_**inouts.cpp | 85

Re: [Mesa-dev] [PATCH V5 2/6] i965: Add helper functions for interpolation map

2013-07-31 Thread Paul Berry
/show_bug.cgi?id=54805 for example). With that fixed, this patch is: Reviewed-by: Paul Berry stereotype...@gmail.com struct brw_sf_prog_data { GLuint urb_read_length; -- 1.8.3.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http

Re: [Mesa-dev] [PATCH V5 3/6] i965 Gen4/5: Generalize SF interpolation setup for GLSL1.3

2013-07-31 Thread Paul Berry
is that it's a hash key, so compact representation is important. That's not an issue for brw_sf_compile. Wth that fixed, this patch is: Reviewed-by: Paul Berry stereotype...@gmail.com }; diff --git a/src/mesa/drivers/dri/i965/brw_sf_emit.c b/src/mesa/drivers/dri/i965/brw_sf_emit.c index bd68f68

Re: [Mesa-dev] [PATCH V5 4/6] i965 Gen4/5: clip: correctly handle flat varyings

2013-07-31 Thread Paul Berry
; struct brw_vue_map vue_map; + + GLuint has_flat_shading:1; As with the last patch, I'd recommend making this a bool. With that fixed, this patch is: Reviewed-by: Paul Berry stereotype...@gmail.com }; /** @@ -173,8 +174,8 @@ void brw_clip_kill_thread(struct brw_clip_compile *c

Re: [Mesa-dev] [PATCH 11/34] glsl: support compilation of geometry shaders

2013-07-31 Thread Paul Berry
On 30 July 2013 15:16, Kenneth Graunke kenn...@whitecape.org wrote: On 07/28/2013 11:03 PM, Paul Berry wrote: @@ -112,14 +111,24 @@ ir_set_program_inouts_visitor::visit(ir_dereference_variable *ir) return visit_continue; if (ir-type-is_array()) { - mark(this-prog, ir-var

[Mesa-dev] [PATCH 1/8] glsl: Change do_set_program_inouts' is_fragment_shader arg to shader_type.

2013-07-31 Thread Paul Berry
This will allow us to add geometry shader support without having to add another boolean argument. --- src/glsl/ir.h | 2 +- src/glsl/ir_set_program_inouts.cpp | 24 src/mesa/drivers/dri/i965/brw_shader.cpp | 3 +--

[Mesa-dev] [PATCH 2/8] Move count_attribute_slots() out of the linker and into glsl_type.

2013-07-31 Thread Paul Berry
Our previous justification for leaving this function out of glsl_type was that it implemented counting rules that were specific to GLSL 1.50. However, these counting rules also describe the number of varying slots that Mesa will assign to a varying in the absence of varying packing. That's

[Mesa-dev] [PATCH 4/8] glsl: Use count_attribute_slots() in ir_set_program_inouts.

2013-07-31 Thread Paul Berry
--- src/glsl/ir_set_program_inouts.cpp | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/glsl/ir_set_program_inouts.cpp b/src/glsl/ir_set_program_inouts.cpp index ef95cbe..351f65b 100644 --- a/src/glsl/ir_set_program_inouts.cpp +++

[Mesa-dev] [PATCH 3/8] glsl: Expand count_attribute_slots() to cover structs.

2013-07-31 Thread Paul Berry
--- src/glsl/glsl_types.cpp | 37 - 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp index 0c639b3..0c7e8eb 100644 --- a/src/glsl/glsl_types.cpp +++ b/src/glsl/glsl_types.cpp @@ -846,13 +846,40 @@

[Mesa-dev] [PATCH 5/8] glsl: Extract marking functions from ir_set_program_inouts.

2013-07-31 Thread Paul Berry
This patch extracts the functions mark_whole_variable() and try_mark_partial_variable() from the ir_set_program_inouts visitor functions. This will make the code easier to follow when we add geometry shader support. --- src/glsl/ir_set_program_inouts.cpp | 59

[Mesa-dev] [PATCH 7/8] glsl: In ir_set_program_inouts, handle indexing outside array/matrix bounds.

2013-07-31 Thread Paul Berry
According to GLSL, indexing into an array or matrix with an out-of-range constant results in a compile error. However, indexing with an out-of-range value that isn't constant merely results in undefined results. Since optimization passes (e.g. loop unrolling) can convert non-constant array

[Mesa-dev] [PATCH 8/8] glsl: Modify ir_set_program_inouts to handle geometry shaders.

2013-07-31 Thread Paul Berry
--- src/glsl/ir_set_program_inouts.cpp | 85 -- 1 file changed, 73 insertions(+), 12 deletions(-) diff --git a/src/glsl/ir_set_program_inouts.cpp b/src/glsl/ir_set_program_inouts.cpp index 018342b..8f96324 100644 --- a/src/glsl/ir_set_program_inouts.cpp +++

[Mesa-dev] [PATCH 6/8] glsl: Fallback gracefully if ir_set_program_inouts sees unexpected indexing.

2013-07-31 Thread Paul Berry
The code in ir_set_program_inouts that marks just a portion of a variable as used (rather than the whole variable) only works on a few kinds of indexing operations: - Indexing into matrices - Indexing into arrays of matrices, vectors, or scalars. Fortunately these are the only kinds of indexing

Re: [Mesa-dev] [PATCH 05/34] main: Allow for the possibility of GL 3.2 without ARB_geometry_shader4.

2013-07-31 Thread Paul Berry
On 31 July 2013 16:09, Ian Romanick i...@freedesktop.org wrote: On 07/30/2013 09:25 PM, Kenneth Graunke wrote: On 07/30/2013 07:30 PM, Paul Berry wrote: On 29 July 2013 11:17, Kenneth Graunke kenn...@whitecape.org mailto:kenn...@whitecape.org** wrote: On 07/28/2013 11:03 PM, Paul

Re: [Mesa-dev] [PATCH 11/34] glsl: support compilation of geometry shaders

2013-07-31 Thread Paul Berry
On 31 July 2013 20:41, Kenneth Graunke kenn...@whitecape.org wrote: On 07/31/2013 05:16 PM, Ian Romanick wrote: On 07/30/2013 03:16 PM, Kenneth Graunke wrote: This code is getting ugly. It looks like the idea is to allocate two (now three) separate arrays, but somebody decided to be clever

Re: [Mesa-dev] [PATCH 07/34] mesa: account for geometry shader texture fetches in update_texture_state

2013-07-31 Thread Paul Berry
On 31 July 2013 18:07, Ian Romanick i...@freedesktop.org wrote: Patches 7, 9 (with Ken's suggestions), 10, 12, 13, 14, 15 (with the one nit accounted... 18 and perhaps other have the same issue), 17, 18, 19, 20, 21, 22, 27, 28, 29 (though my question may affect 29 30), 30, 31, 32 (with minor

Re: [Mesa-dev] [PATCH V3 2/5] i965 Gen4/5: Generalize SF interpolation setup for GLSL1.3

2013-07-30 Thread Paul Berry
On 14 July 2013 02:39, Chris Forbes chr...@ijw.co.nz wrote: Previously the SF only handled the builtin color varying specially. This patch generalizes that support to cover user-defined varyings, driven by the interpolation mode array set up alongside the VUE map. Based on the following

Re: [Mesa-dev] [PATCH V3 2/5] i965 Gen4/5: Generalize SF interpolation setup for GLSL1.3

2013-07-30 Thread Paul Berry
On 30 July 2013 14:06, Chris Forbes chr...@ijw.co.nz wrote: On Wed, Jul 31, 2013 at 8:53 AM, Paul Berry stereotype...@gmail.com wrote: Can you point me to some VS code that does this? I thought that if the VS wrote only to gl_BackColor, then the VUE map would only contain a slot

Re: [Mesa-dev] [PATCH V3 2/5] i965 Gen4/5: Generalize SF interpolation setup for GLSL1.3

2013-07-30 Thread Paul Berry
On 30 July 2013 14:24, Chris Forbes chr...@ijw.co.nz wrote: It seems a shame to lose this optimization. Can we move the call to count_flatshaded_attributes() up to the declaration of nr, and then we can keep this? This function isn't even called if there is no flat-shading to do. Ok, I

Re: [Mesa-dev] [PATCH V3 3/5] i965 Gen4/5: clip: correctly handle flat varyings

2013-07-30 Thread Paul Berry
. In fact, since this is the same computation that patch 2/5 added to SF, we should probably move it to its own function to avoid code duplication. With that fixed, this patch is: Reviewed-by: Paul Berry stereotype...@gmail.com + key.pv_first = (ctx-Light.ProvokingVertex

Re: [Mesa-dev] [PATCH V3 4/5] i965 Gen4/5: clip: Add support for noperspective varyings

2013-07-30 Thread Paul Berry
)); + brw_set_access_mode(p, BRW_ALIGN_1); + + release_tmp(c, tmp); + release_tmp(c, v0_ndc_copy); + } I haven't had a chance to work through all the math above, but I trust that the piglit tests are adequate, so for this I'm just going to say Acked-by: Paul Berry stereotype

Re: [Mesa-dev] [PATCH V3 5/5] i965 Gen4/5: clip: Don't mangle flat varyings

2013-07-30 Thread Paul Berry
? With that fixed, this patch is: Reviewed-by: Paul Berry stereotype...@gmail.com @@ -269,28 +269,39 @@ void brw_clip_interp_vertex( struct brw_clip_compile *c, * header), so interpolate: * *New = attr0 + t*attr1 - t*attr0 + * + * Unless

Re: [Mesa-dev] [PATCH V4 1/5] i965 Gen4/5: Compute interpolation status for every varying in one place.

2013-07-30 Thread Paul Berry
number of bytes to copy. The disadvantage, of course, is that everywhere you use key.interpolation_mode[...] in the rest of the series you'll have to replace that with key.interpolation_mode.mode[...], which looks pretty silly :) Either way, this patch is: Reviewed-by: Paul Berry stereotype

Re: [Mesa-dev] [PATCH V3 0/5] Interpolation fixes for Gen4/5

2013-07-30 Thread Paul Berry
On 22 July 2013 23:04, Kenneth Graunke kenn...@whitecape.org wrote: On 07/14/2013 02:39 AM, Chris Forbes wrote: This series adds support for GLSL 1.30 / EXT_gpu_shader4's 'flat' and 'noperspective' varying interpolation qualifiers on Gen4/5. Based on Olivier Galibert's series from July

Re: [Mesa-dev] [PATCH 05/34] main: Allow for the possibility of GL 3.2 without ARB_geometry_shader4.

2013-07-30 Thread Paul Berry
On 29 July 2013 11:17, Kenneth Graunke kenn...@whitecape.org wrote: On 07/28/2013 11:03 PM, Paul Berry wrote: + + /** +* True if the implementation supports GLSL 1.50 style geometry shaders. +* This boolean is distinct from gl_extensions::ARB_geometry_**shader4 so

Re: [Mesa-dev] [PATCH 05/34] main: Allow for the possibility of GL 3.2 without ARB_geometry_shader4.

2013-07-30 Thread Paul Berry
On 29 July 2013 11:17, Kenneth Graunke kenn...@whitecape.org wrote: On 07/28/2013 11:03 PM, Paul Berry wrote: +/** + * Checks if the context supports geometry shaders. + */ +static inline GLboolean +_mesa_has_geometry_shaders(const struct gl_context *ctx) +{ + return

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

2013-07-30 Thread Paul Berry
On 29 July 2013 11:09, Zack Rusin za...@vmware.com wrote: That looks wrong to me. We already account for the other fields in the vertex_size. This patch came from Bryan Cain's original geometry shader patch series--I admit I'm not familiar enough with Gallium code to know how to fix it.

Re: [Mesa-dev] [PATCH 09/34] glsl: add ir_emitvertex and ir_endprim instruction types

2013-07-30 Thread Paul Berry
On 30 July 2013 11:08, Kenneth Graunke kenn...@whitecape.org wrote: On 07/28/2013 11:03 PM, Paul Berry wrote: From: Bryan Cain bryanca...@gmail.com These correspond to the EmitVertex and EndPrimitive functions in GLSL. v2 (Paul Berry stereotype...@gmail.com): Add stub implementations

Re: [Mesa-dev] [PATCH 10/34] glsl: add builtins for geometry shaders.

2013-07-30 Thread Paul Berry
On 30 July 2013 11:13, Kenneth Graunke kenn...@whitecape.org wrote: On 07/28/2013 11:03 PM, Paul Berry wrote: From: Bryan Cain bryanca...@gmail.com v2 (Paul Berry stereotype...@gmail.com): Account for rework of builtin_variables.cpp. Use INTERP_QUALIFIER_FLAT for gl_PrimitiveID so

Re: [Mesa-dev] [PATCH 20/34] mesa: Validate the drawing primitive against the geometry shader input primitive type.

2013-07-30 Thread Paul Berry
On 30 July 2013 15:41, Kenneth Graunke kenn...@whitecape.org wrote: On 07/28/2013 11:03 PM, Paul Berry wrote: From: Fabian Bieler fabianbie...@fastmail.fm Reviewed-by: Paul Berry stereotype...@gmail.com --- src/mesa/main/api_validate.c | 68

Re: [Mesa-dev] [PATCH 11/34] glsl: support compilation of geometry shaders

2013-07-30 Thread Paul Berry
On 30 July 2013 15:16, Kenneth Graunke kenn...@whitecape.org wrote: On 07/28/2013 11:03 PM, Paul Berry wrote: + /* The 'varying in' and 'varying out' qualifiers can only be used with + * ARB_geometry_shader4 and EXT_geometry_shader4, which we don't support + * yet

[Mesa-dev] [PATCH 00/34] Preliminary front-end support for geometry shaders.

2013-07-29 Thread Paul Berry
This patch series implements preliminary front-end support for geometry shaders in Mesa. It is based on work done by myself, Bryan Cain, Eric Anholt, and Fabian Bieler over the last several months. For the patches that aren't mine, I've preserved the original authorship information, and added

[Mesa-dev] [PATCH 22/34] main: Fix delete_shader_cb() for geometry shaders

2013-07-29 Thread Paul Berry
--- src/mesa/main/shared.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c index 5ef8809..2f73cf3 100644 --- a/src/mesa/main/shared.c +++ b/src/mesa/main/shared.c @@ -218,7 +218,8 @@ delete_shader_cb(GLuint id, void *data, void

[Mesa-dev] [PATCH 02/34] glsl: Add EXT_texture_array support for geometry shaders.

2013-07-29 Thread Paul Berry
--- src/glsl/builtins/profiles/EXT_texture_array.geom | 12 1 file changed, 12 insertions(+) create mode 100644 src/glsl/builtins/profiles/EXT_texture_array.geom diff --git a/src/glsl/builtins/profiles/EXT_texture_array.geom b/src/glsl/builtins/profiles/EXT_texture_array.geom new

[Mesa-dev] [PATCH 01/34] glsl/linker: Make update_array_sizes apply to just uniforms.

2013-07-29 Thread Paul Berry
Commit 586b4b5 (glsl: Also update implicit sizes of varyings at link time) extended update_array_sizes() to apply to both uniforms and shader ins/outs. However, doing creates problems for geometry shaders, because update_array_sizes() assumes that variables with matching names in different parts

[Mesa-dev] [PATCH 03/34] glsl: Enable various extensions for geometry shaders.

2013-07-29 Thread Paul Berry
Allow the following extensions in geometry shaders: - ARB_shader_texture_lod - ARB_shading_language_packing - ARB_texture_cube_map_array - ARB_texture_multisample - ARB_texture_rectangle - ARB_uniform_buffer_object - EXT_texture_array Note: In principle there's no reason geometry shaders couldn't

[Mesa-dev] [PATCH 04/34] main: Fix geometry shader error messages (missing right paren)

2013-07-29 Thread Paul Berry
--- src/mesa/main/shaderapi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 4cc0357..9c8af87 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -1629,7 +1629,7 @@

[Mesa-dev] [PATCH 07/34] mesa: account for geometry shader texture fetches in update_texture_state

2013-07-29 Thread Paul Berry
From: Bryan Cain bryanca...@gmail.com --- src/mesa/main/texstate.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 741985c..0f5d776 100644 --- a/src/mesa/main/texstate.c +++

[Mesa-dev] [PATCH 05/34] main: Allow for the possibility of GL 3.2 without ARB_geometry_shader4.

2013-07-29 Thread Paul Berry
Previously, we assumed that the only way Mesa would expose geometry shader support was via the ARB_geometry_shader4 extension. But this extension has some extra complications over GL 3.2 (interactions with compatibility-only features, and link-time initialization of the constant gl_VerticesIn).

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

2013-07-29 Thread Paul Berry
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/draw/draw_gs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[Mesa-dev] [PATCH 11/34] glsl: support compilation of geometry shaders

2013-07-29 Thread Paul Berry
From: Bryan Cain bryanca...@gmail.com This commit adds all of the parsing and semantics for GLSL 150 style geometry shaders. v2 (Paul Berry stereotype...@gmail.com): Adjust i965's brw_link_shader() to pass the new is_geometry_shader argument to do_set_program_inouts. Add a few missing calls

[Mesa-dev] [PATCH 12/34] mesa: Refactor copying of linked program data.

2013-07-29 Thread Paul Berry
This patch creates a single function to copy the the UsesClipDistance flag from gl_shader_program.Vert to gl_vertex_program. Previously this logic was duplicated in the i965-specific function brw_link_shader() and the core mesa function _mesa_ir_link_shader(). This logic will have to be expanded

[Mesa-dev] [PATCH 08/34] mesa/st: Add VARYING_SLOT_TEX[1-7] to st_translate_geometry_program().

2013-07-29 Thread Paul Berry
From: Bryan Cain bryanca...@gmail.com v2 (Paul Berry stereotype...@gmail.com: Split out to separate patch (previously this was part of glsl: add builtins for geometry shaders.) --- src/mesa/state_tracker/st_program.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src/mesa

[Mesa-dev] [PATCH 10/34] glsl: add builtins for geometry shaders.

2013-07-29 Thread Paul Berry
From: Bryan Cain bryanca...@gmail.com v2 (Paul Berry stereotype...@gmail.com): Account for rework of builtin_variables.cpp. Use INTERP_QUALIFIER_FLAT for gl_PrimitiveID so that it will obey provoking vertex conventions. Convert to GLSL 1.50 style geometry shaders. --- src/glsl

[Mesa-dev] [PATCH 09/34] glsl: add ir_emitvertex and ir_endprim instruction types

2013-07-29 Thread Paul Berry
From: Bryan Cain bryanca...@gmail.com These correspond to the EmitVertex and EndPrimitive functions in GLSL. v2 (Paul Berry stereotype...@gmail.com): Add stub implementations of new pure visitor functions to i965's vec4_visitor and fs_visitor classes. --- src/glsl/ir.h

[Mesa-dev] [PATCH 13/34] mesa: Copy linked program data for GS.

2013-07-29 Thread Paul Berry
The documentation for gl_shader_program.Geom and gl_geometry_program says that the former is copied to the latter at link time, but this wasn't happening. This patch causes _mesa_ir_link_shader() to perform the copy, and updates comment accordingly. --- src/mesa/main/mtypes.h| 5 -

[Mesa-dev] [PATCH 14/34] glsl: Require geometry shader inputs to be arrays.

2013-07-29 Thread Paul Berry
--- src/glsl/ast_to_hir.cpp | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index 431a13d..1d80e6b 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -2817,7 +2817,20 @@

[Mesa-dev] [PATCH 15/34] glsl/linker: Properly error check VS-GS linkage.

2013-07-29 Thread Paul Berry
From section 4.3.4 (Inputs) of the GLSL 1.50 spec: Geometry shader input variables get the per-vertex values written out by vertex shader output variables of the same names. Since a geometry shader operates on a set of vertices, each input varying variable (or input block, see

[Mesa-dev] [PATCH 17/34] glsl: Modify varying packing to use a temporary exec_list.

2013-07-29 Thread Paul Berry
This patch modifies lower_packed_varyings to store the packing code it generates in a temporary exec_list, and then splice that list into the shader's main() function when it's done. This paves the way for supporting geometry shader outputs, where we'll have to splice a clone of the packing code

[Mesa-dev] [PATCH 16/34] glsl/linker: Properly pack GS input varyings.

2013-07-29 Thread Paul Berry
Since geometry shader inputs are arrays (where the array index indicates which vertex is being examined), varying packing needs to treat them differently. --- src/glsl/ir_optimization.h | 2 +- src/glsl/link_varyings.cpp | 10 ++- src/glsl/link_varyings.h | 3 +-

[Mesa-dev] [PATCH 19/34] mesa/shaderapi: Allow 0 GEOMETRY_VERTICES_OUT.

2013-07-29 Thread Paul Berry
From: Fabian Bieler fabianbie...@fastmail.fm ARB_geometry_shader4 spec Errors: The error INVALID_VALUE is generated by ProgramParameteriARB if pname is GEOMETRY_VERTICES_OUT_ARB and value is negative. Reviewed-by: Paul Berry stereotype...@gmail.com --- src/mesa/main/shaderapi.c | 2 +- 1 file

[Mesa-dev] [PATCH 18/34] glsl: Properly pack GS output varyings

2013-07-29 Thread Paul Berry
In geometry shaders, outputs are consumed at the time of a call to EmitVertex() (as opposed to all other shader types, where outputs are consumed when the shader exits). Therefore, when packing geometry shader output varyings using lower_packed_varyings, we need to do the packing at the time of

[Mesa-dev] [PATCH 21/34] glsl/linker: Fail to link geometry shader without vertex shader.

2013-07-29 Thread Paul Berry
From: Fabian Bieler fabianbie...@fastmail.fm From section 2.15 (Geometry Shaders) the OpenGL 3.2 spec: A program object that includes a geometry shader must also include a vertex shader; otherwise a link error will occur. Reviewed-by: Paul Berry stereotype...@gmail.com --- src/glsl

[Mesa-dev] [PATCH 20/34] mesa: Validate the drawing primitive against the geometry shader input primitive type.

2013-07-29 Thread Paul Berry
From: Fabian Bieler fabianbie...@fastmail.fm Reviewed-by: Paul Berry stereotype...@gmail.com --- src/mesa/main/api_validate.c | 68 1 file changed, 68 insertions(+) diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index

[Mesa-dev] [PATCH 24/34] gallivm: Fix indirect input fetches for gs.

2013-07-29 Thread Paul Berry
From: Fabian Bieler fabianbie...@fastmail.fm --- src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c index c199385..1d27e81 100644 ---

[Mesa-dev] [PATCH 23/34] st/mesa, glsl_to_tgsi: add support for geometry shaders

2013-07-29 Thread Paul Berry
From: Bryan Cain bryanca...@gmail.com v2 (Bryan Cain bryanca...@gmail.com): fix 2D array indexing order. --- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 101 ++- src/mesa/state_tracker/st_program.c| 107 + 2 files changed, 163

[Mesa-dev] [PATCH 25/34] gallium/draw: Pass primitive ID as integer to the shader.

2013-07-29 Thread Paul Berry
From: Fabian Bieler fabianbie...@fastmail.fm The shader interprets the value as an integer. --- src/gallium/auxiliary/draw/draw_gs.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_gs.c

[Mesa-dev] [PATCH 26/34] mesa/st: Allow geometry shaders without gl_Position export.

2013-07-29 Thread Paul Berry
From: Fabian Bieler fabianbie...@fastmail.fm From the ARB_geometry_shader4 spec (section Geometry Shader outputs): The built-in special variable gl_Position is intended to hold the homogeneous vertex position. Writing gl_Position is optional. --- src/mesa/state_tracker/st_program.c | 2 -- 1

[Mesa-dev] [PATCH 28/34] glsl: Parse the GLSL 1.50 GS layout qualifiers.

2013-07-29 Thread Paul Berry
From: Eric Anholt e...@anholt.net Limited semantic checking (compatibility between declarations, checking that they're in the right shader target, etc.) is done. v2: Remove stray debug printfs. v3 (Paul Berry stereotype...@gmail.com): Process input layout qualifiers at ast_to_hir time rather

[Mesa-dev] [PATCH 27/34] glsl: Make sure that we don't put too many bitfields in ast_type_qualifier.

2013-07-29 Thread Paul Berry
From: Eric Anholt e...@anholt.net We do some tests of qualifiers using a union containing an int and the struct full of bitfields, so make sure the bitfields don't spill outside the int. --- src/glsl/ast_to_hir.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/glsl/ast_to_hir.cpp

[Mesa-dev] [PATCH 29/34] glsl: Export the compiler's GS layout qualifiers to the gl_shader.

2013-07-29 Thread Paul Berry
From: Eric Anholt e...@anholt.net Next step is to validate them at link time. v2 (Paul Berry stereotype...@gmail.com): Don't attempt to export the layout qualifiers in the event of a compile error, since some of them are set up by ast_to_hir(), and ast_to_hir() isn't guaranteed to have run

[Mesa-dev] [PATCH 30/34] glsl: Cross-validate GS layout qualifiers while intrastage linking.

2013-07-29 Thread Paul Berry
From: Eric Anholt e...@anholt.net This gets piglit's geometry-basic test running. TODO: Still need to validate that the GS layout qualifiers don't get used in places they shouldn't (like an interface block, or a particular shader input or output) --- src/glsl/linker.cpp | 96

[Mesa-dev] [PATCH 31/34] glsl: Permit non-ubo input interface arrays to use non-const indexing.

2013-07-29 Thread Paul Berry
From the GLSL ES 3.00 spec: All indexes used to index a uniform block array must be constant integral expressions. Similar text exists in GLSL specs since 1.50. When we implemented this, the only type of interface block supported by Mesa was uniform blocks, so we required all indexes

[Mesa-dev] [PATCH 33/34] glsl: Implement rules for geometry shader input sizes.

2013-07-29 Thread Paul Berry
Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec contains some tricky rules for how the sizes of geometry shader input arrays are related to the input layout specification. In essence, those rules boil down to the following: - If an input array declaration does not specify a size,

[Mesa-dev] [PATCH 32/34] glsl: Allow geometry shader input instance arrays to be unsized.

2013-07-29 Thread Paul Berry
--- src/glsl/ast.h | 24 src/glsl/ast_to_hir.cpp | 31 +-- src/glsl/glsl_parser.yy | 11 --- 3 files changed, 49 insertions(+), 17 deletions(-) diff --git a/src/glsl/ast.h b/src/glsl/ast.h index 3ef9913..a40bbc0 100644 ---

Re: [Mesa-dev] [PATCH v2 08/13] gen7 fbo: make unmatched depth/stencil configs return unsupported

2013-07-29 Thread Paul Berry
, depth, LOD and layer must match) Signed-off-by: Jordan Justen jordan.l.jus...@intel.com Cc: Paul Berry stereotype...@gmail.com Since this is the commit we're going to bisect back to if a client program ever runs into trouble for violating these restrictions, it would be nice to have a little bit

Re: [Mesa-dev] [PATCH v2 12/13] intel_mipmap_tree: all layers need hiz resolves with layered rendering

2013-07-29 Thread Paul Berry
On 19 July 2013 17:32, Jordan Justen jordan.l.jus...@intel.com wrote: In intel_miptree_slice_set_needs_(depth|hiz)_resolve, if layered rendering is being used, then we need to mark all layers as needing depth or hiz resolves. I think only intel_miptree_slice_set_needs_depth_resolve() needs

Re: [Mesa-dev] [PATCH v2 00/13] Enable GL_AMD_vertex_shader_layer extension

2013-07-29 Thread Paul Berry
reviewed-by Paul I sent comments on patches 8 and 12. Patch 11 is: Reviewed-by: Paul Berry stereotype...@gmail.com There are two other things that I think need to happen which haven't been addressed yet: - The HiZ allocation code needs to be changed to follow the formulas in Graphics BSpec: 3D

Re: [Mesa-dev] [PATCH] glsl: Remove shader stage checking for extension handling.

2013-07-29 Thread Paul Berry
/preprocessor/feature-macro-enabled.frag. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=29185 Signed-off-by: Kenneth Graunke kenn...@whitecape.org I like this. It would have saved me some pain when I was working on geometry shaders. Reviewed-by: Paul Berry stereotype...@gmail.com

[Mesa-dev] [PATCH 0/5] glsl: Clean up linker error checking.

2013-07-27 Thread Paul Berry
I recently discovered a bug in my geometry shader branch wherein we were responding to certain kinds of link errors by calling linker_error(), but the program was still linking successfully. The root cause turned out to be that during the first half of the execution of link_shaders(), it was not

[Mesa-dev] [PATCH 1/5] glsl: Remove bogus check on return value of link_uniform_blocks().

2013-07-27 Thread Paul Berry
A comment in link_intrastage_shaders(), and an if-test that followed it, seemed to indicate that link_uniform_blocks() would return a negative value in the event of an error. But this is not the case--all error checking has already been performed by validate_intrastage_interface_blocks(), and

[Mesa-dev] [PATCH 2/5] glsl: Add error message for intrastage interface block mismatch.

2013-07-27 Thread Paul Berry
Previously we failed to link (which is correct), but we did not output an error message, which could have been confusing for users. --- src/glsl/link_interface_blocks.cpp | 5 - src/glsl/linker.cpp| 3 ++- src/glsl/linker.h | 3 ++- 3 files changed, 8

[Mesa-dev] [PATCH 3/5] glsl: Use a consistent technique for tracking link success/failure.

2013-07-27 Thread Paul Berry
This patch changes link_shaders() so that it sets prog-LinkStatus to true when it starts, and then relies on linker_error() to set it to false if a link failure occurs. Previously, link_shaders() would set prog-LinkStatus to true halfway through its execution; as a result, linker functions that

[Mesa-dev] [PATCH 5/5] glsl: Remove redundant writes to prog-LinkStatus

2013-07-27 Thread Paul Berry
The linker_error() function sets prog-LinkStatus to false. There's no reason for the caller of linker_error() to also do so. --- src/glsl/ir_function_detect_recursion.cpp | 1 - src/mesa/program/ir_to_mesa.cpp | 1 - 2 files changed, 2 deletions(-) diff --git

[Mesa-dev] [PATCH 4/5] glsl: Improve error message for interstage interface block mismatch.

2013-07-27 Thread Paul Berry
We're now emitting this error from a point where we have easy access to the name of the block that failed to match, so go ahead and include that in the error message, as we do for intrastage interface block mismatches. --- src/glsl/link_interface_blocks.cpp | 3 ++- 1 file changed, 2

[Mesa-dev] [PATCH] i965: Only use brw_draw.c's trim() function when necessary.

2013-07-25 Thread Paul Berry
brw_draw.c contains a trim() function which modifies the vertex count for quads and quad strips in order to discard dangling vertices. In principle this shouldn't be necessary, since hardware since Gen4 is capable of discarding dangling vertices by itself. However, it's necessary because as a

[Mesa-dev] [PATCH] glsl: Be consistent about '\n', '.', and capitalization in errors/warnings.

2013-07-25 Thread Paul Berry
The majority of calls to _mesa_glsl_error(), _mesa_glsl_warning(), and _mesa_glsl_parse_state::check_version() use a message that begins with a lower case letter and ends without a period. This patch makes all messages follow that convention. Also, error/warning messages shouldn't end in '\n',

[Mesa-dev] [PATCH] i965: Initialize inout_offset parameter to brw_search_cache().

2013-07-24 Thread Paul Berry
Two callers of brw_search_cache() weren't initializing that function's inout_offset parameter: brw_blorp_const_color_params::get_wm_prog() and brw_blorp_const_color_params::get_wm_prog(). That's a benign problem, since the only effect of not initializing inout_offset prior to calling

Re: [Mesa-dev] Geometry shader update, and a course correction

2013-07-22 Thread Paul Berry
On 21 July 2013 23:14, Ian Romanick i...@freedesktop.org wrote: On 07/19/2013 11:48 AM, Paul Berry wrote: (TL;DR: geometry shaders are humming along, but because of a hitch I've run into, I'm going to change gears and implement GLSL 1.50-style geometry shaders first rather than

[Mesa-dev] Geometry shader update, and a course correction

2013-07-19 Thread Paul Berry
(TL;DR: geometry shaders are humming along, but because of a hitch I've run into, I'm going to change gears and implement GLSL 1.50-style geometry shaders first rather than ARB_geometry_shader4 functionality. This means some piglit tests will need to be rewritten). Hello all-- As some of you

Re: [Mesa-dev] [PATCH 03/11] glsl: Parse the binding keyword and store it in ast_type_qualifier.

2013-07-18 Thread Paul Berry
On 17 July 2013 18:24, Kenneth Graunke kenn...@whitecape.org wrote: Nothing actually uses this yet. Signed-off-by: Kenneth Graunke kenn...@whitecape.org --- src/glsl/ast.h | 14 ++ src/glsl/ast_type.cpp | 6 +- src/glsl/glsl_parser.yy | 12 3

Re: [Mesa-dev] [PATCH 05/11] glsl: Propagate explicit binding information from AST to IR.

2013-07-18 Thread Paul Berry
On 17 July 2013 18:24, Kenneth Graunke kenn...@whitecape.org wrote: Rather than creating a new binding field in ir_variable, we reuse constant_value since the linker code for handling uniform initializers uses that. I'm uncomfortable with this. It's already a bit irregular that we use

Re: [Mesa-dev] [PATCH 11/11] i965: Enable the GL_ARB_shading_language_420pack extension.

2013-07-18 Thread Paul Berry
-by, though. The remainder (patches 2, 4, 6, 9, and 11) look great, and are: Reviewed-by: Paul Berry stereotype...@gmail.com ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [RFC PATCH 02/12] gen7 depth surface: calculate more specific surface type

2013-07-17 Thread Paul Berry
that gl_Layer doesn't work when we do * this. So we use BRW_SURFACE_2D, since for rendering purposes this is * equivalent. */ surftype = BRW_SURFACE_2D; With that change, this patch is: Reviewed-by: Paul Berry stereotype...@gmail.com + break; + default

Re: [Mesa-dev] [RFC PATCH 06/12] gen7 depth surface: calculate minimum array element being rendered

2013-07-17 Thread Paul Berry
to convert to a logical layer. With the extra comments, this patch is: Reviewed-by: Paul Berry stereotype...@gmail.com + } else { + min_array_element = irb-mt_layer; + } + lod = irb ? irb-mt_level - irb-mt-first_level : 0; /* _NEW_DEPTH, _NEW_STENCIL, _NEW_BUFFERS

Re: [Mesa-dev] [RFC PATCH 11/12] i965 gen7: don't set FORCE_ZERO_RTAINDEX in clip state

2013-07-17 Thread Paul Berry
On 15 July 2013 17:14, Jordan Justen jordan.l.jus...@intel.com wrote: We now also need to stop setting the FORCE_ZERO_RTAINDEX bit in the clip date so render target array values other than zero Do you mean clip state? can be used. Signed-off-by: Jordan Justen jordan.l.jus...@intel.com

Re: [Mesa-dev] [PATCH v2 2/5] main: do nothing in the ff fragment shader when using the core profile.

2013-07-16 Thread Paul Berry
On 15 July 2013 15:50, Ian Romanick i...@freedesktop.org wrote: On 07/12/2013 06:25 PM, Paul Berry wrote: When the core profile is active, there is no fixed function fragment shader functionality. However, we still need to generate a dummy fragment shader program in case the back-end

Re: [Mesa-dev] [PATCH] st/mesa: expose EXT_framebuffer_multisample_blit_scaled if MSAA is supported

2013-07-16 Thread Paul Berry
On 16 July 2013 17:52, Grigori Goronzy g...@chown.ath.cx wrote: On 17.07.2013 02:05, Marek Olšák wrote: No, it's not faster, but it's not slower either. Now that I think about it, I can't come up with a good shader-based algorithm for the resolve operation. I don't think Christoph's

[Mesa-dev] [PATCH] glsl: Fix lower_named_interface_blocks to account for dereferences of consts.

2013-07-14 Thread Paul Berry
In certain rare cases (such as those involving dereference of a literal constant array of structs), flatten_named_interface_blocks_declarations's rvalue visitor may be invoked on an ir_dereference_record whose variable_referenced() method returns NULL. Check for this case to avoid a segfault.

Re: [Mesa-dev] [PATCH RFC 3/3] glsl: Rework builtin_variables.cpp to reduce code duplication.

2013-07-12 Thread Paul Berry
On 11 July 2013 12:06, Matt Turner matts...@gmail.com wrote: On Mon, Jul 8, 2013 at 10:40 AM, Paul Berry stereotype...@gmail.com wrote: + const glsl_type *typ(const char *name) This must not be a typo, since it's consistent. Heh, type is a reserved word in so many languages that I guess

[Mesa-dev] [PATCH v2 1/5] glsl: Rework builtin_variables.cpp to reduce code duplication.

2013-07-12 Thread Paul Berry
Previously, we had a separate function for setting up the built-in variables for each combination of shader stage and GLSL version (e.g. generate_110_vs_variables to generate the built-in variables for GLSL 1.10 vertex shaders). The functions called each other in ad-hoc ways, leading to

[Mesa-dev] [PATCH v2 2/5] main: do nothing in the ff fragment shader when using the core profile.

2013-07-12 Thread Paul Berry
When the core profile is active, there is no fixed function fragment shader functionality. However, we still need to generate a dummy fragment shader program in case the back-end expects it (e.g. to cover the case where GL_RASTERIZER_DISCARD is active and the client hasn't supplied a fragment

[Mesa-dev] [PATCH v2 3/5] glsl: Add const safety to _mesa_glsl_parse_state::is_version()

2013-07-12 Thread Paul Berry
Needed for the patch that follows. --- src/glsl/glsl_parser_extras.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h index 7f478df..ad8b063 100644 --- a/src/glsl/glsl_parser_extras.h +++

[Mesa-dev] [PATCH v2 4/5] glsl: Stop exposing compatibility-only builtin vars in the core profile.

2013-07-12 Thread Paul Berry
GL 3.2 and GLSL 1.50 specify that several builtin variables (e.g. gl_FrontColor) are available only in the compatibility profile. GL 3.1 and GLSL 1.40 make a similar stipulation (except phrased in terms of ARB_compatibility). Previous versions of GLSL make no such stipulation. However, since GL

[Mesa-dev] [PATCH v2 5/5] glsl/builtins: Stop exposing ftransform in the core profile.

2013-07-12 Thread Paul Berry
GL 3.2 and GLSL 1.50 specify that the ftransform() function is available only in the compatibility profile. GL 3.1 and GLSL 1.40 make a similar stipulation (except phrased in terms of ARB_compatibility). Previous versions of GLSL make no such stipulation. However, since GL versions 3.1 and

<    4   5   6   7   8   9   10   11   12   13   >