[Mesa-dev] [PATCH 2/5] i965: Convert loop to memcpy in brw_vec4_upload_binding_table().

2013-09-17 Thread Kenneth Graunke
This is probably more efficient. At any rate, it's less code. Signed-off-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/brw_vs_surface_state.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c b/src/mesa/driv

[Mesa-dev] [PATCH 1/5] i965: Update comments in brw_vec4_upload_binding_table().

2013-09-17 Thread Kenneth Graunke
The first comment was a bit stale; there are more kinds of surfaces than textures and pull constants. The second was a leftover "to do" comment for something I already did. Signed-off-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/brw_vs_surface_state.c | 7 +-- 1 file changed, 1 inserti

[Mesa-dev] [PATCH 4/5] i965: Use brw_upload_binding_table() for the pixel shader as well.

2013-09-17 Thread Kenneth Graunke
This is not quite the same: brw_upload_binding_table() also has code to early-return if there are no entries, while the existing code did not. The PS binding table is unlikely to be empty since it will have at least one color buffer. If it ever is empty, early returning seems wise. Signed-off-by

[Mesa-dev] [PATCH 3/5] i965: Generalize brw_vec4_upload_binding_table() beyond vec4 stages.

2013-09-17 Thread Kenneth Graunke
Instead of passing in a brw_vec4_prog_data structure, we can simply pass the one field it needs: the number of entries in the binding table. We also need to pass in the shader time surface index rather than hardcoding SURF_INDEX_VEC4_SHADER_TIME. Since the resulting function is stage-agnostic, th

[Mesa-dev] [PATCH 5/5] i965: Move binding table code to a new file, brw_binding_tables.c.

2013-09-17 Thread Kenneth Graunke
The code to upload the binding tables for each stage was scattered across brw_{vs,gs,wm}_surface_state.c and brw_misc_state.c, which also contain a lot of code to populate individual SURFACE_STATE structures. This patch brings all the binding table upload code together, and splits it out from the

Re: [Mesa-dev] [PATCH] egl: add EGL_WAYLAND_Y_INVERTED_WL attribute

2013-09-17 Thread Kristian Høgsberg
On Mon, Sep 16, 2013 at 01:02:46PM +0400, Stanislav Vorobiov wrote: > This enables querying of wl_buffer's orientation Thanks, committed. I followed up with a commit to also add EGL_TEXTURE_FORMAT to the new table of valid eglQueryWaylandBufferWL attributes. Kristian > --- > docs/specs/WL_bind

[Mesa-dev] [PATCH] i965: Fix brw_vs_prog_data_compare to actually check field members.

2013-09-17 Thread Kenneth Graunke
&a and &b are the address of the local stack variables, not the actual structures. Instead of comparing the fields of a and b, we compared ...some stack memory. Caught by Valgrind on Piglit's glsl-lod-bias test (among many others). Signed-off-by: Kenneth Graunke Cc: mesa-sta...@lists.freedeskto

[Mesa-dev] [PATCH] i965: Fix brw_gs_prog_data_compare to actually check field members.

2013-09-17 Thread Kenneth Graunke
&a and &b are the address of the local stack variables, not the actual structures. Instead of comparing the fields of a and b, we compared ...some stack memory. Not a candidate for stable since GS code doesn't exist in 9.2. Signed-off-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/brw_vec4_

[Mesa-dev] [PATCH] glsl: Delete builtin_builder::shader when destroying built-ins.

2013-09-17 Thread Kenneth Graunke
I would use _mesa_delete_shader, but it's declared static, and we don't really need any of the stuff in it anyway. This fixes a memory leak caught by Valgrind. Signed-off-by: Kenneth Graunke --- src/glsl/builtin_functions.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/glsl/built

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

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

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

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

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

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

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

2013-09-17 Thread Paul Berry
On 15 September 2013 00:10, Francisco Jerez wrote: > Ditto. Otherwise some of its member variables are going to have > uninitialized contents in cases where its memory is not allocated > using rzalloc(). > Nit pick: "ditto" implicitly refers to the commit message in patch 2. I'd prefer to see

Re: [Mesa-dev] [PATCH 1/5] i965: Update comments in brw_vec4_upload_binding_table().

2013-09-17 Thread Eric Anholt
Kenneth Graunke writes: > The first comment was a bit stale; there are more kinds of surfaces than > textures and pull constants. > > The second was a leftover "to do" comment for something I already did. This series is: Reviewed-by: Eric Anholt pgpv63Ha31zdu.pgp Description: PGP signature _

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

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

Re: [Mesa-dev] [PATCH] gallivm: some bits of seamless cube filtering implementation

