[Mesa-dev] [PATCH] intel/blorp: Emit all the binding tables

2016-10-22 Thread Jason Ekstrand
At least on Sky Lake, after emitting 3DSTATE_CONSTANT_*, you are required to re-emit the 3DSTATE_BINDING_TABLE_POINTERS packet for the corresponding stage. If you don't, double-buffering may fail and you may get the wrong constants. It turns out that you need to do this even if you have no push c

[Mesa-dev] [PATCH] glsl: Add pthread libs to cache_test

2016-10-22 Thread Rhys Kidd
Fixes the following compile error: CCLD glsl/tests/cache-test glsl/.libs/libglsl.a(libmesautil_la-mesa-sha1.o): In function `call_once': /mesa/src/util/../../include/c11/threads_posix.h:96: undefined reference to `pthread_once' Signed-off-by: Rhys Kidd --- src/compiler/Makefile.glsl.am |

[Mesa-dev] [PATCH] dir-locals.el: Adds whitespace support

2016-10-22 Thread Andres Gomez
Provides support for highlighting incorrect indentation. v2: Removed too long lines trail highlighting, as suggested by Ilia Mirkin. Signed-off-by: Andres Gomez --- .dir-locals.el | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.dir-locals.el b/.dir-locals.el in

[Mesa-dev] [PATCH] dir-locals.el: Adds whitespace support

2016-10-22 Thread Andres Gomez
Provides support to highlighting incorrect indentation. v2: Removed too long lines trail highlighting, as suggested by Ilia Mirkin. Signed-off-by: Andres Gomez --- .dir-locals.el | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.dir-locals.el b/.dir-locals.el ind

[Mesa-dev] [PATCH 4/9] glsl: simplified error checking for duplicated layout-qualifiers

2016-10-22 Thread Andres Gomez
Tthe GLSL parser has been simplified to check for the needed GL_ARB_shading_language_420pack extension just when merging the qualifiers in the proper cases. Signed-off-by: Andres Gomez --- src/compiler/glsl/ast_type.cpp | 6 ++ src/compiler/glsl/glsl_parser.yy | 24 ---

[Mesa-dev] [PATCH 8/9] Revert "glsl: allow layout qualifier overrides with ARB_shading_language_420pack"

2016-10-22 Thread Andres Gomez
This reverts commit aaa69c79cd584db4d9c6ea7794e93d29f3d54572. The commit was erroneous because the ast_layout_expression class is meant to hold a list used for an after check that all the declared values for a layout-qualifier-name are consistent. Therefore, the check for the possibility of dupli

[Mesa-dev] [PATCH 3/9] glsl: ignore all but the rightmost layout qualifier name from the rightmost layout qualifier

2016-10-22 Thread Andres Gomez
From page 46 (page 52 of the PDF) of the GLSL 4.20 spec: " More than one layout qualifier may appear in a single declaration. If the same layout-qualifier-name occurs in multiple layout qualifiers for the same declaration, the last one overrides the former ones." Consider this examp

[Mesa-dev] [PATCH 2/9] glsl: merge layouts into the default one as the last step in interface blocks

2016-10-22 Thread Andres Gomez
Consider this example: " #version 150 core #extension GL_ARB_shading_language_420pack: require #extension GL_ARB_explicit_attrib_location: require layout(location=0) out vec4 o; layout(binding=2) layout(binding=3, std140) uniform U { vec4 a; } u[2];" A

[Mesa-dev] [PATCH 6/9] glsl: push layout-qualifier-name values from variable declarations to global

2016-10-22 Thread Andres Gomez
After the previous modifications in the merging of the layout-qualifier-name values, we no longer push the final value in a declaration to the global values. This regression happens because we don't call for merging on the right-most layout qualifier of a declaration which is also the overriding o

[Mesa-dev] [PATCH 9/9] glsl: simplified ast_type_qualifier::merge_[in|out]_qualifier API

2016-10-22 Thread Andres Gomez
Since we modified the way in which multiple repetitions of the same layout-qualifier-name in a single declaration collapse into the ast_type_qualifier class, we can simplify the merge_[in|out]_qualifier APIs through removing the create_node parameter. Signed-off-by: Andres Gomez --- src/compiler

[Mesa-dev] [PATCH 5/9] glsl: allow multiple layout-qualifier in single declaration if enhanced layouts

2016-10-22 Thread Andres Gomez
From the ARB_enhanced_layouts spec: "Additions to Chapter 4 "Variables and Types" of the OpenGL Shading Language Section 4.4 "Layout Qualifiers" The existing last paragraph already says: "More than one layout qualifier may appear in a single declaration. If

