Re: [Mesa-dev] [PATCH 06/15] i965/fs: Perform CSE on CMP(N) instructions.

2013-10-28 Thread Eric Anholt
Matt Turner writes: > Optimizes > > cmp.ge.f0(8) null g45<8,8,1>F 0F > (+f0) sel(8)g50<1>F g40<8,8,1>F g10<8,8,1>F > cmp.ge.f0(8) null g45<8,8,1>F 0F > (+f0) sel(8)g51<1>F g41<8,8,1>F g11<8,8,1>F > cmp.ge.f0(8) null g45<8,8,1>F 0F > (+f0) se

Re: [Mesa-dev] [PATCH 05/15] i965/fs: Don't dead code eliminate CMP(N).

2013-10-28 Thread Eric Anholt
Matt Turner writes: > Since compare instructions write the flag register, they should not be > considered dead even if their destination is never read. Instead of > removing them if found to be dead, set their destination to null to free > a register. > > --- > src/mesa/drivers/dri/i965/brw_fs.c

Re: [Mesa-dev] [PATCH 04/15] i965/fs: Don't emit null MOVs in CSE.

2013-10-28 Thread Eric Anholt
Matt Turner writes: > We'd like to CSE some instructions, like CMP, that often have null > destinations. Instead of replacing them with MOVs to null, just don't > emit the MOV. > --- > src/mesa/drivers/dri/i965/brw_fs_cse.cpp | 42 > +++- > 1 file changed, 25 inserti

[Mesa-dev] [PATCH] i965/fs: Drop our dead push constants before overflowing to pull constants.

2013-10-28 Thread Eric Anholt
The idea of the original order was that you'd dead code eliminate accesses to push constants. But I've never seen a case of that (nor has shader-db), while we frequently see sparse accesses of large constant arrays that would overflow into pull constants. Cuts pull constant use on csgo, serious s

Re: [Mesa-dev] [PATCH] Remove error when calling glGenQueries/glDeleteQueries while a query is active

