[Mesa-dev] [PATCH 07/21] i965/fs: Special-case nir_intrinsic_store_output for the fragment shader.

2016-07-22 Thread Francisco Jerez
I'm about to change how fragment shader output locations are represented, so the generic nir_intrinsic_store_output implementation that assumes that outputs are just contiguous elements in the big nir_outputs array won't work anymore. This somewhat simplified implementation of

[Mesa-dev] [PATCH 09/21] i965/fs: Rework representation of fragment output locations in NIR.

2016-07-22 Thread Francisco Jerez
The problem with the current approach is that driver output locations are represented as a linear offset within the nir_outputs array, which makes it rather difficult for the back-end to figure out what color output and index some nir_intrinsic_load/store_output was meant for, because the offset

[Mesa-dev] [PATCH 02/21] i965/fs: Add brw_wm_prog_key bit specifying whether FB reads should be coherent.

2016-07-22 Thread Francisco Jerez
Some of the following changes in this series are specific to the non-coherent path, so I need some way to tell whether the coherent or non-coherent path is in use. The flag defaults to the value of the gl_extensions::MESA_shader_framebuffer_fetch enable so that it can be overridden easily on

[Mesa-dev] [PATCH 05/21] i965/fs: Emit interpolation setup if non-coherent framebuffer fetch is in use.

2016-07-22 Thread Francisco Jerez
This will be required for the next commit since the non-coherent path makes use of the fragment coordinates implicitly, so they need to be calculated. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[Mesa-dev] [PATCH 08/21] i965: Fix undefined signed overflow in INTEL_MASK for bitfields of 31 bits.

2016-07-22 Thread Francisco Jerez
Most likely we had only ever used this macro on bitfields of less than 31 bits -- That's going to change shortly. --- src/mesa/drivers/dri/i965/brw_defines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/brw_defines.h

[Mesa-dev] [PATCH 20/21] i965: Implement glBlendBarrier.

2016-07-22 Thread Francisco Jerez
This is a no-op if the platform supports coherent framebuffer fetch, -- If it doesn't we just need to flush the render cache and invalidate the texture cache in order for previous rendering to be visible to framebuffer fetch. --- src/mesa/drivers/dri/i965/brw_program.c | 20

[Mesa-dev] [PATCH 15/21] i965: Return the correct layout from get_isl_dim_layout for pre-ILK cube textures.

2016-07-22 Thread Francisco Jerez
--- src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index 5bf9243..602306b 100644 ---

[Mesa-dev] [PATCH 17/21] i965: Massage argument list of brw_emit_surface_state().

2016-07-22 Thread Francisco Jerez
This commit does three different things in a single pass in order to keep the amount of churn low: Remove the for_gather boolean argument which was unused, pass the isl_view argument by value rather than by reference since I'll have to modify it from within the function, and add a target argument

[Mesa-dev] [PATCH 00/21] i965: Implement non-coherent framebuffer fetch.

2016-07-22 Thread Francisco Jerez
This is an implementation of non-coherent framebuffer fetch as described here [1] working on most hardware generations supported by the i965 driver (from Gen5 to Gen8). My plan was to send the coherent framebuffer fetch implementation for SKL+ first since it's actually simpler than the

Re: [Mesa-dev] [PATCH] main/shaderimage: image unit invalid if texture is incomplete, independently of the level

2016-07-22 Thread Francisco Jerez
Alejandro Piñeiro <apinhe...@igalia.com> writes: > Hi, > > On 15/07/16 22:46, Francisco Jerez wrote: >> Alejandro Piñeiro <apinhe...@igalia.com> writes: >> >>> On 14/07/16 21:24, Francisco Jerez wrote: >>>> Alejandro Piñeiro <apinhe...@ig

[Mesa-dev] [PATCH 16/17] nir: Pass through fb_fetch_output and OutputsRead from GLSL IR.

2016-07-20 Thread Francisco Jerez
The NIR representation of framebuffer fetch is the same as the GLSL IR's until interface variables are lowered away, at which point it will be translated to load output intrinsics. The GLSL-to-NIR pass just needs to copy the bits over to the NIR program. --- src/compiler/glsl/glsl_to_nir.cpp | 2

[Mesa-dev] [PATCH 15/17] glsl: Keep track of the set of fragment outputs read by a GL program.

2016-07-20 Thread Francisco Jerez
This is the set of shader outputs whose initial value is provided to the shader by some external means when the shader is executed, rather than computed by the shader itself. --- src/compiler/glsl/ir_set_program_inouts.cpp | 3 +++ src/mesa/main/mtypes.h | 1 + 2 files