[Mesa-dev] [PATCH 7/9] Revert "glsl: geom shader max_vertices layout must match."

2016-10-22 Thread Andres Gomez
This reverts commit 4c863993780a11cea6f88fa0682796bee5794042. The commit was erroneous because the ast_layout_expression class was created to hold a list of values for a layout-qualifier-name which is allowed to appear in more than one expression in the same shader/program but not to hold differen

[Mesa-dev] [PATCH 1/9] glsl: ignore all but the rightmost layout-qualifier-name

2016-10-22 Thread Andres Gomez
When a layout contains a duplicated layout-qualifier-name in a single declaration, only the last occurrence should be taken into account. From page 59 (page 65 of the PDF) of the GLSL 4.40 spec: " More than one layout qualifier may appear in a single declaration. Additionally, the same layo

[Mesa-dev] [PATCH v2 0/9] deal with multiple appearances of the same layout-qualifier-name in a single declaration

2016-10-22 Thread Andres Gomez
In the case of layout-qualifier-names that can appear multiple times in different declarations of the same shader or, even, the same program, but that have to consistently hold the same value we are using the ast_layout_expression class which holds a list to store all the appearances to be able to

Re: [Mesa-dev] [PATCH 2/5] glsl: last duplicated layout-qualifier-name in multiple layout-qualifiers overrides the former

2016-10-22 Thread Andres Gomez
On Tue, 2016-10-11 at 14:13 +1100, Timothy Arceri wrote: > Again the subject should say what the change is rather than making an > assertion. > > How about: > > glsl: ignore all but the rightmost layout qualifier name from the > rightmost layout qualifier Thanks! Applied in the v2 series to come

[Mesa-dev] [PATCH 25/25] anv/blorp: Handle VK_ATTACHMENT_UNUSED in CmdClearAttachments

2016-10-22 Thread Jason Ekstrand
From the Vulkan 1.0.29 spec for vkCmdClearAttachments: "If the subpass’s depth/stencil attachment is VK_ATTACHMENT_UNUSED, then the clear has no effect." and "If colorAttachment is VK_ATTACHMENT_UNUSED then the clear has no effect." I have no idea why it's spec'd this way; it seems

[Mesa-dev] [PATCH 12/25] intel/blorp: Rename compile_nir_shader to compile_fs

2016-10-22 Thread Jason Ekstrand
--- src/intel/blorp/blorp.c | 10 +- src/intel/blorp/blorp_blit.c | 4 ++-- src/intel/blorp/blorp_clear.c | 4 ++-- src/intel/blorp/blorp_priv.h | 10 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/intel/blorp/blorp.c b/src/intel/blorp/blorp.c ind

[Mesa-dev] [PATCH 22/25] anv/blorp: Use the new clear_attachments entrypoint for attachment clears

2016-10-22 Thread Jason Ekstrand
This allows us to re-use the surface states emitted from the Vulkan driver instead of blorp creating its own. --- src/intel/vulkan/anv_blorp.c | 93 +--- 1 file changed, 52 insertions(+), 41 deletions(-) diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel

[Mesa-dev] [PATCH 19/25] intel/blorp: Add a clear_attachments entrypoint

2016-10-22 Thread Jason Ekstrand
--- src/intel/blorp/blorp.h | 11 +++ src/intel/blorp/blorp_clear.c | 162 +- src/intel/blorp/blorp_priv.h | 1 + 3 files changed, 172 insertions(+), 2 deletions(-) diff --git a/src/intel/blorp/blorp.h b/src/intel/blorp/blorp.h index 0c64d13..8a76

[Mesa-dev] [PATCH 23/25] anv: Set framebuffer to NULL in secondary command buffers

2016-10-22 Thread Jason Ekstrand
Nothing that is allowed to be called within a secondary now relies on the framebuffer. --- src/intel/vulkan/genX_cmd_buffer.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 78b9bcc..f43c643 100644

[Mesa-dev] [PATCH 13/25] intel/blorp: Rework our usage of ralloc when compiling shaders

2016-10-22 Thread Jason Ekstrand
Previously, we were creating the shader with a NULL ralloc context and then trusting in blorp_compile_fs to clean it up. The only problem was that blorp_compile_fs didn't clean up its context properly so we were leaking. When I went to fix that, I realized that it couldn't because it has to return

[Mesa-dev] [PATCH 08/25] intel/genxml: Make some VS/GS fields consistent across gens