2013-10-28 Thread Kenneth Graunke
On 10/28/2013 11:02 AM, Carl Worth wrote: [snip] Would you mind adding the "mesa: " prefix to the commit title? > @@ -241,18 +234,20 @@ _mesa_DeleteQueries(GLsizei n, const GLuint *ids) >return; > } > > - /* No query objects can be active at this time! */ > - if (ctx->Query.Curr

[Mesa-dev] Mesa 10.0 stable branch and release plans

2013-10-28 Thread Ian Romanick
There had been some discussion at XDC about Mesa 10.0 release plans, but I don't think anyone committed to anything. The plan I pitched was to create the 10.0 branch on 10/31 (feature freeze) and release on 11/27. There are a lot of patches on the mailing list in need of review (Curro's ARB_shade

Re: [Mesa-dev] [PATCH V2 10/12] i965/gen6: Enable the features required for GL_ARB_sample_shading

2013-10-28 Thread Paul Berry
On 28 October 2013 19:50, Anuj Phogat wrote: > > > > On Mon, Oct 28, 2013 at 6:14 PM, Paul Berry wrote: > >> On 25 October 2013 16:45, Anuj Phogat wrote: >> >>> - Enable GEN6_WM_MSDISPMODE_PERSAMPLE, GEN6_WM_POSOFFSET_SAMPLE, >>> GEN6_WM_OMASK_TO_RENDER_TARGET as per extension's specification.

Re: [Mesa-dev] [PATCH V2 10/12] i965/gen6: Enable the features required for GL_ARB_sample_shading

2013-10-28 Thread Anuj Phogat
On Mon, Oct 28, 2013 at 6:14 PM, Paul Berry wrote: > On 25 October 2013 16:45, Anuj Phogat wrote: > >> - Enable GEN6_WM_MSDISPMODE_PERSAMPLE, GEN6_WM_POSOFFSET_SAMPLE, >> GEN6_WM_OMASK_TO_RENDER_TARGET as per extension's specification. >> - Only enable one of GEN6_WM_8_DISPATCH_ENABLE or >> GE

Re: [Mesa-dev] [PATCH V2 10/12] i965/gen6: Enable the features required for GL_ARB_sample_shading

2013-10-28 Thread Paul Berry
On 28 October 2013 18:14, Paul Berry wrote: > On 25 October 2013 16:45, Anuj Phogat wrote: > >> - Enable GEN6_WM_MSDISPMODE_PERSAMPLE, GEN6_WM_POSOFFSET_SAMPLE, >> GEN6_WM_OMASK_TO_RENDER_TARGET as per extension's specification. >> - Only enable one of GEN6_WM_8_DISPATCH_ENABLE or >> GEN6_WM_1

Re: [Mesa-dev] [PATCH V2 00/12] Implement GL_ARB_sample_shading on Intel hardware

2013-10-28 Thread Paul Berry
On 25 October 2013 16:44, Anuj Phogat wrote: > Patches listed below implement the GL_ARB_sample_shading extension > on Intel hardware >= gen6. I verified the implementation with a > number of piglit tests, currently under review on piglit mailing > list. Observed no piglit, gles3 CTS regressions

Re: [Mesa-dev] [PATCH V2 11/12] i965/gen7: Enable the features required for GL_ARB_sample_shading

2013-10-28 Thread Paul Berry
On 25 October 2013 16:45, Anuj Phogat wrote: > - Enable GEN7_WM_MSDISPMODE_PERSAMPLE, GEN7_WM_POSOFFSET_SAMPLE, > GEN7_WM_OMASK_TO_RENDER_TARGET as per extension's specification. > - Only enable one of GEN7_WM_8_DISPATCH_ENABLE or > GEN7_WM_16_DISPATCH_ENABLE > when GEN7_WM_MSDISPMODE_PERSAMP

Re: [Mesa-dev] [PATCH V2 10/12] i965/gen6: Enable the features required for GL_ARB_sample_shading

2013-10-28 Thread Paul Berry
On 25 October 2013 16:45, Anuj Phogat wrote: > - Enable GEN6_WM_MSDISPMODE_PERSAMPLE, GEN6_WM_POSOFFSET_SAMPLE, > GEN6_WM_OMASK_TO_RENDER_TARGET as per extension's specification. > - Only enable one of GEN6_WM_8_DISPATCH_ENABLE or > GEN6_WM_16_DISPATCH_ENABLE > when GEN6_WM_MSDISPMODE_PERSAMP

[Mesa-dev] [PATCH] st/mesa: move out of memory check in st_draw_vbo()

2013-10-28 Thread Brian Paul
Before we were only checking the st->vertex_array_out_of_memory flag after updating array state. But if there's two consecutive glDrawArrays calls and the first one is skipped because of OOM, the second one should be skipped too. Cc: 9.2 --- src/mesa/state_tracker/st_draw.c |7 --- 1 fi

Re: [Mesa-dev] [PATCH v2 3/8] i965: Create a new brw_transform_feedback_object subclass.

2013-10-28 Thread Eric Anholt
Kenneth Graunke writes: > This adds the basic driver hooks to allocate/free the brw variant. > It doesn't contain any additional information yet, but it will soon. > > v2: Use the new _mesa_init_transform_feedback_object helper function > (requested by Eric and Ian). Reviewed-by: Eric Anholt

Re: [Mesa-dev] [PATCH V2 08/12] i965: Add FS backend for builtin gl_SampleID

2013-10-28 Thread Anuj Phogat
On Mon, Oct 28, 2013 at 3:23 PM, Paul Berry wrote: > On 25 October 2013 16:45, Anuj Phogat wrote: > >> V2: >>- Update comments >>- Make changes to support simd16 mode. >>- Add compute_sample_id variables in brw_wm_prog_key >>- Add a special backend instruction to compute sample_i

Re: [Mesa-dev] [PATCH 4/4] i965/fs: Gen4-5: Implement alpha test in shader for MRT

2013-10-28 Thread Eric Anholt
Chris Forbes writes: > Signed-off-by: Chris Forbes This function should probably have a comment: /** * Alpha test support for when we compile it into the shader instead * of using the normal fixed function alpha test. */ > +void > +fs_visitor::emit_alpha_test() > +{ > + this->current_ann

Re: [Mesa-dev] [PATCH V2 08/12] i965: Add FS backend for builtin gl_SampleID

2013-10-28 Thread Paul Berry
On 25 October 2013 16:45, Anuj Phogat wrote: > V2: >- Update comments >- Make changes to support simd16 mode. >- Add compute_sample_id variables in brw_wm_prog_key >- Add a special backend instruction to compute sample_id. > > Signed-off-by: Anuj Phogat > --- > src/mesa/drivers/

[Mesa-dev] [PATCH 11/11] mesa: Optimize rebinding the same VBO

2013-10-28 Thread Fredrik Höglund
Check if the new buffer object has the same name as the current buffer object before looking it up. --- src/mesa/main/varray.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 5b5b8b2..93581ea 100644 --- a/src/mesa/m

[Mesa-dev] [PATCH 09/11] mesa: Add Get* support for ARB_vertex_attrib_binding

2013-10-28 Thread Fredrik Höglund
--- src/mesa/main/get.c | 24 src/mesa/main/get_hash_params.py |3 +++ src/mesa/main/varray.c |9 + 3 files changed, 36 insertions(+) diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index b39fdfb..caa163e 100644 --- a/src/me

[Mesa-dev] [PATCH 1/2] winsys: Correct Haiku winsys display target code

2013-10-28 Thread Alexander von Gluck IV
* Instead of assuming the displaytarget is the same stride / colorspace as the destination, lets actually check the source bitmap. * Fixes random stride issues in rendering --- src/gallium/winsys/sw/hgl/bitmap_wrapper.cpp | 20 src/gallium/winsys/sw/hgl/bitmap_wrapper.h

Re: [Mesa-dev] [PATCH v2 9/8+1] i965: Enable ARB_transform_feedback2 on Gen7+ if register writes work.

2013-10-28 Thread Eric Anholt
Kenneth Graunke writes: > With Linux 3.12, register writes work on Ivybridge and Baytrail, but not > Haswell. That will be fixed in a future kernel revision, at which point > this extension will automatically be enabled. > > Signed-off-by: Kenneth Graunke > --- > src/mesa/drivers/dri/i965/inte

Re: [Mesa-dev] [PATCH 04/12] mesa: Add a helper function _mesa_get_min_invocations_per_fragment()

2013-10-28 Thread Paul Berry
On 25 October 2013 16:45, Anuj Phogat wrote: > Thsi function is used to test if we need to do per sample shading or > per fragment shading. > s/Thsi/This/ > > Signed-off-by: Anuj Phogat > --- > src/mesa/program/program.c | 31 +++ > src/mesa/program/program.h | 3

[Mesa-dev] [PATCH 03/11] mesa: Rename gl_array_object::VertexAttrib to _VertexAttrib

2013-10-28 Thread Fredrik Höglund
This will become derived state as part of the ARB_vertex_attrib_binding support. --- src/mesa/main/api_arrayelt.c | 36 ++--- src/mesa/main/api_validate.c |6 ++-- src/mesa/main/arrayobj.c | 26 +++ src/mesa/main/attrib.c |4 +-- sr

[Mesa-dev] [PATCH 05/11] mesa: Add ARB_vertex_attrib_binding

2013-10-28 Thread Fredrik Höglund
update_array() and update_array_format() are changed to update the new attrib and binding states, and the client arrays become derived state. --- src/mesa/main/api_arrayelt.c |7 + src/mesa/main/arrayobj.c | 63 -- src/mesa/main/arrayobj.h |5 + src/mesa/main/attrib.c |

[Mesa-dev] [PATCH 02/11] mesa: Split out the format code from update_array()

2013-10-28 Thread Fredrik Höglund
Split out the code for updating the array format into a new function called update_array_format(). This function will be called by both update_array() and the new glVertexAttrib*Format() entry points in ARB_vertex_attrib_binding. --- src/mesa/main/varray.c | 144 ++

[Mesa-dev] [PATCH 2/2] haiku-softpipe: Minor cleanup and color space fixes

2013-10-28 Thread Alexander von Gluck IV
* Use more consistant data sources * Fix improper color space assignments * Remove unnecessary comments and code * Drop unnecessary round_up function (this was leftover from moving winsys code out of renderer) --- .../targets/haiku-softpipe/GalliumContext.cpp | 27 ..

[Mesa-dev] [PATCH 07/11] mesa: Don't use derived vertex state in Get* queries

2013-10-28 Thread Fredrik Höglund
--- src/mesa/main/enable.c | 36 ++--- src/mesa/main/get.c |8 ++--- src/mesa/main/get_hash_params.py | 66 +++--- src/mesa/main/getstring.c| 18 +-- src/mesa/main/varray.c | 12 +++ 5

Re: [Mesa-dev] [PATCH V2 09/12] i965: Add FS backend for builtin gl_SampleMask[]

2013-10-28 Thread Paul Berry
On 25 October 2013 16:45, Anuj Phogat wrote: > V2: >- Update comments >- Use fs_reg(0x) in AND instruction to get the 16 bit > sample_mask. >- Add a special backend instructions to compute sample_mask. >- Add a new variable uses_omask in brw_wm_prog_data. > > Signed-off-b

[Mesa-dev] [PATCH 10/11] mesa: Handle zero-stride arrays in _mesa_update_array_max_element()

2013-10-28 Thread Fredrik Höglund
--- src/mesa/main/varray.h |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h index a75cb7d..8a9487c 100644 --- a/src/mesa/main/varray.h +++ b/src/mesa/main/varray.h @@ -51,8 +51,10 @@ _mesa_update_array_max_element(struct g

Re: [Mesa-dev] [PATCH v2 7/8] i965: Implement glDrawTransformFeedback().

2013-10-28 Thread Kenneth Graunke
On 10/28/2013 04:52 AM, Pohjolainen, Topi wrote: > On Mon, Oct 28, 2013 at 01:14:55PM +0200, Pohjolainen, Topi wrote: >> On Fri, Oct 25, 2013 at 10:35:48PM -0700, Kenneth Graunke wrote: >>> Implementing the GetTransformFeedbackVertexCount() driver hook allows >>> the VBO module to call us with the

Re: [Mesa-dev] [PATCH] glsl: Add a CSE pass.

2013-10-28 Thread Eric Anholt
Paul Berry writes: > On 18 October 2013 15:44, Eric Anholt wrote: > >> This only operates on constant/uniform values for now, because otherwise >> I'd >> have to deal with killing my available CSE entries when assignments happen, >> and getting even this working in the tree ir was painful enough

[Mesa-dev] [PATCH 0.5/1] i965: Compute the node's delay time for scheduling.

2013-10-28 Thread Eric Anholt
This is a step in doing scheduling as described in Muchnick (p538). A difference is that our latency function is only specific to one instruction (it doesn't describe, for example, the different latency between WAR of a send's arguments and RAW of a send's destination), but that's changeable later

Re: [Mesa-dev] [PATCH V2 02/12] mesa: Add new functions and enums required by GL_ARB_sample_shading

2013-10-28 Thread Paul Berry
On 25 October 2013 16:44, Anuj Phogat wrote: > New functions added by GL_ARB_sample_shading: > glMinSampleShadingARB() > > New enums: > GL_SAMPLE_SHADING_ARB > GL_MIN_SAMPLE_SHADING_VALUE_ARB > > V2: Update comments. > Create new GL4x.xml. > Remove redundant code in get.c. > Update th

[Mesa-dev] [PATCH 08/11] mesa: Don't use derived vertex state in check_valid_to_render()

2013-10-28 Thread Fredrik Höglund
--- src/mesa/main/api_validate.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index d31f593..f285c97 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -120,7 +120,7 @@ check_va

Re: [Mesa-dev] [PATCH V2 07/12] i965: Add FS backend for builtin gl_SamplePosition

2013-10-28 Thread Paul Berry
On 25 October 2013 16:45, Anuj Phogat wrote: > V2: >- Update comments. >- Make changes to support simd16 mode. >- Add compute_pos_offset variable in brw_wm_prog_key. >- Add variable uses_omask in brw_wm_prog_data. > > Signed-off-by: Anuj Phogat > --- > src/mesa/drivers/dri/i965/

[Mesa-dev] [PATCH 04/11] glapi: Add infrastructure for ARB_vertex_attrib_binding

2013-10-28 Thread Fredrik Höglund
--- src/mapi/glapi/gen/ARB_vertex_attrib_binding.xml | 58 ++ src/mapi/glapi/gen/Makefile.am |1 + src/mapi/glapi/gen/gl_API.xml|6 ++- src/mesa/main/tests/dispatch_sanity.cpp | 12 ++--- src/mesa/main/varray.c

Re: [Mesa-dev] [PATCH V2 02/12] mesa: Add new functions and enums required by GL_ARB_sample_shading

2013-10-28 Thread Ian Romanick
On 10/28/2013 10:54 AM, Anuj Phogat wrote: > On Mon, Oct 28, 2013 at 10:29 AM, Ian Romanick wrote: >> On 10/25/2013 04:44 PM, Anuj Phogat wrote: >>> New functions added by GL_ARB_sample_shading: >>> glMinSampleShadingARB() >>> >>> New enums: >>> GL_SAMPLE_SHADING_ARB >>> GL_MIN_SAMPLE_SHADING_VALU

Re: [Mesa-dev] [PATCH 2/4] i965: Gen4-5: Include alpha func/ref in program key

2013-10-28 Thread Eric Anholt
Chris Forbes writes: > Signed-off-by: Chris Forbes > --- > src/mesa/drivers/dri/i965/brw_wm.c | 12 > src/mesa/drivers/dri/i965/brw_wm.h | 2 ++ > 2 files changed, 14 insertions(+) > > diff --git a/src/mesa/drivers/dri/i965/brw_wm.c > b/src/mesa/drivers/dri/i965/brw_wm.c > index

[Mesa-dev] [PATCH 00/11] Implement GL_ARB_vertex_attrib_binding

2013-10-28 Thread Fredrik Höglund
This extension decouples the vertex attributes from the vertex buffer bindings, making it possible to change buffers without having to respecify the formats. The mapping between attributes and vertex buffer bindings also becomes configurable. This series adds new state structs and changes the gl*

[Mesa-dev] [PATCH] i965/fs: Prefer more-critical instructions of the same age in LIFO scheduling.

2013-10-28 Thread Eric Anholt
When faced with a million instructions that all became candidates at the same time (none of which individually reduce register pressure), the ones on the critical path are more likely to be the ones that will free up some candidates soon. shader-db: total instructions in shared programs: 1681070 -

[Mesa-dev] [PATCH 06/11] mesa: Don't use derived vertex state in the FF vertex program

2013-10-28 Thread Fredrik Höglund
--- src/mesa/main/ffvertex_prog.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c index 08665c6..be6ac0f 100644 --- a/src/mesa/main/ffvertex_prog.c +++ b/src/mesa/main/ffvertex_prog.c @@ -228,7 +228,7 @@ static vo

Re: [Mesa-dev] [PATCH] i915: Fix logic_op check.

2013-10-28 Thread Ian Romanick
On 10/26/2013 12:36 AM, Vinson Lee wrote: > logic_op is of type GLenum (unsigned int). > > Fixes "Macro compares unsigned to 0" defect reported by Coverity. > > Signed-off-by: Vinson Lee > --- > src/mesa/drivers/dri/i915/intel_blit.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >

Re: [Mesa-dev] [PATCH V2 08/12] i965: Add FS backend for builtin gl_SampleID

2013-10-28 Thread Paul Berry
On 28 October 2013 16:26, Anuj Phogat wrote: > > > > On Mon, Oct 28, 2013 at 3:23 PM, Paul Berry wrote: > >> On 25 October 2013 16:45, Anuj Phogat wrote: >> >>> V2: >>>- Update comments >>>- Make changes to support simd16 mode. >>>- Add compute_sample_id variables in brw_wm_prog_key

Re: [Mesa-dev] [PATCH] android: add megadriver_stub

2013-10-28 Thread Emil Velikov
On 28/10/13 08:07, Adrian Negreanu wrote: > From: Adrian Negreanu > > Fixes linker error: > ld: .../libmesa_dri_common_intermediates/libmesa_dri_common.a(dri_util.o): > in function globalDriverAPI:dri_util.c(.data.rel+0x0): error: undefined > reference to 'driDriverAPI' > Hi Adrian, To be

Re: [Mesa-dev] [PATCH] Remove error when calling glGenQueries/glDeleteQueries while a query is active

2013-10-28 Thread Brian Paul
On 10/28/2013 12:02 PM, Carl Worth wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 There is nothing in the OpenGL specification which prevents the user from calling glGenQueries to generate a new query object while another object is active. Neither is there anything in the Mesa implementa

Re: [Mesa-dev] [PATCH 2/9] i965: Fix texture buffer rendering after a whole buffer replacement.

2013-10-28 Thread Eric Anholt
Carl Worth writes: > Eric Anholt writes: >> Fixes the new piglit GL_ARB_texture_buffer_object/data-sync >> >> Cc: "9.2" > > Hi Eric, > > I recently pushed this out to the 9.2 branch. But I also noticed that my > testing didn't include the new test mentioned above. > > Do you expect to be able t

Re: [Mesa-dev] [PATCH 3/3] i965/fs: Drop no-op shifts involving 0.

2013-10-28 Thread Eric Anholt
Matt Turner writes: > On Fri, Oct 25, 2013 at 2:49 PM, Eric Anholt wrote: >> I noticed this in a shader in Unigine Heaven that was spilling. While it >> doesn't really reduce register pressure, it shaves a few instructions >> anyway (7955 -> 7882). >> >> v2: Fix turning "0 >> x" into "x" instea

Re: [Mesa-dev] [PATCH v2 7/8] i965: Implement glDrawTransformFeedback().

2013-10-28 Thread Kenneth Graunke
On 10/28/2013 04:14 AM, Pohjolainen, Topi wrote: > On Fri, Oct 25, 2013 at 10:35:48PM -0700, Kenneth Graunke wrote: >> Implementing the GetTransformFeedbackVertexCount() driver hook allows >> the VBO module to call us with the right number of vertices. >> >> The hardware doesn't directly count the

[Mesa-dev] [PATCH 01/11] mesa: Restore gl_array_object::NewArray

2013-10-28 Thread Fredrik Höglund
This will be used by the ARB_vertex_attrib_binding implementation. This reverts commit db38e9a0e179441f59274f6f2a751912c29872e2. --- src/mesa/main/enable.c |2 ++ src/mesa/main/mtypes.h |3 +++ src/mesa/main/state.c |1 + src/mesa/main/varray.c |4 4 files changed, 10 inserti

Re: [Mesa-dev] [PATCH 2/5] i965: Explicitly maintain a count of SO_DECL structures emitted.

2013-10-28 Thread Kenneth Graunke
On 10/28/2013 10:53 AM, Ian Romanick wrote: > On 10/26/2013 01:33 PM, Kenneth Graunke wrote: >> Currently, we emit one SO_DECL structure per output, so we use the index >> in the Outputs[] array as the index into the so_decl[] array as well. >> >> In order to support the fake "gl_SkipComponents[123

Re: [Mesa-dev] [PATCH 4/4] i965/fs: Gen4-5: Implement alpha test in shader for MRT

2013-10-28 Thread Chris Forbes
On Tue, Oct 29, 2013 at 10:48 AM, Eric Anholt wrote: > Chris Forbes writes: > >> Signed-off-by: Chris Forbes > > This function should probably have a comment: > > /** > * Alpha test support for when we compile it into the shader instead > * of using the normal fixed function alpha test. > */

Re: [Mesa-dev] [PATCH 5/5] i965: Enable the ARB_transform_feedback_instanced extension on Gen7+.

2013-10-28 Thread Kenneth Graunke
On 10/28/2013 10:57 AM, Ian Romanick wrote: > On 10/26/2013 01:33 PM, Kenneth Graunke wrote: >> This depends on ARB_transform_feedback2, so I've predicated it on the >> ability to do register writes. >> >> It also depends on ARB_transform_feedback3, which is the only reason we >> couldn't expose it

Re: [Mesa-dev] [PATCH v2 9/8+1] i965: Enable ARB_transform_feedback2 on Gen7+ if register writes work.

2013-10-28 Thread Kenneth Graunke
On 10/28/2013 03:08 PM, Eric Anholt wrote: > Kenneth Graunke writes: > >> With Linux 3.12, register writes work on Ivybridge and Baytrail, but not >> Haswell. That will be fixed in a future kernel revision, at which point >> this extension will automatically be enabled. >> >> Signed-off-by: Kenn

[Mesa-dev] [PATCH v2] glsl: Add a CSE pass.

2013-10-28 Thread Eric Anholt
This only operates on constant/uniform values for now, because otherwise I'd have to deal with killing my available CSE entries when assignments happen, and getting even this working in the tree ir was painful enough. As is, it has the following effect in shader-db: total instructions in shared p

[Mesa-dev] [PATCH 00/15] i965/fs Optimizations

2013-10-28 Thread Matt Turner
The first six patches have been on the list previously, but it got confusing when they changed order and some were dropped. The last nine patches implement a new SEL-generating peephole, a dead flow control elimination pass, and some silly algebraic optimizations that surprisingly are seen in real

[Mesa-dev] [PATCH 15/15] i965/fs: Optimize saturating SEL.G(E) with imm val <= 0.0f.

2013-10-28 Thread Matt Turner
Only one program's instruction count is changed, but a shader in Tropics is also affected. instructions in affected programs: 162 -> 159 (-1.85%) --- src/mesa/drivers/dri/i965/brw_fs.cpp | 14 ++ 1 file changed, 14 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp

[Mesa-dev] [PATCH 14/15] i965/fs: Optimize saturating SEL.L(E) with imm val >= 1.0.

2013-10-28 Thread Matt Turner
total instructions in shared programs: 1287130 -> 1285860 (-0.10%) instructions in affected programs: 93529 -> 92259 (-1.36%) --- src/mesa/drivers/dri/i965/brw_fs.cpp | 22 ++ 1 file changed, 22 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/dr

[Mesa-dev] [PATCH 13/15] i965/fs: Optimize OR with identical sources into a MOV.

2013-10-28 Thread Matt Turner
Helps a lot of Steam games. total instructions in shared programs: 1287432 -> 1287130 (-0.02%) instructions in affected programs: 21447 -> 21145 (-1.41%) --- src/mesa/drivers/dri/i965/brw_fs.cpp | 8 1 file changed, 8 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp

[Mesa-dev] [PATCH 11/15] i965/fs: If emit a MOV instead of a SEL if the sources are the same.

2013-10-28 Thread Matt Turner
total instructions in shared programs: 1287488 -> 1287457 (-0.00%) instructions in affected programs: 1745 -> 1714 (-1.78%) --- src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp | 38 +-- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/src/mesa/drivers/dri/i

[Mesa-dev] [PATCH 12/15] i965/fs: Extend SEL peephole to search from the IF down.

2013-10-28 Thread Matt Turner
The pass previously searched only backward from an ENDIF (and ELSE) to find MOVs with the same destination. This commit extends the pass to also search forward from the IF (and ELSE) to find matching MOVs which it can replace with SEL instructions before the IF. E.g., the pass can now optimize

[Mesa-dev] [PATCH 10/15] i965/fs: Add a pass to remove dead control flow.

2013-10-28 Thread Matt Turner
Removes if/endif and if/else/endif. total instructions in shared programs: 1293990 -> 1288172 (-0.45%) instructions in affected programs: 95390 -> 89572 (-6.10%) --- src/mesa/drivers/dri/i965/Makefile.sources | 1 + src/mesa/drivers/dri/i965/brw_fs.cpp | 1 + src/mesa/

[Mesa-dev] [PATCH 09/15] i965/fs: New peephole optimization to generate SEL.

2013-10-28 Thread Matt Turner
fs_visitor::try_replace_with_sel optimizes only if statements whose "then" and "else" bodies contain a single MOV instruction. It also did could not handle constant arguments, since they cause an extra MOV immediate to be generated (since we haven't run constant propagation, there are more than the

[Mesa-dev] [PATCH 08/15] i965/fs: Add fs_inst copy constructor.

2013-10-28 Thread Matt Turner
--- src/mesa/drivers/dri/i965/brw_fs.cpp | 30 ++ src/mesa/drivers/dri/i965/brw_fs.h | 1 + 2 files changed, 31 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index b2eac6c..28d369a 100644 --- a/src/mesa/drive

[Mesa-dev] [PATCH 07/15] i965/fs: Add SEL() convenience function.

2013-10-28 Thread Matt Turner
--- src/mesa/drivers/dri/i965/brw_fs.cpp | 1 + src/mesa/drivers/dri/i965/brw_fs.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index b985251..b2eac6c 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src

[Mesa-dev] [PATCH 06/15] i965/fs: Perform CSE on CMP(N) instructions.

2013-10-28 Thread Matt Turner
Optimizes cmp.ge.f0(8) null g45<8,8,1>F 0F (+f0) sel(8)g50<1>F g40<8,8,1>F g10<8,8,1>F cmp.ge.f0(8) null g45<8,8,1>F 0F (+f0) sel(8)g51<1>F g41<8,8,1>F g11<8,8,1>F cmp.ge.f0(8) null g45<8,8,1>F 0F (+f0) sel(8)g52<1>F g42<8,8,1>F g12

[Mesa-dev] [PATCH 05/15] i965/fs: Don't dead code eliminate CMP(N).

2013-10-28 Thread Matt Turner
Since compare instructions write the flag register, they should not be considered dead even if their destination is never read. Instead of removing them if found to be dead, set their destination to null to free a register. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 6 -- 1 file changed, 4 ins

[Mesa-dev] [PATCH 04/15] i965/fs: Don't emit null MOVs in CSE.

2013-10-28 Thread Matt Turner
We'd like to CSE some instructions, like CMP, that often have null destinations. Instead of replacing them with MOVs to null, just don't emit the MOV. --- src/mesa/drivers/dri/i965/brw_fs_cse.cpp | 42 +++- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a

[Mesa-dev] [PATCH 03/15] i965/fs: Use reads_flag and writes_flag methods in the scheduler.

2013-10-28 Thread Matt Turner
--- src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp | 16 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp b/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp index 84b74ff..9cc752e 100644 --- a/s

[Mesa-dev] [PATCH 02/15] i965/fs: Add reads_flag() and writes_flag() to fs_inst.

2013-10-28 Thread Matt Turner
--- src/mesa/drivers/dri/i965/brw_fs.cpp | 13 + src/mesa/drivers/dri/i965/brw_fs.h | 3 +++ 2 files changed, 16 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index be301e2..7e7ced0 100644 --- a/src/mesa/drivers/dri/i965/brw

[Mesa-dev] [PATCH 01/15] i965/fs: Add is_null() method to fs_reg.

2013-10-28 Thread Matt Turner
--- src/mesa/drivers/dri/i965/brw_fs.cpp | 8 src/mesa/drivers/dri/i965/brw_fs.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index a3268fb..be301e2 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp ++

Re: [Mesa-dev] [PATCH] Remove error when calling glGenQueries/glDeleteQueries while a query is active

2013-10-28 Thread Carl Worth
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 There is nothing in the OpenGL specification which prevents the user from calling glGenQueries to generate a new query object while another object is active. Neither is there anything in the Mesa implementation which prevents this. So remove the INVA

Re: [Mesa-dev] [PATCH 4/5] i965: Enable the ARB_transform_feedback3 extension on Gen7+.

2013-10-28 Thread Ian Romanick
On 10/28/2013 10:57 AM, Kenneth Graunke wrote: > On 10/28/2013 10:50 AM, Ian Romanick wrote: >> On 10/26/2013 01:33 PM, Kenneth Graunke wrote: >>> This extension is written a bit strangely. Although it introduces the >>> concept of multiple transform feedback streams, it doesn't actually >>> provi

Re: [Mesa-dev] [PATCH 5/5] i965: Enable the ARB_transform_feedback_instanced extension on Gen7+.

2013-10-28 Thread Ian Romanick
On 10/26/2013 01:33 PM, Kenneth Graunke wrote: > This depends on ARB_transform_feedback2, so I've predicated it on the > ability to do register writes. > > It also depends on ARB_transform_feedback3, which is the only reason we > couldn't expose it previously. Dare I even ask if we have tests? >

Re: [Mesa-dev] [PATCH 4/5] i965: Enable the ARB_transform_feedback3 extension on Gen7+.

2013-10-28 Thread Kenneth Graunke
On 10/28/2013 10:50 AM, Ian Romanick wrote: > On 10/26/2013 01:33 PM, Kenneth Graunke wrote: >> This extension is written a bit strangely. Although it introduces the >> concept of multiple transform feedback streams, it doesn't actually >> provide more than a single stream. >> >> The ARB_gpu_shade

Re: [Mesa-dev] [PATCH V2 02/12] mesa: Add new functions and enums required by GL_ARB_sample_shading

2013-10-28 Thread Anuj Phogat
On Mon, Oct 28, 2013 at 10:29 AM, Ian Romanick wrote: > On 10/25/2013 04:44 PM, Anuj Phogat wrote: >> New functions added by GL_ARB_sample_shading: >> glMinSampleShadingARB() >> >> New enums: >> GL_SAMPLE_SHADING_ARB >> GL_MIN_SAMPLE_SHADING_VALUE_ARB >> >> V2: Update comments. >> Create new G

Re: [Mesa-dev] [PATCH 2/5] i965: Explicitly maintain a count of SO_DECL structures emitted.

2013-10-28 Thread Ian Romanick
On 10/26/2013 01:33 PM, Kenneth Graunke wrote: > Currently, we emit one SO_DECL structure per output, so we use the index > in the Outputs[] array as the index into the so_decl[] array as well. > > In order to support the fake "gl_SkipComponents[1234]" varyings from > ARB_transform_feedback3, we'l

Re: [Mesa-dev] [PATCH 1/5] i965: Create a temporary for transform feedback output components.

2013-10-28 Thread Ian Romanick
On 10/26/2013 01:33 PM, Kenneth Graunke wrote: > This is a bit shorter. > > Signed-off-by: Kenneth Graunke With the one change suggested below, Reviewed-by: Ian Romanick > --- > src/mesa/drivers/dri/i965/gen7_sol_state.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > di

Re: [Mesa-dev] [PATCH 3/5] i965: Add support for gl_SkipComponents[1234].

2013-10-28 Thread Ian Romanick
On 10/26/2013 01:33 PM, Kenneth Graunke wrote: > ARB_transform_feedback3 allows applications to insert blank space > between interleaved varyings by adding fake 1, 2, 3, or 4-component > varyings named gl_SkipComponents[1234]. > > Mesa's core data structures don't explicitly track these, instead s

Re: [Mesa-dev] [PATCH 4/5] i965: Enable the ARB_transform_feedback3 extension on Gen7+.

2013-10-28 Thread Ian Romanick
On 10/26/2013 01:33 PM, Kenneth Graunke wrote: > This extension is written a bit strangely. Although it introduces the > concept of multiple transform feedback streams, it doesn't actually > provide more than a single stream. > > The ARB_gpu_shader5 extension is what introduces the ability to wri

Re: [Mesa-dev] Possible Sandybridge GPU hang fixes

2013-10-28 Thread Kenneth Graunke
On 10/27/2013 07:24 AM, Daniel Vetter wrote: > On Sat, Oct 26, 2013 at 01:07:48PM -0700, Kenneth Graunke wrote: >> These patches add some missing flushing, which appears to help. I'm >> still getting GPU hangs, but they're much less frequent, and now have >> an IPEHR of MI_SEMAPHORE_MBOX. I suspe

Re: [Mesa-dev] [PATCH V2 05/12] glsl: Add new builtins required by GL_ARB_sample_shading

2013-10-28 Thread Ian Romanick
On 10/25/2013 04:45 PM, Anuj Phogat wrote: > New builtins added by GL_ARB_sample_shading: > in vec2 gl_SamplePosition > in int gl_SampleID > in int gl_NumSamples > out int gl_SampleMask[] > > V2: - Use SWIZZLE_ for STATE_NUM_SAMPLES. > - Use "result.samplemask" in arb_output_attrib_string.

Re: [Mesa-dev] [PATCH 04/12] mesa: Add a helper function _mesa_get_min_invocations_per_fragment()

2013-10-28 Thread Ian Romanick
On 10/25/2013 04:45 PM, Anuj Phogat wrote: > Thsi function is used to test if we need to do per sample shading or > per fragment shading. > > Signed-off-by: Anuj Phogat With the one change mentioned below, this patch is Reviewed-by: Ian Romanick > --- > src/mesa/program/program.c | 31 ++

Re: [Mesa-dev] [PATCH V2 02/12] mesa: Add new functions and enums required by GL_ARB_sample_shading

2013-10-28 Thread Ian Romanick
On 10/25/2013 04:44 PM, Anuj Phogat wrote: > New functions added by GL_ARB_sample_shading: > glMinSampleShadingARB() > > New enums: > GL_SAMPLE_SHADING_ARB > GL_MIN_SAMPLE_SHADING_VALUE_ARB > > V2: Update comments. > Create new GL4x.xml. > Remove redundant code in get.c. > Update the

Re: [Mesa-dev] [PATCH] i965: Do not set bilinear_filter flag in case of multisample blits

2013-10-28 Thread Carl Worth
Anuj Phogat writes: > Setting bilinear_filter flag in case of multisample blits with > GL_LINEAR filter causes incorrect behavior in translate_dst_to_src() > function. This broke Modern Warfare (1, 2 and 3) on SNB, IVB and HSW. ... > Cc: mesa-sta...@lists.freedesktop.org Hi Anuj, From my reading

Re: [Mesa-dev] [PATCH] radeon/llvm: Specify the DataLayout when running optimizations

2013-10-28 Thread Aaron Watry
I just ran a quick.tests run on evergreen without any regressions. Patch looks good to me, and doesn't seem to cause any regressions on the hardware I have available to test with. --Aaron On Tue, Oct 22, 2013 at 11:28 AM, Tom Stellard wrote: > From: Tom Stellard > > Without DataLayout, a lot o

Re: [Mesa-dev] [PATCH 2/9] i965: Fix texture buffer rendering after a whole buffer replacement.

2013-10-28 Thread Carl Worth
Eric Anholt writes: > Fixes the new piglit GL_ARB_texture_buffer_object/data-sync > > Cc: "9.2" Hi Eric, I recently pushed this out to the 9.2 branch. But I also noticed that my testing didn't include the new test mentioned above. Do you expect to be able to push the new test to piglit soon? I

Re: [Mesa-dev] [PATCH] i965: Do not set bilinear_filter flag in case of multisample blits

2013-10-28 Thread Anuj Phogat
On Sun, Oct 27, 2013 at 7:42 AM, Paul Berry wrote: > On 18 October 2013 17:24, Anuj Phogat wrote: >> >> Setting bilinear_filter flag in case of multisample blits with >> GL_LINEAR filter causes incorrect behavior in translate_dst_to_src() >> function. This broke Modern Warfare (1, 2 and 3) on SNB

Re: [Mesa-dev] [Mesa-stable] [PATCH] radeonsi: fix blitting the last 2 mipmap levels of compressed textures

2013-10-28 Thread Carl Worth
Carl Worth writes: > If someone could rebase this against 9.2 and email the result to > mesa-stable, I would be more than happy to merge it. Last ping from me on this one. If a new patch appears in the next day or two, this could get in to 9.2.3 Otherwise, not having heard anything, I'll be drop

Re: [Mesa-dev] [PATCH 1/3] gallium/auxiliary/indices: add start param

2013-10-28 Thread Brian Paul
On 10/25/2013 01:53 PM, Rob Clark wrote: From: Rob Clark Add 'start' parameter to generator/translator. Signed-off-by: Rob Clark --- src/gallium/auxiliary/indices/u_indices.c | 6 -- src/gallium/auxiliary/indices/u_indices.h | 4 +++- src/gallium/auxiliary/indices/

Re: [Mesa-dev] [PATCH 2/3] gallium/auxiliary/indices: add u_primconvert

2013-10-28 Thread Brian Paul
Just a bunch of minor nits... On 10/25/2013 01:53 PM, Rob Clark wrote: From: Rob Clark A convenient front end to indices generate/translate code, for emulating primitives which are not supported natively by the driver. This handles saving/restoring index buffer state, etc. Signed-off-by: Rob

Re: [Mesa-dev] [PATCH] llvmpipe: fix bogus layer clamping in setup

2013-10-28 Thread Jose Fonseca
- Original Message - > From: Roland Scheidegger > > The layer coming from GS needs to be clamped (not sure if that's actually > the correct error behavior but we need something) as the number can be higher > than the amount of layers in the fb. However, this code was using the layer > c

Re: [Mesa-dev] [PATCH] mesa/texparam: Remove trailing whitespaces.

2013-10-28 Thread Brian Paul
On 10/27/2013 08:02 AM, Rico Schüller wrote: Signed-off-by: Rico Schüller --- src/mesa/main/texparam.c | 12 ++-- 1 Datei geändert, 6 Zeilen hinzugefügt(+), 6 Zeilen entfernt(-) Pushed. Thanks. -Brian ___ mesa-dev mailing list mesa-dev@l

[Mesa-dev] [Bug 70932] Account request with git commit access to mesa

2013-10-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=70932 Brian Paul changed: What|Removed |Added Assignee|mesa-dev@lists.freedesktop. |sitewranglers@lists.freedes

Re: [Mesa-dev] [PATCH] radeon/llvm: Specify the DataLayout when running optimizations

2013-10-28 Thread Aaron Watry
I ran this through a piglit CL test run on my 7850, no test fixes or regressions. --Aaron On Tue, Oct 22, 2013 at 11:28 AM, Tom Stellard wrote: > From: Tom Stellard > > Without DataLayout, a lot of optimization passes aren't run and the ones > that are don't work as well. > --- > src/gallium/d

Re: [Mesa-dev] [PATCH V2 2/2] glsl: Add check for unsized arrays to glsl types

2013-10-28 Thread Paul Berry
On 23 October 2013 03:31, Timothy Arceri wrote: > The main purpose of this patch is to increase readability of > the array code by introducing is_unsized_array() to glsl_types. > Some redundent is_array() checks are also removed, and small number > of other related clean ups. > > The introduction

Re: [Mesa-dev] [PATCH] r600g/sb: fix value::is_fixed()

2013-10-28 Thread Andreas Boll
Tested-by: Andreas Boll The test passes now, no piglit regressions on rv770 Thanks, Andreas. 2013/10/27 Vadim Girlin : > --- > cc: Andreas Boll > > Andreas, this patch should fix the issue with SB on RV770 that you > reported on IRC (assert with interpolation-mixed.shader_test). > > There are

Re: [Mesa-dev] [PATCH v2 7/8] i965: Implement glDrawTransformFeedback().

2013-10-28 Thread Pohjolainen, Topi
On Mon, Oct 28, 2013 at 01:14:55PM +0200, Pohjolainen, Topi wrote: > On Fri, Oct 25, 2013 at 10:35:48PM -0700, Kenneth Graunke wrote: > > Implementing the GetTransformFeedbackVertexCount() driver hook allows > > the VBO module to call us with the right number of vertices. > > > > The hardware does

Re: [Mesa-dev] [PATCH v2 7/8] i965: Implement glDrawTransformFeedback().

2013-10-28 Thread Pohjolainen, Topi
On Fri, Oct 25, 2013 at 10:35:48PM -0700, Kenneth Graunke wrote: > Implementing the GetTransformFeedbackVertexCount() driver hook allows > the VBO module to call us with the right number of vertices. > > The hardware doesn't directly count the number of vertices written by > SOL, so we instead use

Re: [Mesa-dev] [PATCH 0/4] GL_OES_get_program_binary extension

2013-10-28 Thread Tapani
On 10/26/2013 07:42 AM, Matt Turner wrote: On Thu, Oct 24, 2013 at 1:28 AM, Tapani Pälli wrote: Hello; These patches introduce GL_OES_get_program_binary extension support for Mesa. There are already stub functions for this extension, patches add the missing functionality part. This is based on

[Mesa-dev] [PATCH] android: add megadriver_stub

2013-10-28 Thread Adrian Negreanu
From: Adrian Negreanu Fixes linker error: ld: .../libmesa_dri_common_intermediates/libmesa_dri_common.a(dri_util.o): in function globalDriverAPI:dri_util.c(.data.rel+0x0): error: undefined reference to 'driDriverAPI' Signed-off-by: Adrian Negreanu --- src/mesa/drivers/dri/Android.mk

  1   2   >