Re: [Mesa-dev] [PATCH 14/33] i965/gen4: Fold WM surface state prepare()/emit() together.

2011-10-26 Thread Paul Berry
On 24 October 2011 14:17, Eric Anholt e...@anholt.net wrote: These produce BRW_NEW_SURFACES (used by binding table emit()) and BRW_NEW_NR_WM_SURFACES (used by WM unit emit()). Fixes a bug where with no texturing and no color buffer, we wouldn't consider the null renderbuffer in nr_surfaces.

Re: [Mesa-dev] [PATCH 14/33] i965/gen4: Fold WM surface state prepare()/emit() together.

2011-10-26 Thread Paul Berry
On 26 October 2011 11:45, Eric Anholt e...@anholt.net wrote: On Wed, 26 Oct 2011 10:11:15 -0700, Paul Berry stereotype...@gmail.com wrote: Non-text part: multipart/alternative On 24 October 2011 14:17, Eric Anholt e...@anholt.net wrote: These produce BRW_NEW_SURFACES (used by binding

Re: [Mesa-dev] [PATCH v2 8/8] i965/gen6+: Add support for noperspective interpolation.

2011-10-26 Thread Paul Berry
On 26 October 2011 12:17, Eric Anholt e...@anholt.net wrote: On Tue, 25 Oct 2011 20:38:26 -0700, Paul Berry stereotype...@gmail.com wrote: This required the following changes: - WM setup now makes the appropriate set of barycentric coordinates (perspective vs. noperspective) available

[Mesa-dev] [PATCH 1/5] glsl: Fix copy-paste error in constant_expression_value(ir_binop_nequal)

2011-10-26 Thread Paul Berry
The implementation of ir_binop_nequal in constant_expression_value() appears to have been copy-and-pasted from the implementation of ir_binop_equal, but with all instances of '==' changed to '!='. This is correct except for one minor flaw: one of those '==' operators was in an assertion checking

[Mesa-dev] [PATCH 2/5] glsl: Extend s-expression parsing to handle infinity.

2011-10-26 Thread Paul Berry
In order to implement the GLSL 1.30 isinf() function, it will be necessary to be able to represent infinity in the GLSL IR s-expression format. This patch extends the s-expression parser so that it treats the string #inf as a floating point value representing positive infinity. ---

[Mesa-dev] [PATCH 4/5] glsl: Add isinf() and isnan() builtins.

2011-10-26 Thread Paul Berry
The implementations are as follows: isinf(x) = (abs(x) == +infinity) isnan(x) = (x != x) Note: the latter formula is not necessarily obvious. It works because NaN is the only floating point number that does not equal itself. Fixes piglit tests isinf-and-isnan fs_basic and isinf-and-isnan

[Mesa-dev] [PATCH 5/5] i965/gen6+: Switch GLSL from ALT to IEEE floating point mode

2011-10-26 Thread Paul Berry
i965 graphics hardware has two floating point modes: ALT and IEEE. In ALT mode, floating-point operations never generate infinities or NaNs, and MOV instructions translate infinities and NaNs to finite values. In IEEE mode, infinities and NaNs behave as specified in the IEEE 754 spec.

[Mesa-dev] [PATCH 3/5] glsl: Add '.ir' extension to builtin IR files

2011-10-26 Thread Paul Berry
This patch adds the extension '.ir' to all the files in src/glsl/builtins/ir/, and changes generate_builtins.py so that it no longer globs on '*' to find the files to build. This prevents spurious files (such as EMACS' infamous *~ backup files) from breaking the build. ---

Re: [Mesa-dev] [PATCH 17/33] i965: Fold prepare() and emit() of VS surface state setup together.

2011-10-27 Thread Paul Berry
On 24 October 2011 14:17, Eric Anholt e...@anholt.net wrote: This rearranges the code a bit, and makes the upload of the binding table take only as many surfaces as there are in use. --- src/mesa/drivers/dri/i965/brw_vs_surface_state.c | 62 +- 1 files changed, 25

Re: [Mesa-dev] i965 batch rollback: no more prepare() vs emit().

2011-10-27 Thread Paul Berry
@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev I don't understand enough of the code to give a reviewed-by, but I've read through all of it, and other than the comments I've already made, nothing jumped out at me as a problem. Acked-by: Paul Berry stereotype...@gmail.com

Re: [Mesa-dev] [PATCH] glsl: Implement GLSL 1.30's literal integer range restrictions.

2011-10-27 Thread Paul Berry
]? { -- 1.7.7 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev Reviewed-by: Paul Berry stereotype...@gmail.com ___ mesa-dev mailing list mesa

Re: [Mesa-dev] mis-counting varying vars in the linker

2011-10-28 Thread Paul Berry
On 27 October 2011 10:20, Ian Romanick i...@freedesktop.org wrote: On 10/26/2011 11:11 AM, Brian Paul wrote: I think the linker is mis-counting gl_TexCoord[] varying vars when linking. For example, if we have this vertex/fragment shader combination: // vs void main() { gl_Position =

Re: [Mesa-dev] [PATCH 2/5] glsl: Extend s-expression parsing to handle infinity.

2011-10-28 Thread Paul Berry
On 27 October 2011 20:13, Kenneth Graunke kenn...@whitecape.org wrote: On 10/26/2011 06:42 PM, Paul Berry wrote: In order to implement the GLSL 1.30 isinf() function, it will be necessary to be able to represent infinity in the GLSL IR s-expression format. This patch extends the s

[Mesa-dev] [PATCH 1/2] mesa: Set the Integer field of gl_client_array properly.

2011-10-31 Thread Paul Berry
This patch ensures that gl_client_array::Integer is properly set to GL_TRUE for vertex attributes specified using glVertexAttribIPointer, and to GL_FALSE for vertex attributes specified using glVertexAttribPointer, so that the vertex attributes can be interpreted properly by driver back-ends. ---

[Mesa-dev] [PATCH 2/2] i965: Add support for integral vertex attributes.

2011-10-31 Thread Paul Berry
When a vertex shader input attribute is declared with an integral type (e.g. ivec4), we need to ensure that the generated vertex shader code addresses the vertex attribute register using the proper register type. (Previously, we assumed all vertex shader input attributes were floating-point). In

[Mesa-dev] [PATCH] glsl: Fix type mismatch when incrementing or decrementing uint.

2011-10-31 Thread Paul Berry
When converting an expression like ++x to GLSL IR we were failing to account for the possibility that x might be an unsigned integral type. As a result the user would receive a bogus error message Could not implicitly convert operands to arithmetic operator. Fixes piglit tests

Re: [Mesa-dev] [PATCH] glsl: Fix type mismatch when incrementing or decrementing uint.

2011-11-01 Thread Paul Berry
On 31 October 2011 23:24, Kenneth Graunke kenn...@whitecape.org wrote: On 10/31/2011 08:34 PM, Paul Berry wrote: When converting an expression like ++x to GLSL IR we were failing to account for the possibility that x might be an unsigned integral type. As a result the user would receive

[Mesa-dev] [PATCH] i965: Fix constant propagation into 32-bit integer MUL.

2011-11-01 Thread Paul Berry
i965's MUL instruction can't take an immediate value as its first argument. So normally, if constant propagation wants to propagate a constant into the first argument of a MUL instruction, it swaps the order of the two arguments. This doesn't work for 32-bit integer (and unsigned integer)

Re: [Mesa-dev] [PATCH 1/3] glsl: Assign transform feedback varying slots in linker.

2011-11-04 Thread Paul Berry
Sorry I missed the first round of feedback on these patches. I hope my comments aren't coming too late. On 1 November 2011 12:48, Marek Olšák mar...@gmail.com wrote: From: Dan McCabe zen3d.li...@gmail.com Modify the linker to assign additional slots for varying variables used by transform

Re: [Mesa-dev] [PATCH 2/3] glsl: translate transform feedback varyings into low-level representation

2011-11-04 Thread Paul Berry
On 1 November 2011 12:48, Marek Olšák mar...@gmail.com wrote: This adds a function that takes an array of varyings from glTranformFeedbackVaryingsEXT and generates gl_transform_feedback_info, which is supposed to be consumed by drivers. Useful for ir_to_mesa and glsl_to_tgsi. v2: - changes

Re: [Mesa-dev] [PATCH 3/4] linker: Use app-specified fragment data location during linking

2011-11-07 Thread Paul Berry
for inputs that have user-defined (via *glBindVertexAttribLocation) locations. should be updated to mention glBindFragDataLocation. Other than those nit-picks, this series is: Reviewed-by: Paul Berry stereotype...@gmail.com ___ mesa-dev mailing list

Re: [Mesa-dev] [PATCH 2/3] glsl: translate transform feedback varyings into low-level representation

2011-11-07 Thread Paul Berry
On 4 November 2011 16:43, Marek Olšák mar...@gmail.com wrote: Hi Paul, I won't comment on the patch 1, because I didn't write it, I was just preserving history. On Fri, Nov 4, 2011 at 10:00 PM, Paul Berry stereotype...@gmail.com wrote: [snip] +bool parse_tfeedback_decl(const void

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

2011-11-07 Thread Paul Berry
This patch modifies the GLSL linker to assign additional slots for varying variables used by transform feedback, and record the varying slots used by transform feedback for use by the driver back-end. This required modifying assign_varying_locations() so that it assigns a varying location if

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

2011-11-07 Thread Paul Berry
On 7 November 2011 17:34, Marek Olšák mar...@gmail.com wrote: On Tue, Nov 8, 2011 at 1:13 AM, Paul Berry stereotype...@gmail.com wrote: +/** + * Update gl_transform_feedback_info to reflect this tfeedback_decl. + * + * If an error occurs, the error is reported through linker_error

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

2011-11-07 Thread Paul Berry
This patch modifies the GLSL linker to assign additional slots for varying variables used by transform feedback, and record the varying slots used by transform feedback for use by the driver back-end. This required modifying assign_varying_locations() so that it assigns a varying location if

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

2011-11-08 Thread Paul Berry
On 8 November 2011 05:15, Marek Olšák mar...@gmail.com wrote: On Tue, Nov 8, 2011 at 7:28 AM, Paul Berry stereotype...@gmail.com wrote: This patch modifies the GLSL linker to assign additional slots for varying variables used by transform feedback, and record the varying slots used

[Mesa-dev] [PATCH] r200: remove dangling radeon.h symlink.

2011-11-08 Thread Paul Berry
Commit 1401b96b (radeon: cleanup radeon shared code after r300 and r600 classic drivers removal) removed the file src/mesa/drivers/dri/radeon/server/radeon.h, but it left behind the symlink which was used to share that file into the src/mesa/drivers/dri/r200/server directory. This patch removes

Re: [Mesa-dev] [PATCH] glsl: Clamp vector indices when lowering to swizzles

2011-11-08 Thread Paul Berry
); } ir_visitor_status -- 1.7.6.4 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] Mixing C C++

2011-11-08 Thread Paul Berry
On 8 November 2011 12:30, Jose Fonseca jfons...@vmware.com wrote: At the moment MSVC build's failing with the error mesa.lib(uniform_query.obj) : error LNK2001: unresolved external symbol int MESA_VERBOSE (?MESA_VERBOSE@@3HA) build\windows-x86-debug\gallium\targets\libgl-gdi\opengl32.dll :

Re: [Mesa-dev] [PATCH] glsl: Remove texture built-ins with 'bias' from 1.30 VS profile.

2011-11-09 Thread Paul Berry
(sampler2DShadow sampler, vec3 coord, float lod); vec4 shadow1DProjLod(sampler1DShadow sampler, vec4 coord, float lod); -- 1.7.7.1 Other than the above comment, this patch is: Reviewed-by: Paul Berry stereotype...@gmail.com ___ mesa-dev mailing list

Re: [Mesa-dev] [PATCH 07/13] i965: Combine the two WM pull constant tracked state atoms.

2011-11-09 Thread Paul Berry
On 8 November 2011 14:32, Kenneth Graunke kenn...@whitecape.org wrote: These were only split for historical reasons: brw_wm_constants used to be the prepare step, while brw_wm_constant_surface was emit. Now that both happen at emit time, it makes sense to combine them. Call the newly

Re: [Mesa-dev] [PATCH 17/20] i965: Move _mesa_ir_link_shader call before device-specific linking

2011-11-09 Thread Paul Berry
On 31 October 2011 11:59, Ian Romanick i...@freedesktop.org wrote: On 10/28/2011 02:59 PM, Eric Anholt wrote: On Fri, 28 Oct 2011 10:42:44 -0700, Ian Romanicki...@freedesktop.org wrote: From: Ian Romanickian.d.romanick@intel.**com ian.d.roman...@intel.com _mesa_ir_link_shader needs to

Re: [Mesa-dev] [PATCH 6/6] i965: Expose GLSL 1.30 on gen4+.

2011-11-10 Thread Paul Berry
On 9 November 2011 11:33, Eric Anholt e...@anholt.net wrote: With the gl_VertexID support, everything required should now be supported. --- src/mesa/drivers/dri/intel/intel_extensions.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git

Re: [Mesa-dev] [PATCH 1/2] glsl: Fix misnamed textureProjOffset prototypes in built-in profiles.

2011-11-10 Thread Paul Berry
*/ vec4 textureLodOffset( sampler1D sampler, float P, float lod, int offset); -- 1.7.7.2 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] [PATCH 2/2] glsl: Remove textureGradOffset built-ins taking samplerCube parameters.

2011-11-10 Thread Paul Berry
) generate_fiu_sigs(txd, 2D, Offset) generate_fiu_sigs(txd, 3D, Offset) -generate_fiu_sigs(txd, Cube, Offset) generate_fiu_sigs(txd, 1DArray, Offset) generate_fiu_sigs(txd, 2DArray, Offset) generate_sigs(, txd, 1DShadow, Offset | Single, 1); -- 1.7.7.2 Reviewed-by: Paul Berry stereotype

Re: [Mesa-dev] [PATCH 1/2] ir_to_mesa: don't init unfirom if link failed

2011-11-14 Thread Paul Berry
) { -- 1.7.4.4 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] [PATCH] i965/gen4: Fix sampling from integer textures.