2016-10-22 Thread Jason Ekstrand
We use the names from gen8+ --- src/intel/genxml/gen6.xml| 6 +++--- src/intel/genxml/gen7.xml| 6 +++--- src/intel/genxml/gen75.xml | 6 +++--- src/intel/vulkan/gen7_pipeline.c | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/intel/genxml/gen6

[Mesa-dev] [PATCH 18/25] intel/blorp: Add capability to use pre-baked binding tables

2016-10-22 Thread Jason Ekstrand
When a pre-baked binding table is requested, no binding table is created, instead the binding table offset (relative to surface state base address) provided by the user is used verbatim. --- src/intel/blorp/blorp_genX_exec.h | 44 +-- src/intel/blorp/blorp_priv.

[Mesa-dev] [PATCH 24/25] Allocate a null state whenever there is depth/stencil

2016-10-22 Thread Jason Ekstrand
--- src/intel/vulkan/genX_cmd_buffer.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index f43c643..06a0686 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/gen

[Mesa-dev] [PATCH 20/25] anv: Bring back anv_cmd_buffer_emit_state_base_address

2016-10-22 Thread Jason Ekstrand
This reverts most of commit 52904ba85c7e1e3092601e3497bfbc246b00b84a. --- src/intel/vulkan/anv_cmd_buffer.c | 18 ++ src/intel/vulkan/anv_private.h| 2 ++ 2 files changed, 20 insertions(+) diff --git a/src/intel/vulkan/anv_cmd_buffer.c b/src/intel/vulkan/anv_cmd_buffer.c ind

[Mesa-dev] [PATCH 17/25] intel/blorp: Add support for vertex shaders

2016-10-22 Thread Jason Ekstrand
--- src/intel/blorp/blorp.c | 31 + src/intel/blorp/blorp_genX_exec.h | 42 +-- src/intel/blorp/blorp_priv.h | 15 ++ 3 files changed, 82 insertions(+), 6 deletions(-) diff --git a/src/intel/blorp/blorp.c b

[Mesa-dev] [PATCH 14/25] intel/blorp: Handle NIR clear inputs the same way as blit inputs

2016-10-22 Thread Jason Ekstrand
By using offsetof() we can ensure that adding fiels to wm_inputs is always safe as long as we maintain alignment. --- src/intel/blorp/blorp_blit.c | 8 +--- src/intel/blorp/blorp_clear.c | 6 ++ src/intel/blorp/blorp_priv.h | 14 ++ 3 files changed, 17 insertions(+), 11 del

[Mesa-dev] [PATCH 21/25] anv/blorp: Break the guts of alloc_binding_table into a shared helper

2016-10-22 Thread Jason Ekstrand
--- src/intel/vulkan/anv_blorp.c | 24 src/intel/vulkan/anv_private.h | 5 + src/intel/vulkan/genX_blorp_exec.c | 18 ++ 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blor

[Mesa-dev] [PATCH 15/25] blorp/exec: Use uint32_t for copying varying data

2016-10-22 Thread Jason Ekstrand
Some things may not be floats and intel CPUs are known for mangling bits when a float type is used for copying integers. --- src/intel/blorp/blorp_genX_exec.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/intel/blorp/blorp_genX_exec.h b/src/intel/blorp/blorp_genX_exe

[Mesa-dev] [PATCH 11/25] intel/blorp: Remove NIR support for uniforms

2016-10-22 Thread Jason Ekstrand
--- src/intel/blorp/blorp.c | 24 +--- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/src/intel/blorp/blorp.c b/src/intel/blorp/blorp.c index ecea07e..e34260a 100644 --- a/src/intel/blorp/blorp.c +++ b/src/intel/blorp/blorp.c @@ -155,16 +155,6 @@ brw_blorp_init_w

[Mesa-dev] [PATCH 07/25] anv/cmd_buffer: Stop relying on the framebuffer for 3DSTATE_SF on gen7

2016-10-22 Thread Jason Ekstrand
--- src/intel/vulkan/gen7_cmd_buffer.c | 43 -- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/src/intel/vulkan/gen7_cmd_buffer.c b/src/intel/vulkan/gen7_cmd_buffer.c index c1b7724..38e400b 100644 --- a/src/intel/vulkan/gen7_cmd_buffer.c +++ b/

[Mesa-dev] [PATCH 16/25] intel/blorp: Use an actual chunk of vertex buffer for the VUE header

2016-10-22 Thread Jason Ekstrand
We're about to start passing other things in as a sort of "VS header" for vertex shaders and we need a place to put them. Since we want the instance id to be one of them, it makes sense to have one vec4 that's either VUE header or VS header. Always uploading some handy zeros makes the code a bit

[Mesa-dev] [PATCH 10/25] intel/blorp: Add a shader type to make keys more unique

