Re: [Mesa-dev] [PATCH] i965/vs: Fix DEBUG_SHADER_TIME when VS terminates with 2 URB writes.

2013-04-07 Thread Jordan Justen
On Sun, Apr 7, 2013 at 6:42 AM, Paul Berry wrote: > The call to emit_shader_time_end() before the second URB write was > conditioned with "if (eot)", but eot is always false in this code > path, so emit_shader_time_end() was never being called for vertex > shaders that performed 2 URB writes. > --

[Mesa-dev] [PATCH 17/17] i965/vs: Don't hardcode DEBUG_VS in generic vec4 code.

2013-04-07 Thread Paul Berry
Since the vec4_visitor and vec4_generator classes are going to be re-used for geometry shaders, we can't enable their debug functionality based on (INTEL_DEBUG & DEBUG_VS) anymore. Instead, add a debug_flag boolean to these two classes, so that when they're instantiated the caller can specify whet

[Mesa-dev] [PATCH 16/17] i965/vs: Generalize computation of array strides in preparation for GS.

2013-04-07 Thread Paul Berry
Geometry shader inputs are arrays, but they use an unusual array layout: instead of all array elements for a given geometry shader input being stored consecutively, all geometry shader inputs are interleaved into one giant array. As a result, the array stride we use to access geometry shader input

[Mesa-dev] [PATCH 15/17] i965/vs: Generalize attribute setup code in preparation for GS.

2013-04-07 Thread Paul Berry
This patch introduces a new function, vec4_visitor::lower_attributes_to_hw_regs(), which replaces registers of type ATTR in the instruction stream with the hardware registers that store those attributes. This logic will need to be common between the vertex and geometry shaders. --- src/mesa/drive

[Mesa-dev] [PATCH 14/17] i965/vs: Generalize vertex emission code in preparation for GS.

2013-04-07 Thread Paul Berry
This patch introduces a new function, vec4_visitor::emit_vertex(), which contains the code for emitting vertices that will need to be common between the vertex and geometry shaders. Geometry shaders will need to use a different message header, and a different opcode, for their URB writes, so we in

[Mesa-dev] [PATCH 13/17] i965/vs: rename vec4_generator::generate_vs_instruction.

2013-04-07 Thread Paul Berry
Since this function is going to get used for geometry shaders too, it deserves a more generic name: generate_vec4_instruction. --- src/mesa/drivers/dri/i965/brw_vec4.h| 6 +++--- src/mesa/drivers/dri/i965/brw_vec4_emit.cpp | 8 2 files changed, 7 insertions(+), 7 deletions(-) dif

[Mesa-dev] [PATCH 12/17] i965/vs: Generalize data structures pointed to by vec4_generator.

2013-04-07 Thread Paul Berry
This patch removes the following field from vec4_generator, since it is not used: - struct brw_vs_compile *c And changes the following field: - struct gl_vertex_program *vp => struct gl_program *glprog With these changes, vec4_generator no longer refers to any VS-specific data structures. This

[Mesa-dev] [PATCH 11/17] i965/vs: move VS-specific data members to vs_vec4_visitor.

2013-04-07 Thread Paul Berry
This patch moves the following data structures from vec4_visitor to vec4_vs_visitor, since they contain VS-specific data: - struct brw_vs_compile *c - struct brw_vs_prog_data *prog_data - src_reg *vp_temp_regs - src_reg vp_addr_reg Since brw_vs_compile and brw_vs_prog_data also contain vec4-gener

[Mesa-dev] [PATCH 09/17] i965/vs: Add virtual function make_reg_for_system_value().

2013-04-07 Thread Paul Berry
The system values handled by vec4_visitor::visit(ir_variable *) are VS-specific (vertex ID and instance ID). This patch moves the handling of those values into a new virtual function, make_reg_for_system_value(), so that this VS-specific code won't be inherited by geomtry shaders. --- src/mesa/dr

[Mesa-dev] [PATCH 10/17] i965/vs: move ARB_vertex_program functions to vec4_vs_visitor.

2013-04-07 Thread Paul Berry
This patch moves functions from vec4_visitor to vec4_vs_visitor that deal with ARB (assembly) vertex programs. There's no point in having these functions in the base class since we don't intend to support assembly programs for the GS stage. The following functions are moved: - setup_vp_regs - ge

[Mesa-dev] [PATCH 08/17] i965/vs: Make some vec4_visitor functions virtual.