2011-11-14 Thread Paul Berry
, 1, - BRW_SAMPLER_SIMD_MODE_SIMD16); + BRW_SAMPLER_SIMD_MODE_SIMD16, + BRW_SAMPLER_RETURN_FORMAT_FLOAT32); } -- 1.7.7 Reviewed-by: Paul Berry stereotype...@gmail.com ___ mesa-dev mailing list mesa-dev

Re: [Mesa-dev] [PATCH 1/3] glsl: Add a new matching_signature() variant that returns exact/inexact.

2011-11-14 Thread Paul Berry
); Minor quibble: I'd prefer to make match_is_exact a pointer, so that in the caller, it's obvious that the value of match_is_exact is going to be changed. In any case, this patch is: Reviewed-by: Paul Berry stereotype...@gmail.com ___ mesa-dev mailing list

Re: [Mesa-dev] [PATCH 2/3] glsl: Split code to generate an ir_call out from match_function_by_name.

2011-11-14 Thread Paul Berry
is identical. Signed-off-by: Kenneth Graunke kenn...@whitecape.org Very sensible. Thanks for making this refactoring a separate commit. Reviewed-by: Paul Berry stereotype...@gmail.com ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http

[Mesa-dev] [PATCH 00/13] i965 vs: Split vec4_visitor into two classes.