2016-10-22 Thread Jason Ekstrand
Depending on how the driver using blorp implements its shader caching, there is a small chance of shader collisions due to identical keys between blit and clear programs. Adding a small shader type at the top of the key alleviates this problem. --- src/intel/blorp/blorp_blit.c | 10 ++ s

[Mesa-dev] [PATCH 00/25] anv: A major rework of color attachment surface states

2016-10-22 Thread Jason Ekstrand
This series does some fairly major surgery on color attachment surface state allocation and fill-out in the Intel Vulkan driver. This is in preparation for doing color compression, fast-clears, and HiZ-capable input attachments. Naturally, as with everything else I've done in the last 2 months, i

[Mesa-dev] [PATCH 02/25] intel/genxml: Add SO_WRITE_OFFSET registers for gen7-9

2016-10-22 Thread Jason Ekstrand
--- src/intel/genxml/gen7.xml | 16 src/intel/genxml/gen75.xml | 16 src/intel/genxml/gen8.xml | 16 src/intel/genxml/gen9.xml | 16 4 files changed, 64 insertions(+) diff --git a/src/intel/genxml/gen7.xml b/src/intel/genxml/g

[Mesa-dev] [PATCH 05/25] anv/cmd_buffer: Expose add_surface_state_reloc as an inline helper

2016-10-22 Thread Jason Ekstrand
--- src/intel/vulkan/anv_private.h | 11 +++ src/intel/vulkan/genX_cmd_buffer.c | 21 ++--- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 3fe9d7d..a6611f1 100644 --- a/src/intel/vul

[Mesa-dev] [PATCH 01/25] intel/isl: Add some basic info about RENDER_SURFACE_STATE to isl_device

2016-10-22 Thread Jason Ekstrand
Signed-off-by: Jason Ekstrand --- src/intel/blorp/blorp_genX_exec.h| 33 -- src/intel/isl/isl.c | 19 src/intel/isl/isl.h | 11 + src/intel/vulkan/anv_batch_chain.c | 4 +- src/intel/

[Mesa-dev] [PATCH 03/25] anv: Add a helper for doing buffer copies with nothing but VF and SOL.

2016-10-22 Thread Jason Ekstrand
This method of doing copies has the advantage of touching very little of the GPU state. While it does disable all the shader stages, it doesn't have to blow away binding tables, viewports, scissors, or any other bits of dynamic state other than VBO 32 which is already reserved. All of the state t

[Mesa-dev] [PATCH 04/25] anv/cmd_buffer: Use the surface state alloc helper in null_surface_state

2016-10-22 Thread Jason Ekstrand
--- src/intel/vulkan/genX_cmd_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index ce53526..e9cfcc9 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -64

[Mesa-dev] [PATCH 06/25] anv: Rework the way render target surfaces are allocated

2016-10-22 Thread Jason Ekstrand
This commit moves the allocation and filling out of surface state from CreateImageView time to BeginRenderPass time. Instead of allocating the render target surface state as part of the image view, we allocate it in the command buffer state at the same time that we set up clears. For secondary co

[Mesa-dev] [PATCH 09/25] intel/blorp: Make the number of samples an explicit parameter

2016-10-22 Thread Jason Ekstrand
Previously, we always inferred it from params->dst which meant that references to params->dst were scattered all throughout the state upload code. --- src/intel/blorp/blorp.c | 1 + src/intel/blorp/blorp_blit.c | 2 ++ src/intel/blorp/blorp_clear.c | 7 +++ src/intel/blor

Re: [Mesa-dev] [PATCH 2/5] nvc0/ir: use levelZero flag when the lod is set to 0

2016-10-22 Thread Ilia Mirkin
Right, so arg+1, -1 is the right thing. However, this patch is bogus. It relies on getImmediate which in turn relies on getUniqueInsn, which in turn doesn't work pre-ssa (except in very contrived scenarios). So I'm going to try to put together a series that resolves many of these things, like makin

Re: [Mesa-dev] [PATCH 1/5] glsl: last duplicated layout-qualifier-name in a layout-qualifier overrides the former

2016-10-22 Thread Andres Gomez
Thanks for the review, I've applied your comments to the coming v2 series. Br! On Tue, 2016-10-11 at 13:17 +1100, Timothy Arceri wrote: > The subject line should describe the change not make an assertion. > > How about:  > > glsl: ignore all but the rightmost layout-qualifier-name > > On Fri,

Re: [Mesa-dev] [PATCH 1/4] gallium/util: Add align_calloc