2013-04-07 Thread Paul Berry
This patch makes the following vec4_visitor functions virtual, since they will need to be implemented differently for vertex and geometry shaders. Some of the functions are renamed to reflect their generic purpose, rather than their VS-specific behaviour: - setup_attributes - emit_attribute_fixup

[Mesa-dev] [PATCH 07/17] i965/vs: Make vec4_vs_visitor class derived from vec4_visitor.

2013-04-07 Thread Paul Berry
This patch just creates the derived class; later patches will migrate VS-specific functions and data structures from the base class into the derived class. --- src/mesa/drivers/dri/i965/brw_vec4.cpp| 2 +- src/mesa/drivers/dri/i965/brw_vec4.h | 11

[Mesa-dev] [PATCH 06/17] i965/vs: split brw_vs_prog_data into generic and VS-specific parts.

2013-04-07 Thread Paul Berry
This will allow the generic parts to be re-used for geometry shaders. --- src/mesa/drivers/dri/i965/brw_context.h| 30 ++ src/mesa/drivers/dri/i965/brw_curbe.c | 6 +- src/mesa/drivers/dri/i965/brw_gs.c | 4 +- src/mesa/drivers/dri/i965/brw_vec4.c

[Mesa-dev] [PATCH 05/17] i965/vs: split brw_vs_prog_key into generic and VS-specific parts.

2013-04-07 Thread Paul Berry
This will allow the generic parts to be re-used for geometry shaders. --- src/mesa/drivers/dri/i965/brw_vec4.cpp | 2 +- src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 16 - src/mesa/drivers/dri/i965/brw_vs.c | 47 +- src/mesa/drivers/dri/i965

[Mesa-dev] [PATCH 04/17] i965/vs: split brw_vs_compile into generic and VS-specific parts.

2013-04-07 Thread Paul Berry
This will allow the generic parts to be re-used for geometry shaders. --- src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp | 2 +- src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 8 src/mesa/drivers/dri/i965/brw_vs.c | 4 ++-- src/mesa/drivers/dri/i965/brw_vs.h

[Mesa-dev] [PATCH 03/17] i965/vs: Remove brw_vs_prog_data pointer from brw_vs_compile.

2013-04-07 Thread Paul Berry
In patches that follow, we'll be splitting structs brw_vs_prog_data and brw_vs_compile into a vec4-generic base struct and a VS-specific derived struct (this will allow the vec4-generic code to be re-used for geometry shaders). Having brw_vs_compile point to brw_vs_prog_data makes it difficult to

[Mesa-dev] [PATCH 02/17] i965: Generalize computation of VUE map in preparation for GS.

2013-04-07 Thread Paul Berry
This patch modifies the arguments to brw_compute_vue_map() so that they no longer bake in the assumption that we are generating a VUE map for vertex shader outputs. It also makes the function non-static so that we can re-use it for geometry shader outputs. --- src/mesa/drivers/dri/i965/brw_contex

[Mesa-dev] [PATCH 01/17] i965/vs: Make type of vec4_visitor::vp more generic.

2013-04-07 Thread Paul Berry
The vec4_visitor functions don't use any VS specific data from vec4_visitor::vp. So rename it to just "p" and change its type from struct gl_vertex_program * to struct gl_program *. This will allow the code to be re-used for geometry shaders. --- src/mesa/drivers/dri/i965/brw_vec4.cpp |

[Mesa-dev] [PATCH 00/17] i965/vs: Generalize VS compiler back-end in preparation for GS.