2011-11-16 Thread Paul Berry
In order to implement transform feedback on Gen6, we need to create a geometry shader program that will stream out the transformed vertices. It makes sense to re-use parts of the vec4_visitor infrastructure to do this, because (a) VS and GS handle data very similarly, (b) it allows us to take

[Mesa-dev] [PATCH 01/13] i965 vs: Remove dead code from the vec4_visitor class.

2011-11-16 Thread Paul Berry
This patch removes two unused functions from vec4_visitor: implied_mrf_writes() and emit_bool_comparison(). implied_mrf_writes() is part of instruction scheduling, which has not been implemented for vec4_visitor yet. emit_bool_comparison() has never been used. It also removes two declarations

[Mesa-dev] [PATCH 02/13] i965 vs: Make reg_allocate() return total_grf.

2011-11-16 Thread Paul Berry
Previously, reg_allocate() (and reg_allocate_trivial()) stored the total number of registers allocated (including payload registers) in vec4_visitor::total_grf. Now, it returns this value to vec4_visitor::run(), which stores it in total_grf. This helps pave the way for separating the IR visiting

[Mesa-dev] [PATCH 03/13] i965 vs: Return last_scratch from move_grf_array_access_to_scratch()

2011-11-16 Thread Paul Berry
Previously, vec4_visitor::move_grf_array_access_to_scratch() stored the value of last_scratch in the brw_vs_compile structure directly. Now it returns it to vec4_visitor::run(), which stores it. This helps pave the way for sharing vec4 code between the GS and the VS, by making