[Mesa-dev] [PATCH 11/17] glsl: Don't attempt to do dead varying elimination on gl_LastFragData arrays.

2016-07-20 Thread Francisco Jerez
Apparently this pass can only handle elimination of a single built-in fragment output array, so the presence of gl_LastFragData (which it wouldn't split correctly anyway) could prevent it from splitting the actual gl_FragData array. Just match gl_FragData by name since it's the only built-in it

[Mesa-dev] [PATCH 17/17] nir: Handle FB fetch outputs correctly in nir_lower_io_to_temporaries.

2016-07-20 Thread Francisco Jerez
This requires emitting a series of copies at the top of the program from each output variable to the corresponding temporary. The initial copy can be skipped for non-framebuffer fetch outputs whose initial value is undefined, and the final copy needs to be skipped for read-only outputs (i.e.

[Mesa-dev] [PATCH 13/17] glsl/linker: Allow fragment output overlap for gl_LastFragData.

2016-07-20 Thread Francisco Jerez
gl_LastFragData overlaps gl_FragData by definition. --- src/compiler/glsl/linker.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index 6d45a02..aeaeb9c 100644 --- a/src/compiler/glsl/linker.cpp +++

[Mesa-dev] [PATCH 14/17] glsl: Don't consider read-only fragment outputs to be written to.

2016-07-20 Thread Francisco Jerez
Since they cannot be written. This prevents adding fragment outputs to the OutputsWritten set that are only read from via the gl_LastFragData array but never written to. --- src/compiler/glsl/ir_set_program_inouts.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[Mesa-dev] [PATCH 12/17] glsl/ast: Allow redeclaration of gl_LastFragData with different precision qualifier.

2016-07-20 Thread Francisco Jerez
--- src/compiler/glsl/ast_to_hir.cpp | 13 + 1 file changed, 13 insertions(+) diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp index c050a3f..ac651a9 100644 --- a/src/compiler/glsl/ast_to_hir.cpp +++ b/src/compiler/glsl/ast_to_hir.cpp @@ -3948,6

[Mesa-dev] [PATCH 01/17] glapi: Add XML for GL_EXT_shader_framebuffer_fetch.

2016-07-20 Thread Francisco Jerez
--- src/mapi/glapi/gen/es_EXT.xml | 5 + 1 file changed, 5 insertions(+) diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml index 6886dab..929e0e7 100644 --- a/src/mapi/glapi/gen/es_EXT.xml +++ b/src/mapi/glapi/gen/es_EXT.xml @@ -790,6 +790,11 @@ + + + +

[Mesa-dev] [PATCH 02/17] mesa: Add extension enables for framebuffer fetch extensions.

2016-07-20 Thread Francisco Jerez
This allows drivers to expose EXT_shader_framebuffer_fetch in GLES2+ contexts if desired. Note that this adds boolean flags for two MESA extensions, but only the EXT GLES-only extension is exposed for the moment, see the cover letter of this series [1] for the rationale. [1]

[Mesa-dev] [PATCH 03/17] mesa: Add support for querying GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT.

2016-07-20 Thread Francisco Jerez
This can currently only give true as result since the only way you can expose EXT_shader_framebuffer_fetch right now is by flipping the MESA_shader_framebuffer_fetch bit, but that could potentially change in the future, see [1] for an explanation. [1]

[Mesa-dev] [PATCH 07/17] glsl: Add parser state enables for the framebuffer fetch extensions.

2016-07-20 Thread Francisco Jerez
--- src/compiler/glsl/glsl_parser_extras.cpp | 3 +++ src/compiler/glsl/glsl_parser_extras.h | 13 + 2 files changed, 16 insertions(+) diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp index 0077434..a2c1afe 100644 ---

[Mesa-dev] [PATCH 10/17] glsl: Define a gl_LastFragData built-in for GLSL versions that have gl_FragData.

2016-07-20 Thread Francisco Jerez
The EXT_shader_framebuffer_fetch extension defines alternative language for GLES2 shaders where user-defined fragment outputs are not allowed. Instead of using inout user-defined fragment outputs the shader is expected to read from the gl_LastFragData built-in array. In addition this allows using

[Mesa-dev] [PATCH 09/17] glsl: Handle the inout qualifier in fragment shader output declarations.

2016-07-20 Thread Francisco Jerez
According to the EXT_shader_framebuffer_fetch extension the inout qualifier can be used on ESSL 3.0+ shaders to declare a special kind of fragment output that gets implicitly initialized with the previous framebuffer contents at the current fragment coordinates. In addition we allow using the

[Mesa-dev] [PATCH 04/17] mesa: Rename "texturebarrier" source files to "barrier".

2016-07-20 Thread Francisco Jerez
In preparation for collecting all pipeline barrier GL entry points into a single source file. --- src/mapi/glapi/gen/gl_genexec.py | 2 +- src/mesa/Makefile.sources | 4 ++-- src/mesa/drivers/common/driverfuncs.c | 4 ++--

[Mesa-dev] [PATCH 08/17] glsl: Add support for representing framebuffer fetch in the GLSL IR.

2016-07-20 Thread Francisco Jerez
The GLSL IR representation of framebuffer fetch amounts to a single bit in the ir_variable object applicable to fragment shader outputs. The flag indicates that the variable will be implicitly initialized to the previous contents of the render buffer at the same fragment coordinates and sample

[Mesa-dev] [PATCH 05/17] mesa: Move shader memory barrier functions into barrier.c.

2016-07-20 Thread Francisco Jerez
--- src/mesa/main/barrier.c | 51 + src/mesa/main/barrier.h | 6 ++ src/mesa/main/shaderimage.c | 51 - src/mesa/main/shaderimage.h | 6 -- 4 files changed, 57 insertions(+), 57 deletions(-)

[Mesa-dev] [PATCH 06/17] mesa: Add blend barrier entry point and driver hook.

2016-07-20 Thread Francisco Jerez
Both MESA_shader_framebuffer_fetch_non_coherent and the non-coherent variant of KHR_blend_equation_advanced will use this driver hook to request coherency between framebuffer reads and writes. This intentionally doesn't hook up glBlendBarrierMESA to the dispatch layer since the extension isn't

[Mesa-dev] [PATCH 00/17] Framebuffer fetch.

2016-07-20 Thread Francisco Jerez
This series implements the driver-independent part of the EXT_shader_framebuffer_fetch extension that provides fully programmable blending to GLES shaders. The GLSL IR and NIR representation of the framebuffer fetch functionality should be straightforward, but the way extension tracking works may

Re: [Mesa-dev] [PATCH 1/2] clover: Add missing include v2

2016-07-20 Thread Francisco Jerez
> --- a/src/gallium/state_trackers/clover/llvm/invocation.cpp > +++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp > @@ -39,6 +39,8 @@ > #include > > #include > +#include > + Redundant whitespace, with that removed: Reviewed-by: Francisco Jerez <curr

Re: [Mesa-dev] [PATCH 2/2] clover: Re-order includes in invocation.cpp to fix build

2016-07-20 Thread Francisco Jerez
nclude the cl headers first, this breaks the build because the member > names of this class are replaced by the literal 1. Reviewed-by: Francisco Jerez <curroje...@riseup.net> > --- > .../state_trackers/clover/llvm/invocation.cpp | 24 > +++--- > 1 file changed,

Re: [Mesa-dev] [PATCH] main/shaderimage: image unit invalid if texture is incomplete, independently of the level

2016-07-15 Thread Francisco Jerez
Alejandro Piñeiro <apinhe...@igalia.com> writes: > On 14/07/16 21:24, Francisco Jerez wrote: >> Alejandro Piñeiro <apinhe...@igalia.com> writes: >> >>> Without this commit, a image is considered valid if the level of the >>> texture bound to the imag

Re: [Mesa-dev] [PATCH] clover: Pass unquoted compiler arguments to Clang

2016-07-14 Thread Francisco Jerez
Vedran Miletić <ved...@miletic.net> writes: > On 07/13/2016 12:49 AM, Francisco Jerez wrote: >> You can just replace the current implementation of tokenize(), it's not >> used for anything else other than splitting compiler arguments AFAIK. >> > > Done, patch inc

Re: [Mesa-dev] [PATCH] main/shaderimage: image unit invalid if texture is incomplete, independently of the level

2016-07-14 Thread Francisco Jerez
Alejandro Piñeiro writes: > Without this commit, a image is considered valid if the level of the > texture bound to the image is complete, something we can check as mesa > save independently if it is "base incomplete" of "mipmap incomplete". > > But, from the OpenGL 4.3

Re: [Mesa-dev] [PATCH] clover: Pass unquoted compiler arguments to Clang

2016-07-12 Thread Francisco Jerez
Vedran Miletić <ved...@miletic.net> writes: > 06.06.2016 u 12:24, Vedran Miletić je napisao/la: >> On 06/06/2016 02:04 AM, Francisco Jerez wrote: >>> Vedran Miletić <ved...@miletic.net> writes: >>>> >>>> Aside from working just like NVIDIA a

Re: [Mesa-dev] [PATCH v3] i965/fs/gen7: split instructions that run into exec masking bugs

2016-07-12 Thread Francisco Jerez
} > + assert(exec_type_size); > + > + /* The hardware shifts exactly 8 channels per compressed half of the > + * instruction in single-precision mode and exactly 4 in > double-precision. > + */ > + if (channels_per_grf != (exec_type_size == 8 ? 4 : 8)) > +

Re: [Mesa-dev] [PATCH v2 3/6] i965/fs/gen7: split instructions that run into exec masking bugs

2016-07-11 Thread Francisco Jerez
Francisco Jerez <curroje...@riseup.net> writes: > Samuel Iglesias Gonsálvez <sigles...@igalia.com> writes: > >> From: Iago Toral Quiroga <ito...@igalia.com> >> >> In fp64 we can produce code like this: >> >> mov(16) vgrf2<2>:UD, vgrf3&l

Re: [Mesa-dev] [PATCH v2 6/6] i965/fs: do d2x lowering before simd splitting

2016-07-11 Thread Francisco Jerez
Samuel Iglesias Gonsálvez <sigles...@igalia.com> writes: > So that we can have gen7 split large writes produced by this lowering pass. > > Signed-off-by: Samuel Iglesias Gonsálvez <sigles...@igalia.com> Reviewed-by: Francisco Jerez <curroje...@riseup.net> > --

Re: [Mesa-dev] [PATCH v2 3/6] i965/fs/gen7: split instructions that run into exec masking bugs

2016-07-11 Thread Francisco Jerez
Samuel Iglesias Gonsálvez writes: > From: Iago Toral Quiroga > > In fp64 we can produce code like this: > > mov(16) vgrf2<2>:UD, vgrf3<2>:UD > > That our simd lowering pass would typically split in instructions with a > width of 8, writing to two

Re: [Mesa-dev] [PATCH 20/47] clover/llvm: Clean up codestyle of get_kernel_args().

2016-07-09 Thread Francisco Jerez
Jan Vesely <jan.ves...@rutgers.edu> writes: > On Mon, 2016-07-04 at 12:31 -0700, Francisco Jerez wrote: >> Jan Vesely <jan.ves...@rutgers.edu> writes: >> >> > On Sun, 2016-07-03 at 17:51 -0700, Francisco Jerez wrote: >> > >

Re: [Mesa-dev] [PATCH 04/47] clover/llvm: Collect #ifdef mess into a separate file.

2016-07-08 Thread Francisco Jerez
Jan Vesely <jan.ves...@rutgers.edu> writes: > On Sun, 2016-07-03 at 17:51 -0700, Francisco Jerez wrote: >> This gets rid of most ifdef's from the invocation.cpp code -- Only a >> couple of them are left which will be removed differently in the >> following commits

Re: [Mesa-dev] [PATCH 3/6] i965/fs/gen7: split instructions that run into exec masking bugs

2016-07-08 Thread Francisco Jerez
Iago Toral <ito...@igalia.com> writes: > On Thu, 2016-07-07 at 19:36 -0700, Francisco Jerez wrote: >> Samuel Iglesias Gonsálvez <sigles...@igalia.com> writes: >> >> > >> > From: Iago Toral Quiroga <ito...@igalia.com> >> > >> &

Re: [Mesa-dev] [PATCH 6/6] i965/fs: don't copy propagate if the instruction writes to more than two adjacent GRFs

2016-07-07 Thread Francisco Jerez
Samuel Iglesias Gonsálvez writes: > This is not allowed by the HW and copy propagation can hide this issue to > lower_simd_width pass, which is going to fix it. > > Signed-off-by: Samuel Iglesias Gonsálvez > --- >

Re: [Mesa-dev] [PATCH 3/6] i965/fs/gen7: split instructions that run into exec masking bugs

2016-07-07 Thread Francisco Jerez
Samuel Iglesias Gonsálvez writes: > From: Iago Toral Quiroga > > In fp64 we can produce code like this: > > mov(16) vgrf2<2>:UD, vgrf3<2>:UD > > That our simd lowering pass would typically split in instructions with a > width of 8, writing to two

Re: [Mesa-dev] [PATCH 1/6] i965/fs: add a helper function to create double immediates

2016-07-07 Thread Francisco Jerez
Samuel Iglesias Gonsálvez writes: > From: Iago Toral Quiroga > > Gen7 hardware does not support double immediates so these need > to be moved in 32-bit chunks to a regular vgrf instead. Instead > of doing this every time we need to create a DF immediate,

Re: [Mesa-dev] [PATCH 5/6] i965/fs: do pack lowering before simd splitting

2016-07-07 Thread Francisco Jerez
Samuel Iglesias Gonsálvez <sigles...@igalia.com> writes: > From: Iago Toral Quiroga <ito...@igalia.com> > > So that we can have gen7 split large writes produced by the pack lowering. Reviewed-by: Francisco Jerez <curroje...@riseup.net> > --- > src/mesa

Re: [Mesa-dev] [PATCH 4/6] i965/fs: do not require force_writemask_all with exec_size 4

2016-07-07 Thread Francisco Jerez
n only control the channel enable group with nibble granularity at best it's unpractical to split instructions into chunks of execution size less than four. SIMD4 though definitely makes sense because of FP64. Either way patch is: Reviewed-by: Francisco Jerez <curroje...@riseup.net> >

Re: [Mesa-dev] [PATCH 10/47] clover/llvm: Clean up compilation into LLVM IR.

2016-07-04 Thread Francisco Jerez
Jan Vesely <jan.ves...@rutgers.edu> writes: > On Sun, 2016-07-03 at 17:51 -0700, Francisco Jerez wrote: >> Some assorted and mostly trivial clean-ups for the source to bitcode >> compilation path. >> >> Reviewed-by: Serge Martin <edb+m...@sigluy.net> &g

Re: [Mesa-dev] [PATCH 20/47] clover/llvm: Clean up codestyle of get_kernel_args().

2016-07-04 Thread Francisco Jerez
Jan Vesely <jan.ves...@rutgers.edu> writes: > On Sun, 2016-07-03 at 17:51 -0700, Francisco Jerez wrote: >> Reviewed-by: Serge Martin <edb+m...@sigluy.net> >> --- >>  .../state_trackers/clover/llvm/invocation.cpp  | 223 >> ++--- >

[Mesa-dev] [PATCH 32/47] clover/llvm: Split compilation and linking.

2016-07-03 Thread Francisco Jerez
llium/state_trackers/clover/llvm/invocation.hpp new file mode 100644 index 000..9e90c50 --- /dev/null +++ b/src/gallium/state_trackers/clover/llvm/invocation.hpp @@ -0,0 +1,47 @@ +// +// Copyright 2016 Francisco Jerez +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of t

[Mesa-dev] [PATCH 11/47] clover/llvm: Trivial codestyle clean-up for optimize().

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 26 +++--- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp

[Mesa-dev] [PATCH 40/47] clover: Change program::build opts argument to std::string.

2016-07-03 Thread Francisco Jerez
From: Serge Martin <edb+m...@sigluy.net> Reviewed-by: Francisco Jerez <curroje...@riseup.net> --- src/gallium/state_trackers/clover/core/program.cpp | 4 ++-- src/gallium/state_trackers/clover/core/program.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a

[Mesa-dev] [PATCH 29/47] clover/llvm: Split native codegen into separate file.

2016-07-03 Thread Francisco Jerez
index 000..4adb05f --- /dev/null +++ b/src/gallium/state_trackers/clover/llvm/codegen/native.cpp @@ -0,0 +1,165 @@ +// +// Copyright 2012-2016 Francisco Jerez +// Copyright 2012-2016 Advanced Micro Devices, Inc. +// +// Permission is hereby granted, free of charge, to any person obtai

[Mesa-dev] [PATCH 13/47] clover/llvm: Use helper function to abort compilation with error message.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 56 +++--- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp

[Mesa-dev] [PATCH 47/47] clover/api: Implement clLinkProgram per-device binary presence validation rule.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- src/gallium/state_trackers/clover/api/program.cpp | 33 +-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/gallium/state_trackers/clover/api/program.cpp b/src/gallium/state_trackers/clover/api/program.cpp

[Mesa-dev] [PATCH 15/47] clover/llvm: Move a bunch of utility functions into separate file.

2016-07-03 Thread Francisco Jerez
:ofstream(path + suffix, std::ios::app) << s; - } - } - void init_targets() { static bool targets_initialized = false; diff --git a/src/gallium/state_trackers/clover/llvm/util.hpp b/src/gallium/state_trackers/clover/llvm/util.hpp new file mode 100644 index 000..f9a0

[Mesa-dev] [PATCH 36/47] clover/tgsi: Add stub link_program() function.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- src/gallium/state_trackers/clover/tgsi/compiler.cpp | 7 +++ src/gallium/state_trackers/clover/tgsi/invocation.hpp | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/gallium/state_trackers/clover/tgsi/compiler.cpp

[Mesa-dev] [PATCH 27/47] clover/llvm: Split shared codegen support code into separate file.

2016-07-03 Thread Francisco Jerez
ackers/clover/llvm/codegen.hpp b/src/gallium/state_trackers/clover/llvm/codegen.hpp new file mode 100644 index 000..23f3b17 --- /dev/null +++ b/src/gallium/state_trackers/clover/llvm/codegen.hpp @@ -0,0 +1,48 @@ +// +// Copyright 2016 Francisco Jerez +// +// Permission is hereby granted, free of

[Mesa-dev] [PATCH 06/47] clover/llvm: Factor out compiler option tokenization.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 25 +++--- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp

[Mesa-dev] [PATCH 33/47] clover/llvm: Implement linkage of multiple clover modules.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- src/gallium/state_trackers/clover/llvm/compat.hpp | 19 +++ src/gallium/state_trackers/clover/llvm/invocation.cpp | 19 --- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git

[Mesa-dev] [PATCH 14/47] clover/llvm: Tidy debug handling.

2016-07-03 Thread Francisco Jerez
Most significant change is debugging flags are now a scoped enum and all debugging helpers live in the debug namespace. Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 81 +++--- 1 file changed, 41 insertions(+), 40

[Mesa-dev] [PATCH 38/47] clover: Move back to using build_error to signal compilation failure.

2016-07-03 Thread Francisco Jerez
This partially reverts 7e0180d57d330bd8d3047e841086712376b2a1cc. Having two different exception subclasses for compilation and linking makes it more difficult to share or move code between the two codepaths, because the exact same function under the same error condition would need to throw one

[Mesa-dev] [PATCH 46/47] clover: Add clLinkProgram (CL 1.2).

2016-07-03 Thread Francisco Jerez
From: Serge Martin <edb+m...@sigluy.net> [ Francisco Jerez: Use validate_build_common for error checking, simplify control flow slightly and handle additional exception types. ] Reviewed-by: Francisco Jerez <curroje...@riseup.net> --- src/gallium/state_trackers/clover/api/prog

[Mesa-dev] [PATCH 12/47] clover/llvm: Simplify diagnostic_handler().

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- src/gallium/state_trackers/clover/llvm/invocation.cpp | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp

[Mesa-dev] [PATCH 08/47] clover/llvm: Declare compiler instance at top level and pass down as argument.

2016-07-03 Thread Francisco Jerez
This allows simplifying the interface of compile_llvm() because it no longer needs to read out and return the optimization level and address space map from the compiler instance. Instead declare the compiler instance at the top level so that both properties are available directly. Reviewed-by:

[Mesa-dev] [PATCH 35/47] clover/tgsi: Move compiler entry point declaration into tgsi directory and namespace.

2016-07-03 Thread Francisco Jerez
.hpp b/src/gallium/state_trackers/clover/tgsi/invocation.hpp new file mode 100644 index 000..0fa20c4 --- /dev/null +++ b/src/gallium/state_trackers/clover/tgsi/invocation.hpp @@ -0,0 +1,35 @@ +// +// Copyright 2016 Francisco Jerez +// +// Permission is hereby granted, free of charge, to an

[Mesa-dev] [PATCH 22/47] clover/llvm: Use metadata introspection utils for kernel argument set-up.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 97 ++ 1 file changed, 5 insertions(+), 92 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp

[Mesa-dev] [PATCH 37/47] clover: Override ret_object.

2016-07-03 Thread Francisco Jerez
From: Serge Martin <edb+m...@sigluy.net> Return an API object from an intrusive reference to a Clover object, incrementing the reference count of the object. Reviewed-by: Francisco Jerez <curroje...@riseup.net> --- src/gallium/state_trackers/clover/api/util.hpp | 11 +++ 1

[Mesa-dev] [PATCH 23/47] clover/llvm: Use metadata introspection utils for kernel enumeration.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 34 ++ 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp

[Mesa-dev] [PATCH 43/47] clover/llvm: Get rid of compile_program_llvm().

2016-07-03 Thread Francisco Jerez
Superseded by compile_program() and link_program(). Reviewed-by: Serge Martin --- src/gallium/state_trackers/clover/core/compiler.hpp | 7 --- src/gallium/state_trackers/clover/llvm/invocation.cpp | 11 --- 2 files changed, 18 deletions(-) diff --git

[Mesa-dev] [PATCH 25/47] clover/llvm: Split native codegen and assembly print-out into separate functions.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 38 -- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp

[Mesa-dev] [PATCH 28/47] clover/llvm: Split bitcode codegen into separate file.

2016-07-03 Thread Francisco Jerez
000..d2baa07 --- /dev/null +++ b/src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp @@ -0,0 +1,76 @@ +// +// Copyright 2012-2016 Francisco Jerez +// Copyright 2012-2016 Advanced Micro Devices, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of t

[Mesa-dev] [PATCH 01/47] clover: Bump required LLVM version to 3.6.

2016-07-03 Thread Francisco Jerez
From: Serge Martin <edb+m...@sigluy.net> Reviewed-by: Francisco Jerez <curroje...@riseup.net> --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 8321e8e..c5e1d55 100644 --- a/configure.ac +++ b/configure.ac @@ -21

[Mesa-dev] [PATCH 05/47] clover/llvm: Factor out target string parsing.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 45 -- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp

[Mesa-dev] [PATCH 30/47] clover/llvm: Trivial assorted cleanups for invocation.cpp.

2016-07-03 Thread Francisco Jerez
Drop a few include and using directives which are no longer necessary. Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 57 +++--- 1 file changed, 7 insertions(+), 50 deletions(-) diff --git

[Mesa-dev] [PATCH 16/47] clover/llvm: Clean up ELF parsing.

2016-07-03 Thread Francisco Jerez
This function was doing three separate things: - Initializing and releasing the ELF parsing state (the latter can be better done using RAII). - Searching for the symbol table in the ELF file. - Extraction of kernel symbol offsets from the symbol table. Split each one into a separate

[Mesa-dev] [PATCH 44/47] clover/core: Remove compiler.hpp.

2016-07-03 Thread Francisco Jerez
72a9f4..000 --- a/src/gallium/state_trackers/clover/core/compiler.hpp +++ /dev/null @@ -1,34 +0,0 @@ -// -// Copyright 2012 Francisco Jerez -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the &qu

[Mesa-dev] [PATCH 09/47] clover/llvm: Factor out LLVM context init.

2016-07-03 Thread Francisco Jerez
So it can be shared between the compilation and linking codepaths. Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 83 +++--- 1 file changed, 43 insertions(+), 40 deletions(-) diff --git

[Mesa-dev] [PATCH 39/47] clover: Define error subclass to signal build option parse failure.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- src/gallium/state_trackers/clover/api/program.cpp | 6 -- src/gallium/state_trackers/clover/core/error.hpp | 6 ++ src/gallium/state_trackers/clover/llvm/invocation.cpp | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-)