2013-09-17 Thread Jose Fonseca
LGTM. Jose - Original Message - > From: Roland Scheidegger > > Simply adjust wrap mode to clamp_to_edge. This is all that's needed for a > correct implementation for nearest filtering, and it's way better than > using repeat wrap for instance for linear filtering (though obviously this

Re: [Mesa-dev] [PATCH] i965: Fix brw_gs_prog_data_compare to actually check field members.

2013-09-17 Thread Chad Versace
Whoops... Series is Reviewed-by: Chad Versace ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH 3/3] util/u_blit: Implement util_blit_pixels via pipe_context::blit.

2013-09-17 Thread jfonseca
From: José Fonseca This removes a lot of code, but not everything, as util_blit_pixels_tex is still useful when one needs to override pipe_sampler_view::swizzle_?. --- src/gallium/auxiliary/util/u_blit.c | 447 +++- 1 file changed, 37 insertions(+), 410 deletions(

[Mesa-dev] [PATCH 2/3] util/u_blit: Support blits from cubemaps.

2013-09-17 Thread jfonseca
From: José Fonseca By calling util_map_texcoords2d_onto_cubemap. A new parameter for util_blit_pixels_tex is necessary, as pipe_sampler_view::first_layer is always supposed to point to the first face when sampling from cubemaps. --- src/gallium/auxiliary/util/u_blit.c | 34 +

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

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

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

2013-09-17 Thread Kenneth Graunke
On 09/16/2013 05:16 PM, Paul Berry wrote: > On 13 September 2013 23:10, Kenneth Graunke > wrote: > > Specifying a miptree layout makes no sense for constant buffers. > > > You might want to mention in the commit message that there's no > functional change since

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

2013-09-17 Thread Kenneth Graunke
On 09/16/2013 02:55 PM, Paul Berry wrote: > On 13 September 2013 23:10, Kenneth Graunke > wrote: > > This was an embarassingly large amount of copy and pasted code, > and it wasn't particularly simple code either. By factoring it out > into a helper func

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

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

[Mesa-dev] [PATCH 1/3] vega: Use pipe_context::blit instead of util_blit_pixels_tex.

2013-09-17 Thread jfonseca
From: José Fonseca Only compile-tested but it seems straightforward. --- src/gallium/state_trackers/vega/vg_context.c | 44 src/gallium/state_trackers/vega/vg_context.h | 2 -- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/src/gallium/state_tracke

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

2013-09-17 Thread Francisco Jerez
Francisco Jerez writes: > This patch series implements support for the > ARB_shader_atomic_counters extension, which is part of GL core since > GL 4.2. It includes patches adding support for the new APIs and GLSL > language features, and working back-end code for Intel Gen7 hardware > -- Ivy Bri

[Mesa-dev] [PATCH] winsys/sw/xlib: fix compile error in xlib_sw_winsys.c.

2013-09-17 Thread Gaetan Nadon
xlib_sw_winsys.h:5:22: fatal error: X11/Xlib.h: No such file or directory The compiler cannot find the Xlib.h in the installed system headers. All supplied include directives point to inside the mesa module. The X11_CFLAGS variable is undefined (not defined in config.status). It appears the inten

[Mesa-dev] [PATCH] i965: Fix writemask != 0 assertions on Sandybridge.

2013-09-17 Thread Kenneth Graunke
This fixes myriads of regressions since commit 169f9c030c16d1247a3a7629 ("i965: Add an assertion that writemask != NULL for non-ARFs."). On Sandybridge, our control flow handling (such as brw_IF) does: brw_set_dest(p, insn, brw_imm_w(0)); insn->bits1.branch_gen6.jump_count = 0; This result

[Mesa-dev] [PATCH] glx: fix compile error in egl_glx.c.

2013-09-17 Thread Gaetan Nadon
egl_glx.c:40:22: fatal error: X11/Xlib.h: No such file or directory The compiler cannot find the Xlib.h in the installed system headers. All supplied include directives point to inside the mesa module. The X11_CFLAGS variable is undefined (not defined in config.status). It appears the intent was

[Mesa-dev] [PATCH 2/3] i965: Refactor Gen7+ SURFACE_STATE setup for buffer surfaces.

2013-09-17 Thread Kenneth Graunke
This was an embarassingly large amount of copy and pasted code, and it wasn't particularly simple code either. By factoring it out into a helper function, we consolidate the complexity. v2: Properly NULL-check bo. Caught by Eric Anholt. v3: Do the subtraction by 1 in gen7_emit_buffer_surface_sta

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

2013-09-17 Thread Kenneth Graunke
This was an embarassingly large amount of copy and pasted code, and it wasn't particularly simple code either. By factoring it out into a helper function, we consolidate the complexity. v2: Properly NULL-check bo. Caught by Eric Anholt. v3: Do the subtraction by 1 in gen7_emit_buffer_surface_sta

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

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

[Mesa-dev] [PATCH 1/3] i965: Fix off by one errors in texture buffer size calculations.

2013-09-17 Thread Kenneth Graunke
The value that's split into width/height/depth needs to be the size of the buffer minus one. This makes it consistent with the constant buffer and shader time SURFACE_STATE setup code. Signed-off-by: Kenneth Graunke Cc: Paul Berry Cc: Eric Anholt --- src/mesa/drivers/dri/i965/brw_wm_surface_s

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

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

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

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

Re: [Mesa-dev] [PATCH 0/6] Support for 10 bpc EGLSurface

2013-09-17 Thread Chad Versace
On 09/15/2013 12:16 AM, Kristian Høgsberg wrote: Hi, This little series adds support for creating EGLSurfaces with color buffers using the ARGB2101010 pixel format. We the new KMS addFB2 ioctl we can create KMS framebuffers with that format and this series ends up adding the pixel format to gbm

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

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

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

2013-09-17 Thread Paul Berry
On 15 September 2013 00:10, Francisco Jerez wrote: > This patch series implements support for the > ARB_shader_atomic_counters extension, which is part of GL core since > GL 4.2. It includes patches adding support for the new APIs and GLSL > language features, and working back-end code for Intel

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

2013-09-17 Thread Chad Versace
Patches 1-3 are Reviewed-by: Chad Versace ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev

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

2013-09-17 Thread Mark Mueller
On Mon, Sep 16, 2013 at 1:31 AM, Chia-I Wu wrote: > On Mon, Sep 16, 2013 at 4:12 PM, Chia-I Wu wrote: > > On Mon, Sep 16, 2013 at 3:50 AM, Mark Mueller > wrote: > >> > >> > >> > >> On Fri, Sep 13, 2013 at 2:15 PM, Paul Berry > wrote: > >>> > >>> On 12 September 2013 22:06, Chia-I Wu wrote: >

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

2013-09-17 Thread Chad Versace
I like this patch. It removes a lot of boilerplate. And, it makes object destruction easier to reason about, making it easier to reason about tricky destruction bugs. On 09/17/2013 11:59 AM, Paul Berry wrote: On 15 September 2013 00:10, Francisco Jerez wrote: This patch introduces a pair of h

Re: [Mesa-dev] [PATCH] i965: Fix writemask != 0 assertions on Sandybridge.

2013-09-17 Thread Eric Anholt
Kenneth Graunke writes: > This fixes myriads of regressions since commit 169f9c030c16d1247a3a7629 > ("i965: Add an assertion that writemask != NULL for non-ARFs."). > > On Sandybridge, our control flow handling (such as brw_IF) does: > >brw_set_dest(p, insn, brw_imm_w(0)); >insn->bits1.br

Re: [Mesa-dev] [PATCH 1/3] vega: Use pipe_context::blit instead of util_blit_pixels_tex.

2013-09-17 Thread Marek Olšák
On Tue, Sep 17, 2013 at 8:32 PM, wrote: > From: José Fonseca > > Only compile-tested but it seems straightforward. > --- > src/gallium/state_trackers/vega/vg_context.c | 44 > > src/gallium/state_trackers/vega/vg_context.h | 2 -- > 2 files changed, 26 insertions(

Re: [Mesa-dev] [PATCH 1/3] i965: Fix off by one errors in texture buffer size calculations.

2013-09-17 Thread Eric Anholt
Kenneth Graunke writes: > The value that's split into width/height/depth needs to be the size of > the buffer minus one. This makes it consistent with the constant buffer > and shader time SURFACE_STATE setup code. > > Signed-off-by: Kenneth Graunke > Cc: Paul Berry > Cc: Eric Anholt > --- >

Re: [Mesa-dev] [PATCH 3/3] util/u_blit: Implement util_blit_pixels via pipe_context::blit.

2013-09-17 Thread Marek Olšák
Isn't u_blit a candidate for removal considering it has no user in Mesa? In any case, for the series: Reviewed-by: Marek Olšák Marek On Tue, Sep 17, 2013 at 8:33 PM, wrote: > From: José Fonseca > > This removes a lot of code, but not everything, as util_blit_pixels_tex > is still useful whe

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

2013-09-17 Thread Ian Romanick
On 09/16/2013 04:20 PM, Paul Berry wrote: > On 13 September 2013 11:25, Kenneth Graunke > wrote: > > We now set the ARB_shader_bit_encoding flag for versions that support > this functionality, so we don't need to double check it here. > > Signed-off-by:

Re: [Mesa-dev] [PATCH 0/6] Support for 10 bpc EGLSurface

2013-09-17 Thread Kristian Høgsberg
On Tue, Sep 17, 2013 at 1:49 PM, Chad Versace wrote: > On 09/15/2013 12:16 AM, Kristian Høgsberg wrote: >> >> Hi, >> >> This little series adds support for creating EGLSurfaces with color >> buffers >> using the ARGB2101010 pixel format. We the new KMS addFB2 ioctl we can >> create KMS framebuffe

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

2013-09-17 Thread Francisco Jerez
Paul Berry writes: > On 15 September 2013 00:10, Francisco Jerez wrote: >[...] >> + } else if ((op[0]->type->atomic_size() || >> op[1]->type->atomic_size())) { >> +_mesa_glsl_error(&loc, state, "atomic counter comparisons >> forbidden"); >> +error_emitted = true; >> > > Do w

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

2013-09-17 Thread Francisco Jerez
Paul Berry writes: > On 15 September 2013 00:10, Francisco Jerez wrote: >[...] >> @@ -70,12 +65,7 @@ class cfg_t { >> public: >> static void* operator new(size_t size, void *ctx) >> { >> - void *node; >> - >> - node = rzalloc_size(ctx, size); >> - assert(node != NULL); >>

Re: [Mesa-dev] [PATCH 0/6] Support for 10 bpc EGLSurface

2013-09-17 Thread Chad Versace
On 09/17/2013 04:20 PM, Kristian Høgsberg wrote: On Tue, Sep 17, 2013 at 1:49 PM, Chad Versace wrote: On 09/15/2013 12:16 AM, Kristian Høgsberg wrote: Hi, This little series adds support for creating EGLSurfaces with color buffers using the ARGB2101010 pixel format. We the new KMS addFB2 io

[Mesa-dev] Gallium debugging help

2013-09-17 Thread James Simmons
Hello. I'm the main developer from the Openchrome project and we have reached the point were work is being started for the Gallium driver for VIA hardware. To help develope a stable simple start I decided to go for bare bones libgbm support using a gallium backend. So like any start my

Re: [Mesa-dev] [PATCH 3/3] util/u_blit: Implement util_blit_pixels via pipe_context::blit.

2013-09-17 Thread Zack Rusin
The entire series looks good to me. Reviewed-by: Zack Rusin - Original Message - > From: José Fonseca > > This removes a lot of code, but not everything, as util_blit_pixels_tex > is still useful when one needs to override pipe_sampler_view::swizzle_?. > --- > src/gallium/auxiliary/ut

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

2013-09-17 Thread Kenneth Graunke
On 09/16/2013 02:20 PM, Paul Berry wrote: > On 13 September 2013 11:25, Kenneth Graunke > wrote: > > We now set the ARB_shader_bit_encoding flag for versions that support > this functionality, so we don't need to double check it here. > > Signed-off-by:

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

2013-09-17 Thread Chia-I Wu
On Wed, Sep 18, 2013 at 6:27 AM, Mark Mueller wrote: > On Mon, Sep 16, 2013 at 1:31 AM, Chia-I Wu wrote: >> >> On Mon, Sep 16, 2013 at 4:12 PM, Chia-I Wu wrote: >> > On Mon, Sep 16, 2013 at 3:50 AM, Mark Mueller >> > wrote: >> >> >> >> >> >> >> >> On Fri, Sep 13, 2013 at 2:15 PM, Paul Berry >>

Re: [Mesa-dev] [PATCH 2/3] util/u_blit: Support blits from cubemaps.

2013-09-17 Thread Roland Scheidegger
Am 17.09.2013 20:32, schrieb jfons...@vmware.com: > From: José Fonseca > > By calling util_map_texcoords2d_onto_cubemap. > > A new parameter for util_blit_pixels_tex is necessary, as > pipe_sampler_view::first_layer is always supposed to point to the first > face when sampling from cubemaps. > -

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

2013-09-17 Thread Chia-I Wu
Hi Paul, On Mon, Sep 16, 2013 at 3:46 PM, Chia-I Wu wrote: > On Sat, Sep 14, 2013 at 5:15 AM, Paul Berry wrote: >> On 12 September 2013 22:06, Chia-I Wu wrote: >>> >>> From: Chia-I Wu >>> >>> Consider only the top-left and top-right pixels to approximate DDX in a >>> 2x2 >>> subspan, unless th