[Mesa-dev] [PATCH 04/13] i965 vs: Make first_non_payload_grf an explicit function argument.

2011-11-16 Thread Paul Berry
Previously, vec4_visitor::setup_payload() stored the location of the first non-payload GRF in vec4_visitor::first_non_payload_grf, where it was later picked up by the register allocator. Now setup_payload() returns the location to the caller (vec4_visitor::run()), which passes it directly to the

[Mesa-dev] [PATCH 05/13] i965 vs: Move brw_set_access_mode() call into generate_code().

2011-11-16 Thread Paul Berry
Previously, vec4_visitor::run() called brw_set_access_mode() right before calling vec4_visitor::generate_code(). It seems clearer to put the call inside generate_code(), since the purpose of brw_set_access_mode() is to set up the proper state for code generation. This helps pave the way for

[Mesa-dev] [PATCH 06/13] i965 vs: Move the call to reg_allocate() inside of generate_code().

2011-11-16 Thread Paul Berry
Previously, vec4_visitor::run() was responsible for calling reg_allocate() right before generate_code(). However, since there is no reason for run() to do any further manipulation of the instructions between calling reg_allocate() and generate_code(), it's just as simple to have generate_code()

[Mesa-dev] [PATCH 07/13] i965 vs: Streamline the way fail is tracked.

2011-11-16 Thread Paul Berry
Previously, vec4_visitor flagged a failure by setting the failed boolean and storing a string in fail_msg (which, up until the point of failure, was undefined). This is redundant--it's just as easy to have fail_msg be NULL when there is no failure, and a string pointer when there is a failure.

[Mesa-dev] [PATCH 08/13] i965 vs: Add get_debug_flag()

2011-11-16 Thread Paul Berry
To determine whether a debug dump should be performed, vec4_visitor checks the DEBUG_VS bit in INTEL_DEBUG. This patch moves that check into a single common function, get_debug_flag(). This helps pave the way for sharing code between VS and GS code generation, by creating a function that can be

[Mesa-dev] [PATCH 10/13] i965 vs: Make a separate optimize() method.

2011-11-16 Thread Paul Berry
This patch moves vec4_visitor::run()'s optimization loop to its own method. This helps pave the way for separating the IR visiting parts of vec4_visitor from the code generation parts, by reducing the number of function calls between the two parts. --- src/mesa/drivers/dri/i965/brw_vec4.h

[Mesa-dev] [PATCH 11/13] i965 vs: Make get_assignment_lhs() a method

2011-11-16 Thread Paul Berry
Previously, get_assignment_lhs() was a static function. But it makes just as much sense to make it a private member functions of vec4_visitor, because it is one of vec4_visitor's implementation details, just like the other functions in brw_vec4_visitor.cpp. This will allow the implementation

[Mesa-dev] [PATCH 12/13] i965 vs: Separate IR visiting from code generation in vec4_visitor.

2011-11-16 Thread Paul Berry
This patch separates vec4_visitor into a base class, vec4_generator, and a derived class, vec4_visitor. vec4_generator is responsible for code generation, register allocation, and optimization; it is independent of GLSL IR (with one trivial exception), and mostly independent of the type of shader

[Mesa-dev] [PATCH 13/13] i965 vs: Rearrange class declarations.

2011-11-16 Thread Paul Berry
This patch rearranges the class declarations for vec4_generator and vec4_visitor, and adds private and protected modifiers, to clarify how the code is organized and how the two classes relate to each other. There is no functional change. --- src/mesa/drivers/dri/i965/brw_vec4.h | 310

Re: [Mesa-dev] [PATCH 00/13] i965 vs: Split vec4_visitor into two classes.

2011-11-16 Thread Paul Berry
On 16 November 2011 11:07, Paul Berry stereotype...@gmail.com wrote: In order to implement transform feedback on Gen6, we need to create a geometry shader program that will stream out the transformed vertices. It makes sense to re-use parts of the vec4_visitor infrastructure to do