[Mesa-dev] [PATCH 34/47] clover/llvm: Implement the -create-library linker option.

2016-07-03 Thread Francisco Jerez
[ Serge Martin: disable internalize pass when building a library. Otherwise some functions may be inlined and removed ] Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 47 +++---

[Mesa-dev] [PATCH 42/47] clover: Provide separate program methods for compilation and linking.

2016-07-03 Thread Francisco Jerez
[ Serge Martin: Fix inverted opts and log build ctor args. Keep the log related to the build. Fix indentation ] Reviewed-by: Serge Martin --- src/gallium/state_trackers/clover/api/program.cpp | 8 +++-- src/gallium/state_trackers/clover/core/program.cpp | 34

[Mesa-dev] [PATCH 31/47] clover/llvm: Implement library bitcode codegen.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- src/gallium/state_trackers/clover/llvm/codegen.hpp | 7 ++ .../state_trackers/clover/llvm/codegen/bitcode.cpp | 25 +- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git

[Mesa-dev] [PATCH 18/47] clover/llvm: Factor out duplicated construction of clover::module.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 88 ++ 1 file changed, 41 insertions(+), 47 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp

[Mesa-dev] [PATCH 41/47] clover: Unify program::build_* into a single method returning a struct.

2016-07-03 Thread Francisco Jerez
This gets rid of the program::build_* query methods and replaces them with the program::build() method that returns a single data structure containing all parameters for the last build done on the given target device (including build logs, options and the binary itself). [ Serge Martin: Fix

[Mesa-dev] [PATCH 21/47] clover/llvm: Add simplified utility functions for metadata introspection.

2016-07-03 Thread Francisco Jerez
/state_trackers/clover/llvm/metadata.hpp @@ -0,0 +1,132 @@ +// +// Copyright 2016 Francisco Jerez +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without r

[Mesa-dev] [PATCH 20/47] clover/llvm: Clean up codestyle of get_kernel_args().

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 223 ++--- 1 file changed, 103 insertions(+), 120 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp

[Mesa-dev] [PATCH 24/47] clover/llvm: Clean up bitcode codegen.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 36 -- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp

[Mesa-dev] [PATCH 26/47] clover/llvm: Define function for bitcode print-out.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- src/gallium/state_trackers/clover/llvm/invocation.cpp | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp

[Mesa-dev] [PATCH 45/47] clover: Trivial cleanups for api/program.cpp.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- src/gallium/state_trackers/clover/api/program.cpp | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/gallium/state_trackers/clover/api/program.cpp b/src/gallium/state_trackers/clover/api/program.cpp index

[Mesa-dev] [PATCH 17/47] clover/llvm: Clean up compile_native().

2016-07-03 Thread Francisco Jerez
This switches compile_native() to the C++ API (which the rest of this file makes use of anyway so there is little benefit from using the C API), what should get rid of an amount of boilerplate and fix a leak of the TargetMachine object in the error path. v2: Additional fixes for LLVM 3.6. v3:

[Mesa-dev] [PATCH 04/47] clover/llvm: Collect #ifdef mess into a separate file.

2016-07-03 Thread Francisco Jerez
at.hpp @@ -0,0 +1,116 @@ +// +// Copyright 2016 Francisco Jerez +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including wi

[Mesa-dev] [PATCH 03/47] clover/llvm: Drop dead code.

2016-07-03 Thread Francisco Jerez
This ifdef'ed out code was meant to handle compilation into TGSI, but it doesn't seem likely that it will ever be useful even if the TGSI back-end is resurrected because the TGSI bitcode can just be plumbed through in ELF format and dealt with as a regular "native" back-end. Reviewed-by: Serge

[Mesa-dev] clover: Implement linking of multiple CL programs.

2016-07-03 Thread Francisco Jerez
This series is the result of a long back and forth of patches between Serge and me. Most of the changes are already reviewed by either of us, but I'm sending them again over the mailing list just in case somebody else wants to give additional feedback. Patches 1-30 are mainly cleaning up and

[Mesa-dev] [PATCH 02/47] clover/llvm: Drop support for LLVM < 3.6.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 40 +++--- 1 file changed, 4 insertions(+), 36 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp

[Mesa-dev] [PATCH 07/47] clover/llvm: Refactor compiler instance initialization.

2016-07-03 Thread Francisco Jerez
This will be shared between the compiler and linker codepaths. Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 99 ++ 1 file changed, 47 insertions(+), 52 deletions(-) diff --git

[Mesa-dev] [PATCH 10/47] clover/llvm: Clean up compilation into LLVM IR.

2016-07-03 Thread Francisco Jerez
Some assorted and mostly trivial clean-ups for the source to bitcode compilation path. Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 52 +- 1 file changed, 22 insertions(+), 30 deletions(-) diff --git

[Mesa-dev] [PATCH 19/47] clover/llvm: Fold compile_native() call into build_module_native().

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- src/gallium/state_trackers/clover/llvm/invocation.cpp | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp

Re: [Mesa-dev] [PATCH 4/4] i965: Fix remaining flush vs invalidate race conditions in brw_emit_pipe_control_flush.

2016-07-01 Thread Francisco Jerez
brw_memory_barrier()). > --Jason > > On Thu, Jun 30, 2016 at 10:07 PM, Francisco Jerez <curroje...@riseup.net> > wrote: > >> This hardware race condition has caused problems several times already >> (see "i965: Fix cache pollution race during L3 part

[Mesa-dev] [PATCH 3/4] i965: Make room in the batch epilogue for three more pipe controls.

2016-06-30 Thread Francisco Jerez
Review carefully, it sucks to have to keep track of the number of command packet dwords emitted in the batch epilogue manually. The MI_REPORT_PERF_COUNT_BATCH_DWORDS calculation was obviously wrong. --- src/mesa/drivers/dri/i965/brw_performance_monitor.c | 10 +-

[Mesa-dev] [PATCH 1/4] i965: Emit SNB write cache flush W/A from brw_emit_pipe_control_flush.

2016-06-30 Thread Francisco Jerez
Shouldn't cause any functional changes at this point, but we have forgotten to apply this workaround several times in the past, make sure it doesn't happen again. --- src/mesa/drivers/dri/i965/brw_misc_state.c | 9 - src/mesa/drivers/dri/i965/brw_pipe_control.c | 21

[Mesa-dev] [PATCH 2/4] i965: Emit SKL VF cache invalidation W/A from brw_emit_pipe_control_flush.

2016-06-30 Thread Francisco Jerez
There were two places in the driver doing a pipe control VF cache flush, one of them was missing this workaround, move it down into brw_emit_pipe_control_flush to make sure we don't miss it again. --- src/mesa/drivers/dri/i965/brw_pipe_control.c | 19 ++- 1 file changed, 10

<    4   5   6   7   8   9   10   11   12   13   >