2013-04-07 Thread Paul Berry
This patch series lays the groundwork for the i965 geometry shader back-end by separating the functions and data structures which are specific to vertex shaders from those that can also be used to compile geometry shaders. (Following a naming convention that is already present in the codebase, thi

Re: [Mesa-dev] [PATCH 1/3] glsl/linker: fix varying packing for non-flat integer varyings.

2013-04-07 Thread Paul Berry
On 7 April 2013 12:01, Jordan Justen wrote: > On Sun, Apr 7, 2013 at 11:42 AM, Paul Berry > wrote: > > On 7 April 2013 11:12, Jordan Justen wrote: > >> > >> On Sat, Apr 6, 2013 at 7:49 PM, Paul Berry > >> wrote: > >> > + if (consumer_var == NULL) { > >> > + /* Since there is no consumer

Re: [Mesa-dev] [PATCH] R600: Control Flow support for pre EG gen

2013-04-07 Thread Tom Stellard
On Sun, Apr 07, 2013 at 09:43:43PM +0200, Vincent Lejeune wrote: Reviewed-by: Tom Stellard > --- > lib/Target/R600/MCTargetDesc/R600MCCodeEmitter.cpp | 30 ++-- > lib/Target/R600/R600ControlFlowFinalizer.cpp | 84 +++-- > lib/Target/R600/R600Instructions.td| 198 > +

Re: [Mesa-dev] [PATCH] r600g/llvm: Add support for native isa for pre EG

2013-04-07 Thread Tom Stellard
On Sun, Apr 07, 2013 at 09:45:35PM +0200, Vincent Lejeune wrote: > This fixes bug 62756 : > https://bugs.freedesktop.org/show_bug.cgi?id=62756#c12 > > (Requires corresponding llvm commit) Reviewed-by: Tom Stellard > --- > src/gallium/drivers/r600/r600_asm.c | 6 +- > 1 file changed, 5 inse

[Mesa-dev] [PATCH] r600g/llvm: Add support for native isa for pre EG

2013-04-07 Thread Vincent Lejeune
This fixes bug 62756 : https://bugs.freedesktop.org/show_bug.cgi?id=62756#c12 (Requires corresponding llvm commit) --- src/gallium/drivers/r600/r600_asm.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_

[Mesa-dev] [PATCH] R600: Control Flow support for pre EG gen

2013-04-07 Thread Vincent Lejeune
--- lib/Target/R600/MCTargetDesc/R600MCCodeEmitter.cpp | 30 ++-- lib/Target/R600/R600ControlFlowFinalizer.cpp | 84 +++-- lib/Target/R600/R600Instructions.td| 198 +++-- 3 files changed, 240 insertions(+), 72 deletions(-) diff --git a/lib/Target/R600/M

Re: [Mesa-dev] [PATCH 1/3] glsl/linker: fix varying packing for non-flat integer varyings.

2013-04-07 Thread Jordan Justen
On Sun, Apr 7, 2013 at 11:42 AM, Paul Berry wrote: > On 7 April 2013 11:12, Jordan Justen wrote: >> >> On Sat, Apr 6, 2013 at 7:49 PM, Paul Berry >> wrote: >> > + if (consumer_var == NULL) { >> > + /* Since there is no consumer_var, the interpolation type of this >> > + * varying ca

Re: [Mesa-dev] [PATCH 1/3] glsl/linker: fix varying packing for non-flat integer varyings.

2013-04-07 Thread Paul Berry
On 7 April 2013 11:12, Jordan Justen wrote: > On Sat, Apr 6, 2013 at 7:49 PM, Paul Berry > wrote: > > + if (consumer_var == NULL) { > > + /* Since there is no consumer_var, the interpolation type of this > > + * varying cannot possibly affect rendering. Also, since the GL > spec >

Re: [Mesa-dev] [PATCH 1/3] glsl/linker: fix varying packing for non-flat integer varyings.

2013-04-07 Thread Jordan Justen
On Sat, Apr 6, 2013 at 7:49 PM, Paul Berry wrote: > + if (consumer_var == NULL) { > + /* Since there is no consumer_var, the interpolation type of this > + * varying cannot possibly affect rendering. Also, since the GL spec > + * only requires integer varyings to be "flat" when

Re: [Mesa-dev] [PATCH] r600g: Fix UMAD on Cayman

2013-04-07 Thread Martin Andersson
If there are no objections or comments on this, it would be nice if someone could commit it. //Martin On Tue, Apr 2, 2013 at 10:43 PM, Martin Andersson wrote: > The multiplication part of tgsi_umad did not work on Cayman, because it did > not populate the correct vector slots. > --- > src/galli

[Mesa-dev] [PATCH] i965/vs: Fix DEBUG_SHADER_TIME when VS terminates with 2 URB writes.

2013-04-07 Thread Paul Berry
The call to emit_shader_time_end() before the second URB write was conditioned with "if (eot)", but eot is always false in this code path, so emit_shader_time_end() was never being called for vertex shaders that performed 2 URB writes. --- src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 6 ++

Re: [Mesa-dev] [PATCH] glsl: Fix ir_print_visitor's handling of interpolation qualifiers.

2013-04-07 Thread Kenneth Graunke
On 04/06/2013 07:20 PM, Paul Berry wrote: This patch updates the interp[] array to match the enum glsl_interp_qualifier. --- src/glsl/ir_print_visitor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glsl/ir_print_visitor.cpp b/src/glsl/ir_print_visitor.cpp index 597