[Mesa-dev] i965 gen6: Pass-through GS program for future use by transform feedback

2011-12-05 Thread Paul Berry
This patch series introduces a geometry shader program for i965 Gen6 (Sandy Bridge) that does nothing--it simply passes vertices through to later stages of the graphics pipeline. This is a preliminary step towards implementing transform feedback, since on Gen6, transform feedback is accomplished

[Mesa-dev] [PATCH 01/10] mesa: Track changes to transform feedback state.

2011-12-05 Thread Paul Berry
This patch adds a new bit to the ctx-NewState bitfield, _NEW_TRANSFORM_FEEDBACK, to track state changes that affect ctx-TransformFeedback. This bit can be used by driver back-ends to avoid expensive recomputations when transform feedback state has not been modified. --- src/mesa/main/mtypes.h

[Mesa-dev] [PATCH 02/10] i965 gs: Reduce information in key to avoid unnecessary recompiles.

2011-12-05 Thread Paul Berry
Previously, the geometry shader program key was storing all the information necessary to compute the exact structure of the VUE map (attrs and userclip_active). However, the GS program doesn't depend on the exact structure of the VUE map; only on the size (in 256-bit registers) of the VUE. So we

[Mesa-dev] [PATCH 03/10] i965 gs: Remove unnecessary mapping of key-primitive.

2011-12-05 Thread Paul Berry
Previously, GS generation code contained a lookup table that mapped primitive types POLYGON, TRISTRIP, and TRIFAN to TRILIST, mapped LINESTRIP to LINELIST, and left all other primitives unchanged. This was silly, because we never generate a GS program for those primitive types anyhow. This patch

[Mesa-dev] [PATCH 04/10] i965: Don't convert if/else to conditional adds on Gen6.