2016-10-22 Thread Axel Davy
On 22/10/2016 16:42, Brian Paul wrote: On Sat, Oct 22, 2016 at 4:28 AM, Axel Davy > wrote: Add implementation for align_calloc, which is align_malloc + memset. Signed-off-by: Axel Davy mailto:axel.d...@ens.fr>> --- src/gallium/auxiliary/util/u_memor

Re: [Mesa-dev] [PATCH 1/4] gallium/util: Add align_calloc

2016-10-22 Thread Brian Paul
On Sat, Oct 22, 2016 at 4:28 AM, Axel Davy wrote: > Add implementation for align_calloc, > which is align_malloc + memset. > > Signed-off-by: Axel Davy > --- > src/gallium/auxiliary/util/u_memory.h | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/src/gallium/auxiliary/util/u_memo

[Mesa-dev] [PATCH 3/4] st/nine: Fix mistake in Volume9 UnlockBox

2016-10-22 Thread Axel Davy
In the format fallback path, the height was used instead of the depth. CC: "12.0 13.0" Signed-off-by: Axel Davy --- src/gallium/state_trackers/nine/volume9.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/nine/volume9.c b/src/gallium/state_track

[Mesa-dev] [PATCH 4/4] st/nine: Fix locking CubeTexture surfaces

2016-10-22 Thread Axel Davy
Only one Face of Cubetextures were locked when in DEFAULT Pool. Fixes: https://github.com/iXit/Mesa-3D/issues/129 CC: "12.0 13.0" Signed-off-by: Axel Davy --- src/gallium/state_trackers/nine/surface9.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/state_trackers/nine/surface9

[Mesa-dev] [PATCH 2/4] st/nine: Use align_calloc instead of align_malloc

2016-10-22 Thread Axel Davy
We are not sure exactly what needs to be 0 initialized, but we are missing some cases. 0 initialize all our current aligned allocation. Fixes Tree of Savior visual issues. Signed-off-by: Axel Davy --- src/gallium/state_trackers/nine/buffer9.c | 2 +- src/gallium/state_trackers/nine/cubetex

[Mesa-dev] [PATCH 1/4] gallium/util: Add align_calloc

2016-10-22 Thread Axel Davy
Add implementation for align_calloc, which is align_malloc + memset. Signed-off-by: Axel Davy --- src/gallium/auxiliary/util/u_memory.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src/gallium/auxiliary/util/u_memory.h b/src/gallium/auxiliary/util/u_memory.h index 597df62..c72d19f

[Mesa-dev] [PATCH 2/3] dri3: Flush and wait for X rendering upon glXWaitX()

2016-10-22 Thread Chris Wilson
glXWaitX() is supposed to be a synchronisation point with rendering via the X server. Currently, it only tries to keep front buffered rendering synchronised, but we also need to flush all rendering to shared pixmaps as well (which, for example, are used as texture sources by compositors). Note tha

[Mesa-dev] [PATCH 3/3] dri3: Add a synchronisation point for texture-from-pixmap

2016-10-22 Thread Chris Wilson
This applies a synchronisation point to GetBuffers() such that binding a texture-from-pixmap its rendering is serialised with X. This matches the synchronisation point inside DRI2, but it is also arguable that implied sync should be explicitly handled by the client by calling glXWaitX() following t

[Mesa-dev] [PATCH 1/3] dri2: Serialize with all X rendering on glXWaitX()

2016-10-22 Thread Chris Wilson
Xorg may implement fine grained per-drawable serialisation. If the client is reading from shared pixmap sources, flushing rendering to the current drawable is not enough (even if the current code did that, it does not). Instead, following a glXWaitX() ensure that all X rendering to shared buffers a

Re: [Mesa-dev] [PATCHv2 0/9] drisw/glx: use XShm if possible

2016-10-22 Thread Marc-André Lureau
Hi Pierre, On Fri, Apr 1, 2016 at 1:23 PM Pierre Ossman wrote: > On Mon, 15 Jun 2015 15:34:06 +0200 > marcandre.lureau at gmail.com (Marc-André Lureau) wrote: > > > Hi, > > > > XPutImage/XGetImage requires to copy the images around, and the > > request may be split over several chunks. Using XSh

[Mesa-dev] [PATCH] mapi: automake: set VISIBILITY_CFLAGS for shared glapi

2016-10-22 Thread Jonathan Gray
shared glapi was previously built without setting CFLAGS for AM_CFLAGS and VISIBILITY_CFLAGS. This resulted in symbols being exported that shouldn't be. The x86 and sparc assembly versions of the dispatch table partially mitigated this by using .hidden. Otherwise shared_dispatch_stub_* were bein