2011-12-05 Thread Paul Berry
Normally when outputting instructions in SPF (single program flow) mode, we convert IF and ELSE instructions to conditional ADD instructions applied to the IP register, since this lets us avoid having to emit an ENDIF instruction (and, in Gen4, lets us avoid using up precious space in the

[Mesa-dev] [PATCH 05/10] i965: Fix convert_IF_ELSE_to_ADD for gen7.

2011-12-05 Thread Paul Berry
The function convert_IF_ELSE_to_ADD() assumes that it doesn't have to modify the destination and src0 fields of the instruction that it's modifying, since prior to Gen6, IF and ELSE instructions use the IP register in these fields. In Gen6 and later, this is no longer true. Currently this isn't

[Mesa-dev] [PATCH 07/10] i965: Initial stab at GS URB space allocation.

2011-12-05 Thread Paul Berry
From: Kenneth Graunke kenn...@whitecape.org The 50/50 split is just an attempt to get things working. We likely want to tune this, and probably want to avoid allocating the GS any space if we're not using it. For now, this is good enough. Signed-off-by: Kenneth Graunke kenn...@whitecape.org

[Mesa-dev] [PATCH 08/10] i965 gs: Clean up dodgy register re-use, at the cost of a few MOVs.

2011-12-05 Thread Paul Berry
Prior to this patch, in the Gen4 and Gen5 GS, we used GRF 0 (called R0 in the code) as a staging area to prepare the message header for the FF_SYNC and URB_WRITE messages. This cleverly avoided an unnecessary MOV operation (since the initial value of GRF 0 contains data that needs to be included

[Mesa-dev] [PATCH 09/10] i965: Clean up misleading defines for DWORD 2 of URB_WRITE header.

2011-12-05 Thread Paul Berry
R02_PRIM_END and R02_PRIM_START don't actually refer to bits in DWORD 2 of R0 (as the name, and comments in the code, would seem to indicate). Actually they refer to bits in DWORD 2 of the header for URB_WRITE messages. This patch renames the defines to reflect what they actually mean. It also

[Mesa-dev] [PATCH 10/10] i965 gen6: Implement pass-through GS for transform feedback.

2011-12-05 Thread Paul Berry
In Gen6, transform feedback is accomplished by having the geometry shader send vertex data to the data port using Streamed Vertex Buffer Write messages, while simultaneously passing vertices through to the rest of the graphics pipeline (if rendering is enabled). This patch adds a geometry shader

Re: [Mesa-dev] [PATCH 04/10] i965: Don't convert if/else to conditional adds on Gen6.

2011-12-05 Thread Paul Berry
On 5 December 2011 11:54, Kenneth Graunke kenn...@whitecape.org wrote: On 12/05/2011 09:40 AM, Paul Berry wrote: Normally when outputting instructions in SPF (single program flow) mode, we convert IF and ELSE instructions to conditional ADD instructions applied to the IP register, since

Re: [Mesa-dev] [PATCH 02/10] i965 gs: Reduce information in key to avoid unnecessary recompiles.

2011-12-05 Thread Paul Berry
On 5 December 2011 14:53, Eric Anholt e...@anholt.net wrote: On Mon, 5 Dec 2011 09:40:45 -0800, Paul Berry stereotype...@gmail.com wrote: Previously, the geometry shader program key was storing all the information necessary to compute the exact structure of the VUE map (attrs

Re: [Mesa-dev] [PATCH 02/10] i965 gs: Reduce information in key to avoid unnecessary recompiles.

2011-12-05 Thread Paul Berry
On 5 December 2011 18:42, Eric Anholt e...@anholt.net wrote: On Mon, 5 Dec 2011 15:14:13 -0800, Paul Berry stereotype...@gmail.com wrote: On 5 December 2011 14:53, Eric Anholt e...@anholt.net wrote: On Mon, 5 Dec 2011 09:40:45 -0800, Paul Berry stereotype...@gmail.com wrote

Re: [Mesa-dev] [PATCH 01/10] mesa: Track changes to transform feedback state.

2011-12-06 Thread Paul Berry
On 5 December 2011 14:50, Eric Anholt e...@anholt.net wrote: These statechanges should probably be flagged using FLUSH_VERTICES(ctx, _NEW_TRANSFORM_FEEDBACK), since we're about to change something that would be used by existing glBegin()/glEnd() rendering that is batched up in the vbo

Re: [Mesa-dev] [PATCH 01/10] mesa: Track changes to transform feedback state.

2011-12-06 Thread Paul Berry
On 6 December 2011 07:31, Paul Berry stereotype...@gmail.com wrote: On 5 December 2011 14:50, Eric Anholt e...@anholt.net wrote: These statechanges should probably be flagged using FLUSH_VERTICES(ctx, _NEW_TRANSFORM_FEEDBACK), since we're about to change something that would be used

Re: [Mesa-dev] [PATCH 07/10] i965: Initial stab at GS URB space allocation.

2011-12-06 Thread Paul Berry
On 5 December 2011 14:57, Eric Anholt e...@anholt.net wrote: On Mon, 5 Dec 2011 09:40:50 -0800, Paul Berry stereotype...@gmail.com wrote: From: Kenneth Graunke kenn...@whitecape.org The 50/50 split is just an attempt to get things working. We likely want to tune this, and probably

Re: [Mesa-dev] [PATCH 02/10] i965 gs: Reduce information in key to avoid unnecessary recompiles.

2011-12-06 Thread Paul Berry
On 5 December 2011 15:14, Paul Berry stereotype...@gmail.com wrote: On 5 December 2011 14:53, Eric Anholt e...@anholt.net wrote: What I really want is to compute the vue map at the top of the pipeline and reuse it from the various places that want it. Yeah, me too. I'll write a follow-up

Re: [Mesa-dev] [PATCH 17/20] i965: Move _mesa_ir_link_shader call before device-specific linking

2011-12-06 Thread Paul Berry
On 9 November 2011 11:09, Paul Berry stereotype...@gmail.com wrote: On 31 October 2011 11:59, Ian Romanick i...@freedesktop.org wrote: On 10/28/2011 02:59 PM, Eric Anholt wrote: On Fri, 28 Oct 2011 10:42:44 -0700, Ian Romanicki...@freedesktop.org wrote: From: Ian Romanickian.d.romanick

Re: [Mesa-dev] [PATCH 07/10] i965: Initial stab at GS URB space allocation.

2011-12-06 Thread Paul Berry
On 6 December 2011 11:53, Eric Anholt e...@anholt.net wrote: On Tue, 6 Dec 2011 08:17:57 -0800, Paul Berry stereotype...@gmail.com wrote: On 5 December 2011 14:57, Eric Anholt e...@anholt.net wrote: On Mon, 5 Dec 2011 09:40:50 -0800, Paul Berry stereotype...@gmail.com wrote

Re: [Mesa-dev] [PATCH 02/10] i965 gs: Reduce information in key to avoid unnecessary recompiles.

2011-12-06 Thread Paul Berry
On 6 December 2011 11:43, Eric Anholt e...@anholt.net wrote: On Tue, 6 Dec 2011 09:19:15 -0800, Paul Berry stereotype...@gmail.com wrote: On 5 December 2011 15:14, Paul Berry stereotype...@gmail.com wrote: On 5 December 2011 14:53, Eric Anholt e...@anholt.net wrote: What I

Re: [Mesa-dev] [PATCH 09/10] i965: Clean up misleading defines for DWORD 2 of URB_WRITE header.

2011-12-07 Thread Paul Berry
On 6 December 2011 23:31, Kenneth Graunke kenn...@whitecape.org wrote: On 12/05/2011 09:40 AM, Paul Berry wrote: R02_PRIM_END and R02_PRIM_START don't actually refer to bits in DWORD 2 of R0 (as the name, and comments in the code, would seem to indicate). Actually they refer to bits

Re: [Mesa-dev] [PATCH 10/10] i965 gen6: Implement pass-through GS for transform feedback.

2011-12-07 Thread Paul Berry
On 6 December 2011 23:54, Kenneth Graunke kenn...@whitecape.org wrote: + if (intel-gen == 6) { + /* On Gen6, GS is used for transform feedback. */ + key-need_gs_prog = ctx-TransformFeedback.CurrentObject-Active; + } else if (intel-gen = 7) { + /* On Gen7 and later, we

[Mesa-dev] [PATCH v2 0/8] i965 gen6: Pass-through GS program for future use by transform feedback

2011-12-07 Thread Paul Berry
Ok, I've cleaned up and made changes according to the suggestions made on the mailing list. I believe all that needs review now is patch 5/8 (Allocate URB space for GS). On Eric's suggestion, I changed this patch to only allocate URB space for the GS when the GS is actually in use. The PRM

[Mesa-dev] [PATCH v2 1/8] mesa: Track changes to transform feedback state.

2011-12-07 Thread Paul Berry
This patch adds a new bit to the ctx-NewState bitfield, _NEW_TRANSFORM_FEEDBACK, to track state changes that affect ctx-TransformFeedback. This bit can be used by driver back-ends to avoid expensive recomputations when transform feedback state has not been modified. Reviewed-by: Kenneth Graunke

[Mesa-dev] [PATCH v2 2/8] i965 gs: Remove unnecessary mapping of key-primitive.

2011-12-07 Thread Paul Berry
Previously, GS generation code contained a lookup table that mapped primitive types POLYGON, TRISTRIP, and TRIFAN to TRILIST, mapped LINESTRIP to LINELIST, and left all other primitives unchanged. This was silly, because we never generate a GS program for those primitive types anyhow. This patch

[Mesa-dev] [PATCH v2 3/8] i965: Only convert if/else to conditional adds prior to Gen6.

2011-12-07 Thread Paul Berry
Normally when outputting instructions in SPF (single program flow) mode, we convert IF and ELSE instructions to conditional ADD instructions applied to the IP register. On platforms prior to Gen6, flow control instructions cause an implied thread switch, so this is a significant savings.

[Mesa-dev] [PATCH v2 4/8] i965: Set the maximum number of GS URB entries on Sandybridge.

2011-12-07 Thread Paul Berry
From: Kenneth Graunke kenn...@whitecape.org We never filled this in before because we didn't care. I'm skeptical these are correct; my sources indicate that both the VS and GS # of entries are 256 on both GT1 and GT2. I'm also loathe to change it and break stuff. Reviewed-by: Paul Berry

[Mesa-dev] [PATCH v2 5/8] i965 gen6: Allocate URB space for GS

2011-12-07 Thread Paul Berry
When the GS is not in use, the entire URB space is available for the VS. When the GS is in use, we split the URB space 50/50. The 50/50 split is probably not optimal--we'll probably want tune this for performance in a future patch. For example, in most situations, it's probably worth allocating

[Mesa-dev] [PATCH v2 6/8] i965 gs: Clean up dodgy register re-use, at the cost of a few MOVs.

2011-12-07 Thread Paul Berry
Prior to this patch, in the Gen4 and Gen5 GS, we used GRF 0 (called R0 in the code) as a staging area to prepare the message header for the FF_SYNC and URB_WRITE messages. This cleverly avoided an unnecessary MOV operation (since the initial value of GRF 0 contains data that needs to be included

[Mesa-dev] [PATCH v2 7/8] i965: Clean up misleading defines for DWORD 2 of URB_WRITE header.

2011-12-07 Thread Paul Berry
R02_PRIM_END and R02_PRIM_START don't actually refer to bits in DWORD 2 of R0 (as the name, and comments in the code, would seem to indicate). Actually they refer to bits in DWORD 2 of the header for URB_WRITE messages. This patch renames the defines to reflect what they actually mean. It also

Re: [Mesa-dev] [PATCH v2 3/8] i965: Only convert if/else to conditional adds prior to Gen6.

2011-12-07 Thread Paul Berry
On 7 December 2011 13:03, Eric Anholt e...@anholt.net wrote: On Wed, 7 Dec 2011 11:09:11 -0800, Paul Berry stereotype...@gmail.com wrote: - assert(!p-single_program_flow); + /* In principle, we shouldn't be patching IF and ELSE instructions in +* single program flow mode when gen

Re: [Mesa-dev] [PATCH v2 8/8] i965 gen6: Implement pass-through GS for transform feedback.

2011-12-07 Thread Paul Berry
On 7 December 2011 13:32, Eric Anholt e...@anholt.net wrote: On Wed, 7 Dec 2011 11:09:16 -0800, Paul Berry stereotype...@gmail.com wrote: In Gen6, transform feedback is accomplished by having the geometry shader send vertex data to the data port using Streamed Vertex Buffer Write

Re: [Mesa-dev] [PATCH v2 4/8] i965: Set the maximum number of GS URB entries on Sandybridge.

2011-12-07 Thread Paul Berry
On 7 December 2011 13:16, Eric Anholt e...@anholt.net wrote: On Wed, 7 Dec 2011 11:09:12 -0800, Paul Berry stereotype...@gmail.com wrote: From: Kenneth Graunke kenn...@whitecape.org We never filled this in before because we didn't care. I'm skeptical these are correct; my sources

Re: [Mesa-dev] [PATCH v2 4/8] i965: Set the maximum number of GS URB entries on Sandybridge.

2011-12-07 Thread Paul Berry
On 7 December 2011 15:02, Paul Berry stereotype...@gmail.com wrote: On 7 December 2011 13:16, Eric Anholt e...@anholt.net wrote: On Wed, 7 Dec 2011 11:09:12 -0800, Paul Berry stereotype...@gmail.com wrote: From: Kenneth Graunke kenn...@whitecape.org We never filled this in before

[Mesa-dev] [PATCH 1/8] mesa: Record transform feedback stride in linker output.

2011-12-13 Thread Paul Berry
This patch adds the field gl_transform_feedback_info::BufferStride, which records the total number of components (per vertex) that transform feedback is being instructed to store in each buffer. The i965 gen6 back-end needs this information in order to set up binding tables, and it seems better

[Mesa-dev] [PATCH 2/8] mesa: Fix off-by-one error in transform feedback size check.

2011-12-13 Thread Paul Berry
In _mesa_BindBufferRange(), we need to verify that the offset and size specified by the client do not exceed the size of the underlying buffer. We were accidentally doing this check using = rather than , so we were generating a bogus error if the client specified an offset and size that fit

[Mesa-dev] [PATCH 3/8] i965 gen6+: Use 1-wide null operands for IF instructions

2011-12-13 Thread Paul Berry
The Sandy Bridge PRM, volume 4, part 2, section 5.3.10 (5.3.10 Register Region Restrictions) contains the following restriction on the execution size and operand width of instructions: 3. ExecSize must be equal to or greater than Width. When emitting an IF instruction in single program flow

[Mesa-dev] [PATCH 4/8] i965 gs: Move vue_map to brw_gs_compile.

2011-12-13 Thread Paul Berry
This patch stores the geometry shader VUE map from a local variable in compile_gs_prog() to a field in the brw_gs_compile struct, so that it will be available while compiling the geometry shader. This is necessary in order to support transform feedback on Gen6, because the Gen6 geometry shader

[Mesa-dev] [PATCH 5/8] i965 gen6: Initial implementation of transform feedback.

2011-12-13 Thread Paul Berry
This patch adds basic transform feedback capability for Gen6 hardware. This consists of several related pieces of functionality: (1) In gen6_sol.c, we set up binding table entries for use by transform feedback. We use one binding table entry per transform feedback varying (this allows us to

[Mesa-dev] [PATCH 6/8] i965 gen6: Turn on transform feedback extension.

2011-12-13 Thread Paul Berry
This patch advertises support for EXT_transform_feedback on Intel Gen6 and higher. Since transform feedback support is not completely finished yet, for now we only advertise support for it when MESA_GL_VERSION_OVERRIDE is 3.0 or greater (since transform feedback is required by GL version 3.0).

[Mesa-dev] [PATCH 7/8] i965 gen6+: Make intel_batchbuffer_emit_mi_flush() actually flush.

2011-12-13 Thread Paul Berry
Previous to this patch, the function intel_batchbuffer_emit_mi_flush() was a bit of a misnomer. On Gen4+, when not using the blit engine, it didn't actually flush the pipeline--it simply generated a _3DSTATE_PIPE_CONTROL command with the necessary bits set to flush GPU caches. This was usually

[Mesa-dev] [PATCH 8/8] i965: Flush pipeline on EndTransformFeedback.

2011-12-13 Thread Paul Berry
A common use case for transform feedback is to perform one draw operation that writes transform feedback output to a buffer, followed by a second draw operation that consumes that buffer as vertex input. Since vertex input is consumed at an earlier pipeline stage than writing transform feedback

Re: [Mesa-dev] [PATCH 8/8] i965: Flush pipeline on EndTransformFeedback.

2011-12-14 Thread Paul Berry
On 14 December 2011 01:44, Kenneth Graunke kenn...@whitecape.org wrote: On 12/13/2011 03:35 PM, Paul Berry wrote: A common use case for transform feedback is to perform one draw operation that writes transform feedback output to a buffer, followed by a second draw operation that consumes

Re: [Mesa-dev] [PATCH 8/8] i965: Flush pipeline on EndTransformFeedback.

2011-12-14 Thread Paul Berry
A common use case for transform feedback is to perform one draw operation that writes transform feedback output to a buffer, followed by a second draw operation that consumes that buffer as vertex input. Since vertex input is consumed at an earlier pipeline stage than writing transform feedback

Re: [Mesa-dev] [PATCH 3/8] i965 gen6+: Use 1-wide null operands for IF instructions

2011-12-14 Thread Paul Berry
On 14 December 2011 02:33, Kenneth Graunke kenn...@whitecape.org wrote: On 12/13/2011 03:35 PM, Paul Berry wrote: The Sandy Bridge PRM, volume 4, part 2, section 5.3.10 (5.3.10 Register Region Restrictions) contains the following restriction on the execution size and operand width

Re: [Mesa-dev] [PATCH 6/8] i965 gen6: Turn on transform feedback extension.

2011-12-14 Thread Paul Berry
On 14 December 2011 02:51, Kenneth Graunke kenn...@whitecape.org wrote: On 12/13/2011 03:35 PM, Paul Berry wrote: This patch advertises support for EXT_transform_feedback on Intel Gen6 and higher. Since transform feedback support is not completely finished yet, for now we only

Re: [Mesa-dev] [PATCH 7/8] i965 gen6+: Make intel_batchbuffer_emit_mi_flush() actually flush.

2011-12-14 Thread Paul Berry
On 14 December 2011 02:59, Kenneth Graunke kenn...@whitecape.org wrote: On 12/13/2011 03:35 PM, Paul Berry wrote: Previous to this patch, the function intel_batchbuffer_emit_mi_flush() was a bit of a misnomer. On Gen4+, when not using the blit engine, it didn't actually flush the pipeline

  1   2   3   4   5   6   7   8   9   10   >