Re: [Mesa-dev] [PATCH] util/anon_file: Fix build errors due to missing includes

2019-08-09 Thread Eduardo Lima Mitev
It was fixed already with c73988300f943e185a50aaba015f2f114ffcb262. Eduardo On 8/8/19 9:31 AM, Eduardo Lima Mitev wrote: > Including stdlib.h and stdio.h is required in some configurations: > > ../src/util/anon_file.c: In function ‘create_tmpfile_cloexec’: > ../src/util/anon_file.c

[Mesa-dev] [PATCH] util/anon_file: Fix build errors due to missing includes

2019-08-08 Thread Eduardo Lima Mitev
Including stdlib.h and stdio.h is required in some configurations: ../src/util/anon_file.c: In function ‘create_tmpfile_cloexec’: ../src/util/anon_file.c:75:9: error: implicit declaration of function ‘mkostemp’ [-Werror=implicit-function-declaration] fd = mkostemp(tmpname, O_CLOEXEC);

Re: [Mesa-dev] [PATCH 1/2] panfrost: ci: Switch to kernel 5.2-rc1

2019-06-07 Thread Eduardo Lima Mitev
On 5/20/19 11:33 AM, Tomeu Vizoso wrote: > Signed-off-by: Tomeu Vizoso > --- > src/gallium/drivers/panfrost/ci/Dockerfile | 7 +++ > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/src/gallium/drivers/panfrost/ci/Dockerfile > b/src/gallium/drivers/panfrost/ci/Dockerfile >

Re: [Mesa-dev] [PATCH 5/9] ir3/nir: Add a new pass 'ir3_nir_lower_io_offsets'

2019-02-26 Thread Eduardo Lima Mitev
On 2/25/19 6:54 PM, Rob Clark wrote: > On Wed, Feb 13, 2019 at 4:30 PM Eduardo Lima Mitev wrote: >> >> This pass moves to NIR some offset computations that are currently >> implemented on the IR3 backend compiler, to allow NIR to possibly >> optimize them. >> >

Re: [Mesa-dev] [PATCH 9/9] ir3/compiler: Handle the new ir3 intrinsics for SSBO

2019-02-18 Thread Eduardo Lima Mitev
On 2/13/19 10:29 PM, Eduardo Lima Mitev wrote: > These intrinsics have the offset in dwords already computed in the last > source, so the change here is basically using that instead of emitting > the ir3_SHR to divide the byte-offset by 4. > > The improvement in shader stats is

[Mesa-dev] [PATCH 8/9] ir3: Extend lower_io_offsets pass to lower SSBO dword offset computation

2019-02-13 Thread Eduardo Lima Mitev
The lowering will take an SSBO intrinsic and replace it with the new ir3-specific version that adds an extra source. That source will hold the SSA value resulting from inserting a division by 4 (an SHR op) of the original byte-offset source of the intrinsic. ---

[Mesa-dev] [PATCH 9/9] ir3/compiler: Handle the new ir3 intrinsics for SSBO

2019-02-13 Thread Eduardo Lima Mitev
These intrinsics have the offset in dwords already computed in the last source, so the change here is basically using that instead of emitting the ir3_SHR to divide the byte-offset by 4. The improvement in shader stats is dramatic, of up to ~15% in instruction count in some cases. Tested on a5xx.

[Mesa-dev] [PATCH 2/9] ir3/compiler: Handle newly added intrinsic image_deref_load_param_ir3

2019-02-13 Thread Eduardo Lima Mitev
Compiler will emit an uniform value corresponding to the requested parameter (bpp, y-stride or z-stride) for the dereferenced image. --- src/freedreno/ir3/ir3_compiler_nir.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/src/freedreno/ir3/ir3_compiler_nir.c

[Mesa-dev] [PATCH 1/9] nir: Add a new intrinsic 'image_deref_load_param_ir3'

2019-02-13 Thread Eduardo Lima Mitev
This is a freedreno specific intrinsic intended to be injected by a 'ir3_nir_lower_sampler_io' pass that will be introduced later in this series, and consumed by ir3_compiler_nir. The intrinsic will load-in SSA values for various image constants (from image_dims), namely the format's

[Mesa-dev] [PATCH 0/9] freedreno: Add a NIR pass to lower backend IO offset computations

2019-02-13 Thread Eduardo Lima Mitev
only tested it on a5xx. Eduardo Lima Mitev (9): nir: Add a new intrinsic 'image_deref_load_param_ir3' ir3/compiler: Handle newly added intrinsic image_deref_load_param_ir3 nir: Add a new ALU nir_op_imad24_ir3 ir3_compiler/nir: Handle newly added opcode nir_op_imad24_ir3 ir3/nir: Add a new

[Mesa-dev] [PATCH 7/9] nir: Add ir3-specific version of most SSBO intrinsics

2019-02-13 Thread Eduardo Lima Mitev
These are Freedreno specific versions of SSBO intrinsics that add an extra source to hold the dword-offset, which is needed by the backend apart from the byte-offset already provided by NIR in one of the sources. NIR lowering pass 'ir3_nir_lower_io_offset' will replace the original SSBO

[Mesa-dev] [PATCH 3/9] nir: Add a new ALU nir_op_imad24_ir3

2019-02-13 Thread Eduardo Lima Mitev
ir3 compiler has an integer multiply-add instruction (MAD_S24) that is used for different offset calculations in the backend. Since we intend to move some of these calculations to NIR, we need a new ALU op that can directly represent it. --- src/compiler/nir/nir_opcodes.py | 16

[Mesa-dev] [PATCH 5/9] ir3/nir: Add a new pass 'ir3_nir_lower_io_offsets'

2019-02-13 Thread Eduardo Lima Mitev
This pass moves to NIR some offset computations that are currently implemented on the IR3 backend compiler, to allow NIR to possibly optimize them. For now, it only supports lowering byte-offset computation for image store and atomics. --- src/freedreno/Makefile.sources | 1 +

[Mesa-dev] [PATCH 6/9] ir3/compiler: Use the new lower_io_offsets pass

2019-02-13 Thread Eduardo Lima Mitev
This effectively removes all offset calculations in ir3_compiler_nir::get_image_offset(). No regressions observed on affected tests from Khronos CTS and piglit suites, compared to master. Unfortunately shader-db is not helpful for stats in this case. Few shaders there exercise image store or

[Mesa-dev] [PATCH 4/9] ir3_compiler/nir: Handle newly added opcode nir_op_imad24_ir3

2019-02-13 Thread Eduardo Lima Mitev
It simply emits an ir3_MAD_S24. --- src/freedreno/ir3/ir3_compiler_nir.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/freedreno/ir3/ir3_compiler_nir.c b/src/freedreno/ir3/ir3_compiler_nir.c index df948995000..05dc5ef7cf6 100644 --- a/src/freedreno/ir3/ir3_compiler_nir.c +++

Re: [Mesa-dev] [RFC 1/4] nir: Add a new intrinsic 'load_image_stride'

2019-01-28 Thread Eduardo Lima Mitev
On 1/28/19 10:16 AM, Eduardo Lima Mitev wrote: > On 1/28/19 9:56 AM, Bas Nieuwenhuizen wrote: >> On Mon, Jan 28, 2019 at 9:38 AM Eduardo Lima Mitev wrote: >>> >>> On 1/26/19 5:34 PM, Jason Ekstrand wrote: >>>> Mind suffixing it with _ir3 or something since

Re: [Mesa-dev] [RFC 1/4] nir: Add a new intrinsic 'load_image_stride'

2019-01-28 Thread Eduardo Lima Mitev
On 1/28/19 9:56 AM, Bas Nieuwenhuizen wrote: > On Mon, Jan 28, 2019 at 9:38 AM Eduardo Lima Mitev wrote: >> >> On 1/26/19 5:34 PM, Jason Ekstrand wrote: >>> Mind suffixing it with _ir3 or something since it's a back-end-specific >>> intrinsic? In

Re: [Mesa-dev] [RFC 1/4] nir: Add a new intrinsic 'load_image_stride'

2019-01-28 Thread Eduardo Lima Mitev
? Thanks for the feedback and the tip! Eduardo > On January 25, 2019 07:48:54 Eduardo Lima Mitev wrote: > >> This is an internal intrinsic intended to be injected by a >> (freedreno-specific) 'lower_sampler_io' pass that will be introduced >> later in this series;

Re: [Mesa-dev] [Freedreno] [RFC 0/4] freedreno: Move some compiler offset computations to NIR

2019-01-28 Thread Eduardo Lima Mitev
On 1/26/19 12:42 AM, Rob Clark wrote: > On Fri, Jan 25, 2019 at 10:48 AM Eduardo Lima Mitev wrote: >> >> There are a bunch of instructions emitted on ir3_compiler_nir related to >> offset computations for IO opcodes (ssbo, image, etc). This small series >> explore

Re: [Mesa-dev] [RFC 2/4] nir: Add a new ALU nir_op_imad

2019-01-26 Thread Eduardo Lima Mitev
On 1/25/19 6:46 PM, Eric Anholt wrote: > Eduardo Lima Mitev writes: > >> ir3 compiler has an integer multiply-add instruction (IMAD_S24) >> that is used for different offset calculations in the backend. >> Since we intend to move some of these calculations to NIR,

Re: [Mesa-dev] [RFC 1/4] nir: Add a new intrinsic 'load_image_stride'

2019-01-26 Thread Eduardo Lima Mitev
On 1/25/19 6:42 PM, Eric Anholt wrote: > Eduardo Lima Mitev writes: > >> This is an internal intrinsic intended to be injected by a >> (freedreno-specific) 'lower_sampler_io' pass that will be introduced >> later in this series; and consumed by ir3_compiler_nir. >&

[Mesa-dev] [RFC 0/4] freedreno: Move some compiler offset computations to NIR

2019-01-25 Thread Eduardo Lima Mitev
. A live (WIP) tree of the series can be found at: <https://gitlab.freedesktop.org/elima/mesa/commits/wip/fd-compiler-io> We plan to continue moving computations to the pass if we see good opportunities. Feedback very welcome, cheers, Eduardo Eduardo Lima Mitev (4): nir: Add a new int

[Mesa-dev] [RFC 4/4] ir3: Use ir3_nir_lower_sampler_io pass

2019-01-25 Thread Eduardo Lima Mitev
This effectively removes all offset calculations in ir3_compiler_nir::get_image_offset(). No regressions observed on affected tests from Khronos CTS and piglit suites, compared to master. Collecting useful stats on helps/hurts caused by this pass is WIP. Very few shaders in shader-db data-base

[Mesa-dev] [RFC 1/4] nir: Add a new intrinsic 'load_image_stride'

2019-01-25 Thread Eduardo Lima Mitev
This is an internal intrinsic intended to be injected by a (freedreno-specific) 'lower_sampler_io' pass that will be introduced later in this series; and consumed by ir3_compiler_nir. The intrinsic will load in SSA values for various constants for images (image_dims), namely the format's

[Mesa-dev] [RFC 3/4] ir3/nir: Add a new pass 'ir3_nir_lower_sampler_io'

2019-01-25 Thread Eduardo Lima Mitev
This pass moves to NIR some offset calculations that are currently implemented on the backend compiler, to allow NIR to possibly optimize them. For now, only coordinate byte-offset calculations for imageStore and image atomic operations are implemented. --- src/freedreno/Makefile.sources

[Mesa-dev] [RFC 2/4] nir: Add a new ALU nir_op_imad

2019-01-25 Thread Eduardo Lima Mitev
ir3 compiler has an integer multiply-add instruction (IMAD_S24) that is used for different offset calculations in the backend. Since we intend to move some of these calculations to NIR, we need a new ALU op that can represent it. --- src/compiler/nir/nir_opcodes.py | 1 + 1 file changed, 1

Re: [Mesa-dev] [PATCH] freedreno/ir3: Handle GL_NONE in get_num_components_for_glformat()

2018-12-19 Thread Eduardo Lima Mitev
On 12/19/18 9:23 PM, Ilia Mirkin wrote: > On Wed, Dec 19, 2018 at 3:18 AM Eduardo Lima Mitev wrote: >> >> An earlier patch that introduced the function failed to handle the case >> where an image format layout qualifier is not specified, which is allowed >> in Co

[Mesa-dev] [PATCH] freedreno/ir3: Handle GL_NONE in get_num_components_for_glformat()

2018-12-19 Thread Eduardo Lima Mitev
An earlier patch that introduced the function failed to handle the case where an image format layout qualifier is not specified, which is allowed in Core profiles. In these cases, nir_variable's image format is GL_NONE, and we don't need to print a debug message for those. ---

[Mesa-dev] [PATCH v3] freedreno/ir3: Make imageStore use num components from image format

2018-12-18 Thread Eduardo Lima Mitev
emit_intrinsic_store_image() is always using 4 components when collecting registers for the value. When image has less than 4 components (e.g, r32f, r32i, r32ui) this results in extra mov instructions. This patch uses the actual number of components from the image format. For example, in a

[Mesa-dev] [PATCH v2] freedreno/ir3: Make imageStore use num components from image format

2018-12-18 Thread Eduardo Lima Mitev
emit_intrinsic_store_image() is always using 4 components when collecting registers for the value. When image has less than 4 components (e.g, r32f, r32i, r32ui) this results in extra mov instructions. This patch uses the actual number of components from the image format. For example, in a

Re: [Mesa-dev] [Freedreno] [PATCH] freedreno/ir3: Make imageStore use num components from image format

2018-12-18 Thread Eduardo Lima Mitev
On 12/18/18 2:31 PM, Rob Clark wrote: > On Mon, Dec 17, 2018 at 3:41 PM Eduardo Lima Mitev wrote: >> >> emit_intrinsic_store_image() is always using 4 components when >> collecting registers for the value. When image has less than >> 4 components (e.g, r32f, r32i, r32ui

Re: [Mesa-dev] [PATCH] freedreno/ir3: Make imageStore use num components from image format

2018-12-18 Thread Eduardo Lima Mitev
will submit an v2 including them. Thanks, Ilia. > On Tue, Dec 18, 2018, 03:17 Eduardo Lima Mitev <mailto:el...@igalia.com> wrote: > > > > On 12/18/18 9:05 AM, Eduardo Lima Mitev wrote: > > On 12/17/18 10:02 PM, Ilia Mirkin wrote: > >>

Re: [Mesa-dev] [PATCH] freedreno/ir3: Make imageStore use num components from image format

2018-12-18 Thread Eduardo Lima Mitev
On 12/18/18 9:05 AM, Eduardo Lima Mitev wrote: > On 12/17/18 10:02 PM, Ilia Mirkin wrote: >> Note that the format may not be known. I suspect that falls into your >> "default" case. >> > > Hi Ilia, > > while on GLES profiles the format qualifier

Re: [Mesa-dev] [PATCH] freedreno/ir3: Make imageStore use num components from image format

2018-12-18 Thread Eduardo Lima Mitev
it it for writeonly-qualified images. I guess we can add a special case for GL_NONE to the switch, that also returns 4 components, to at least not break current behavior if image format is not known. What do you think? Eduardo > On Mon, Dec 17, 2018 at 3:41 PM Eduardo Lima Mitev wrote: >> &

[Mesa-dev] [PATCH] freedreno/ir3: Make imageStore use num components from image format

2018-12-17 Thread Eduardo Lima Mitev
emit_intrinsic_store_image() is always using 4 components when collecting registers for the value. When image has less than 4 components (e.g, r32f, r32i, r32ui) this results in extra mov instructions. This patch uses the actual number of components from the image format. For example, in a

Re: [Mesa-dev] [PATCH] mesa/glformats: Remove redundant helper _mesa_base_format_component_count

2018-10-23 Thread Eduardo Lima Mitev
On 10/23/2018 08:17 AM, Tapani Pälli wrote: > > On 10/23/18 8:56 AM, Eduardo Lima Mitev wrote: >> There exists _mesa_components_in_format() which already includes >> all cases handled in _mesa_base_format_component_count(). > > I guess the idea here was that one fu

[Mesa-dev] [PATCH] mesa/glformats: Remove redundant helper _mesa_base_format_component_count

2018-10-22 Thread Eduardo Lima Mitev
There exists _mesa_components_in_format() which already includes all cases handled in _mesa_base_format_component_count(). --- src/mesa/drivers/dri/i965/brw_blorp.c | 2 +- src/mesa/main/glformats.c | 27 --- src/mesa/main/glformats.h | 3 ---

Re: [Mesa-dev] [PATCH 09/12] compiler: All leaf Makefile.am should use +=

2017-12-25 Thread Eduardo Lima Mitev
Patches 06 to 09 are: Reviewed-by: Eduardo Lima Mitev <el...@igalia.com> However, I could not test 06 and 07 because they depend on applying 05 which needs update. Both look good, though. Eduardo On 11/21/2017 02:24 AM, Ian Romanick wrote: > From: Ian Romanick <ian.d.roman.

Re: [Mesa-dev] [PATCH 05/12] util: Move util_is_power_of_two to bitscan.h and rename to util_is_power_of_two_or_zero

2017-12-25 Thread Eduardo Lima Mitev
Ian, this patch 05 and 10 need update due to conflicts applying in current master. Eduardo On 11/21/2017 02:24 AM, Ian Romanick wrote: > From: Ian Romanick > > The new name make the zero-input behavior more obvious. The next > patch adds a new function with different

Re: [Mesa-dev] [PATCH 04/12] spirv: Add SubgroupBallotKHR capability to SubgroupSize and SubgroupLocalInvocationId

2017-12-25 Thread Eduardo Lima Mitev
Patches 1 to 4 are: Reviewed-by: Eduardo Lima Mitev <el...@igalia.com> On 11/21/2017 02:24 AM, Ian Romanick wrote: > From: Ian Romanick <ian.d.roman...@intel.com> > > The SPV_KHR_shader_ballot spec says: > > (Add the SubgroupBallotKHR capability to

Re: [Mesa-dev] [PATCH v3 00/10] Initial gl_spirv support in Mesa and i965

2017-12-14 Thread Eduardo Lima Mitev
Any chance to wrap up this review? Thanks! Eduardo On 12/13/2017 08:32 PM, Eduardo Lima Mitev wrote: > Hi, > > This is the 3rd version of the series adding initial support for ARB_gl_spirv. > > Previous versions of this series included also support for > ARB_spirv_exten

Re: [Mesa-dev] [PATCH v2 00/25] Initial gl_spirv and spirv_extensions support in Mesa and i965

2017-12-14 Thread Eduardo Lima Mitev
Oops, sorry, wrong thread. This is version 2 of the series and there is a version 3 which is the one that needs review. Eduardo On 12/15/2017 08:13 AM, Eduardo Lima Mitev wrote: > Any chance to wrap up this review? > > Thanks! > > Eduardo > > On 11/30/2017 06:28 PM, Edu

Re: [Mesa-dev] [PATCH v2 00/25] Initial gl_spirv and spirv_extensions support in Mesa and i965

2017-12-14 Thread Eduardo Lima Mitev
Any chance to wrap up this review? Thanks! Eduardo On 11/30/2017 06:28 PM, Eduardo Lima Mitev wrote: > Hello, > > This is the second version of the series providing initial support for > ARB_gl_spirv and ARB_spirv_extensions in Mesa and i965. > > First version of the s

[Mesa-dev] [PATCH v3 6/6] i965: enable ARB_spirv_extensions for gen8+

2017-12-13 Thread Eduardo Lima Mitev
From: Alejandro Piñeiro --- src/mesa/drivers/dri/i965/intel_extensions.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c index 4d17393948a..39680ed194a 100644 ---

[Mesa-dev] [PATCH v3 5/6] spirv_extensions: i965: initialize SPIR-V extensions

2017-12-13 Thread Eduardo Lima Mitev
From: Alejandro Piñeiro v2: Rebase update after changes on previous patches. --- src/mesa/drivers/dri/i965/brw_context.c | 9 - src/mesa/main/context.c | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git

[Mesa-dev] [PATCH v3 4/6] spirv_extensions: add spirv_supported_extensions on gl_constants

2017-12-13 Thread Eduardo Lima Mitev
From: Alejandro Piñeiro We can use it to get real values for ARB_spirv_extensions methods. v2: Rebase update after changes on previous patches. --- src/mesa/main/mtypes.h | 3 +++ src/mesa/main/spirv_extensions.c | 20 +++- 2 files changed, 22

[Mesa-dev] [PATCH v3 3/6] spirv_extensions: define spirv_extensions_supported

2017-12-13 Thread Eduardo Lima Mitev
From: Alejandro Piñeiro Add a struct to maintain which SPIR-V extensions are supported, and an utility method to initialize it based on nir_spirv_supported_capabilities. v2: * Fixing code style (Ian Romanick) * Adding a prefix (spirv) to fill_supported_spirv_extensions

[Mesa-dev] [PATCH v3 2/6] spirv_extensions: add list of extensions and to_string method

2017-12-13 Thread Eduardo Lima Mitev
From: Alejandro Piñeiro Ideally this should be generated somehow. One option would be gather all the extension dependencies listed on the core grammar, but there would be the possibility of not including some of the extensions. Note that spirv-tools is doing it just

[Mesa-dev] [PATCH v3 1/6] spirv_extensions: add GL_ARB_spirv_extensions boilerplate

2017-12-13 Thread Eduardo Lima Mitev
From: Alejandro Piñeiro v2: * Mention extension gap at gl_API.xml (Emil Velikov) * Bail with INVALID_ENUM if extension not available on getStringi (Emil Velikov) * Use EXTRA_EXT macro when defining the extension at get.c/get_hash_params.py (Emil Velikov) *

[Mesa-dev] [PATCH v3 0/6] ARB_spirv_extensions support in Mesa and i965

2017-12-13 Thread Eduardo Lima Mitev
Hi, This series is the latest version of the support for ARB_spirv_extensions on i965. It was split from a previous series that included also support for gl_spirv, but since this is an independent extension, we have chosen to send it separately to streamline review of the two series. This

[Mesa-dev] [PATCH v3 07/10] mesa/program: Link SPIR-V shaders using the SPIR-V code-path

2017-12-13 Thread Eduardo Lima Mitev
--- src/mesa/program/ir_to_mesa.cpp | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index 29198509a6c..5d56c2ef44a 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -36,6

[Mesa-dev] [PATCH v3 09/10] i965: Call spirv_to_nir() instead of glsl_to_nir() for SPIR-V shaders

2017-12-13 Thread Eduardo Lima Mitev
This is the main fork of the shader compilation code-path, where a NIR shader is obtained by calling spirv_to_nir() or glsl_to_nir(), depending on its nature.. v2: Use 'spirv_data' member from gl_linked_shader to know which method to call. (Timothy Arceri) Reviewed-by: Timothy Arceri

[Mesa-dev] [PATCH v3 06/10] mesa/glspirv: Add _mesa_spirv_link_shaders() function

2017-12-13 Thread Eduardo Lima Mitev
This is the equivalent to link_shaders() from src/compiler/glsl/linker.cpp, but for SPIR-V programs. It just creates the program and its gl_linked_shader objects, giving drivers the opportunity to implement any linking of SPIR-V shaders they choose, at a later stage. v2: Bail out if we see more

[Mesa-dev] [PATCH v3 05/10] mesa: Add a reference to gl_shader_spirv_data to gl_linked_shader

2017-12-13 Thread Eduardo Lima Mitev
This is a reference to the spirv_data object stored in gl_shader, which stores shader SPIR-V data that is needed during linking too. Reviewed-by: Timothy Arceri --- src/mesa/main/mtypes.h| 8 src/mesa/main/shaderobj.c | 1 + 2 files changed, 9 insertions(+)

[Mesa-dev] [PATCH v3 10/10] i965: Don't call process_glsl_ir() for SPIR-V shaders

2017-12-13 Thread Eduardo Lima Mitev
v2: Use 'spirv_data' from gl_linked_shader instead, to check if shader is SPIR-V. (Timothy Arceri) Reviewed-by: Timothy Arceri --- src/mesa/drivers/dri/i965/brw_link.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[Mesa-dev] [PATCH v3 03/10] nir/spirv: add gl_spirv_validation method

2017-12-13 Thread Eduardo Lima Mitev
From: Alejandro Piñeiro ARB_gl_spirv adds the ability to use SPIR-V binaries, and a new method, glSpecializeShader. From OpenGL 4.6 spec, section 7.2.1 "Shader Specialization", error table: INVALID_VALUE is generated if does not name a valid entry point for .

[Mesa-dev] [PATCH v3 04/10] mesa: Implement glSpecializeShaderARB

2017-12-13 Thread Eduardo Lima Mitev
From: Nicolai Hähnle v2: * Use gl_spirv_validation instead of spirv_to_nir. This method just validates the shader. The conversion to NIR will happen later, during linking. (Alejandro Piñeiro) * Use gl_shader_spirv_data struct to store the SPIR-V data.

[Mesa-dev] [PATCH v3 01/10] mesa: add gl_constants::SpirVCapabilities

2017-12-13 Thread Eduardo Lima Mitev
From: Nicolai Hähnle For drivers to declare which SPIR-V features they support. v2: Don't use a pointer (Ian Romanick) --- src/mesa/main/mtypes.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index

[Mesa-dev] [PATCH v3 02/10] i965: initialize SPIR-V capabilities

2017-12-13 Thread Eduardo Lima Mitev
From: Alejandro Piñeiro Needed for ARB_gl_spirv. Right now those are the same that the intel vulkan driver, but those are not shared. From the ARB_spirv_extensions spec: "3. If a new GL extension is added that includes SPIR-V support via a new SPIR-V extension does

[Mesa-dev] [PATCH v3 08/10] mesa/glspirv: Add a _mesa_spirv_to_nir() function

2017-12-13 Thread Eduardo Lima Mitev
This is basically a wrapper around spirv_to_nir() that includes arguments setup and post-conversion validation. v2: * Rebase update (SpirVCapabilities not a pointer anymore, spirv_to_nir_options added, and others). * Code-style improvements and remove debug hunk. (Timothy Arceri)

[Mesa-dev] [PATCH v3 00/10] Initial gl_spirv support in Mesa and i965

2017-12-13 Thread Eduardo Lima Mitev
/tree/wip/igalia/arb_gl_spirv>. Thanks for reviewing! cheers, Eduardo Alejandro Piñeiro (2): i965: initialize SPIR-V capabilities nir/spirv: add gl_spirv_validation method Eduardo Lima Mitev (6): mesa: Add a reference to gl_shader_spirv_data to gl_linked_shader mesa/

Re: [Mesa-dev] [PATCH] mesa: remove second include of errors.h in src/mesa/main/glspirv.c

2017-12-13 Thread Eduardo Lima Mitev
On 12/12/2017 05:56 PM, Ian Romanick wrote: > Weird that this was not noticed before... *shrug* This was a rebase mistake, sorry about that. Thanks Kai for catching and fixing it. Eduardo > Reviewed-by: Ian Romanick > > On 12/12/2017 07:20 AM, Kai Wasserbäch wrote:

Re: [Mesa-dev] [PATCH v2 00/25] Initial gl_spirv and spirv_extensions support in Mesa and i965

2017-12-11 Thread Eduardo Lima Mitev
es1-v2>. And the full branch to <https://github.com/Igalia/mesa/commits/wip/igalia/arb_gl_spirv>. I'm will send a v3 soon, after I sort out the last review comment. Eduardo > On 11/30/2017 09:28 AM, Eduardo Lima Mitev wrote: >> Hello, >> >> This is the second version of

Re: [Mesa-dev] [PATCH v2 19/25] mesa/glspirv: Add a _mesa_spirv_link_shaders() placeholder

2017-12-07 Thread Eduardo Lima Mitev
thnaks, Eduardo > On 01/12/17 04:28, Eduardo Lima Mitev wrote: >> This will be the equivalent to link_shaders() from >> src/compiler/glsl/linker.cpp, but for SPIR-V programs. >> --- >>   src/mesa/main/glspirv.c | 10 ++ >>   src/mesa/main/glspirv.h |  4 +

Re: [Mesa-dev] [PATCH v2 23/25] mesa/glspirv: Add a _mesa_spirv_to_nir() function

2017-12-06 Thread Eduardo Lima Mitev
On 12/06/2017 10:13 AM, Timothy Arceri wrote: > > > On 01/12/17 04:28, Eduardo Lima Mitev wrote: >> This is basically a wrapper around spirv_to_nir() that includes >> arguments setup and post-conversion validation. >> >> v2: Rebase update (SpirVCapabilities not a

Re: [Mesa-dev] [PATCH v3 24/25] i965: Call spirv_to_nir() instead of glsl_to_nir() for SPIR-V shaders

2017-12-05 Thread Eduardo Lima Mitev
04/12/17 20:21, Eduardo Lima Mitev wrote: >> This is the main fork of the shader compilation code-path, where a NIR >> shader is obtained by calling spirv_to_nir() or glsl_to_nir(), >> depending on its nature.. >> >> v2: Use 'spirv_data' member from gl_linked_shader

[Mesa-dev] [PATCH v4 22/25] mesa/glspirv: Create gl_linked_shader objects for a SPIR-V program

2017-12-04 Thread Eduardo Lima Mitev
v2: Bail out if we see more that one shader for the same stage, and add a corresponding comment. (Timothy Arceri) v3: Adds also a linker error log to the condition above. (Timothy Arceri) --- src/mesa/main/glspirv.c | 64 ++--- 1 file changed, 61

[Mesa-dev] [PATCH v3 24/25] i965: Call spirv_to_nir() instead of glsl_to_nir() for SPIR-V shaders

2017-12-04 Thread Eduardo Lima Mitev
This is the main fork of the shader compilation code-path, where a NIR shader is obtained by calling spirv_to_nir() or glsl_to_nir(), depending on its nature.. v2: Use 'spirv_data' member from gl_linked_shader to know which method to call. (Timothy Arceri) ---

Re: [Mesa-dev] [PATCH v2 24/25] i965: Call spirv_to_nir() instead of glsl_to_nir() for SPIR-V shaders

2017-11-30 Thread Eduardo Lima Mitev
On 12/01/2017 04:44 AM, Timothy Arceri wrote: > > > On 01/12/17 04:28, Eduardo Lima Mitev wrote: >> This is the main fork of the shader compilation code-path, where a NIR >> shader is obtained by calling spirv_to_nir() or glsl_to_nir(), >> depending on its nature.

Re: [Mesa-dev] [PATCH v2 00/25] Initial gl_spirv and spirv_extensions support in Mesa and i965

2017-11-30 Thread Eduardo Lima Mitev
On 12/01/2017 04:54 AM, Timothy Arceri wrote: > On 01/12/17 04:28, Eduardo Lima Mitev wrote: >> Hello, >> >> This is the second version of the series providing initial support >> for ARB_gl_spirv and ARB_spirv_extensions in Mesa and i965. >> >> First version

[Mesa-dev] [PATCH v3 22/25] mesa/glspirv: Create gl_linked_shader objects for a SPIR-V program

2017-11-30 Thread Eduardo Lima Mitev
v2: Bail out if we see more that one shader for the same stage, and add a corresponding comment. (Timothy Arceri) --- src/mesa/main/glspirv.c | 61 ++--- 1 file changed, 58 insertions(+), 3 deletions(-) diff --git a/src/mesa/main/glspirv.c

[Mesa-dev] [PATCH v2 23/25] mesa/glspirv: Add a _mesa_spirv_to_nir() function

2017-11-30 Thread Eduardo Lima Mitev
This is basically a wrapper around spirv_to_nir() that includes arguments setup and post-conversion validation. v2: Rebase update (SpirVCapabilities not a pointer anymore) --- src/mesa/main/glspirv.c | 60 + src/mesa/main/glspirv.h | 7 ++ 2

[Mesa-dev] [PATCH v2 25/25] i965: Don't call process_glsl_ir() for SPIR-V shaders

2017-11-30 Thread Eduardo Lima Mitev
v2: Use 'spirv_data' from gl_linked_shader instead, to check if shader is SPIR-V. (Timothy Arceri) --- src/mesa/drivers/dri/i965/brw_link.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp

[Mesa-dev] [PATCH v2 24/25] i965: Call spirv_to_nir() instead of glsl_to_nir() for SPIR-V shaders

2017-11-30 Thread Eduardo Lima Mitev
This is the main fork of the shader compilation code-path, where a NIR shader is obtained by calling spirv_to_nir() or glsl_to_nir(), depending on its nature.. v2: Use 'spirv_data' member from gl_linked_shader to know which method to call. (Timothy Arceri) ---

[Mesa-dev] [PATCH v2 22/25] mesa/glspirv: Create gl_linked_shader objects for a SPIR-V program

2017-11-30 Thread Eduardo Lima Mitev
--- src/mesa/main/glspirv.c | 51 ++--- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/src/mesa/main/glspirv.c b/src/mesa/main/glspirv.c index e533853f7fa..e5dc8b26ea9 100644 --- a/src/mesa/main/glspirv.c +++ b/src/mesa/main/glspirv.c @@

[Mesa-dev] [PATCH v2 19/25] mesa/glspirv: Add a _mesa_spirv_link_shaders() placeholder

2017-11-30 Thread Eduardo Lima Mitev
This will be the equivalent to link_shaders() from src/compiler/glsl/linker.cpp, but for SPIR-V programs. --- src/mesa/main/glspirv.c | 10 ++ src/mesa/main/glspirv.h | 4 2 files changed, 14 insertions(+) diff --git a/src/mesa/main/glspirv.c b/src/mesa/main/glspirv.c index

[Mesa-dev] [PATCH v2 21/25] mesa: Add a reference to gl_shader_spirv_data to gl_linked_shader

2017-11-30 Thread Eduardo Lima Mitev
This is a reference to the spirv_data object stored in gl_shader, which stores shader SPIR-V data that is needed during linking too. --- src/mesa/main/mtypes.h| 8 src/mesa/main/shaderobj.c | 1 + 2 files changed, 9 insertions(+) diff --git a/src/mesa/main/mtypes.h

[Mesa-dev] [PATCH v2 15/25] spirv_extensions: add spirv_supported_extensions on gl_constants

2017-11-30 Thread Eduardo Lima Mitev
From: Alejandro Piñeiro We can use it to get real values for ARB_spirv_extensions methods. v2: Rebase update after changes on previous patches. --- src/mesa/main/mtypes.h | 3 +++ src/mesa/main/spirv_extensions.c | 20 +++- 2 files changed, 22

[Mesa-dev] [PATCH v2 18/25] mesa: Implement glSpecializeShaderARB

2017-11-30 Thread Eduardo Lima Mitev
From: Nicolai Hähnle v2: * Use gl_spirv_validation instead of spirv_to_nir. This method just validates the shader. The conversion to NIR will happen later, during linking. (Alejandro Piñeiro) * Use gl_shader_spirv_data struct to store the SPIR-V data.

[Mesa-dev] [PATCH v2 20/25] mesa/program: Link SPIR-V shaders using the SPIR-V code-path

2017-11-30 Thread Eduardo Lima Mitev
--- src/mesa/program/ir_to_mesa.cpp | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index 047f5b38f71..83de0143c65 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -36,6

[Mesa-dev] [PATCH v2 16/25] spirv_extensions: i965: initialize SPIR-V extensions

2017-11-30 Thread Eduardo Lima Mitev
From: Alejandro Piñeiro v2: Rebase update after changes on previous patches. --- src/mesa/drivers/dri/i965/brw_context.c | 6 ++ src/mesa/main/context.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_context.c

[Mesa-dev] [PATCH v2 17/25] nir/spirv: add gl_spirv_validation method

2017-11-30 Thread Eduardo Lima Mitev
From: Alejandro Piñeiro ARB_gl_spirv adds the ability to use SPIR-V binaries, and a new method, glSpecializeShader. From OpenGL 4.6 spec, section 7.2.1 "Shader Specialization", error table: INVALID_VALUE is generated if does not name a valid entry point for .

[Mesa-dev] [PATCH v2 14/25] spirv_extensions: define spirv_extensions_supported

2017-11-30 Thread Eduardo Lima Mitev
From: Alejandro Piñeiro Add a struct to maintain which SPIR-V extensions are supported, and an utility method to initialize it based on nir_spirv_supported_capabilities. v2: * Fixing code style (Ian Romanick) * Adding a prefix (spirv) to fill_supported_spirv_extensions

[Mesa-dev] [PATCH v2 12/25] spirv_extensions: add GL_ARB_spirv_extensions boilerplate

2017-11-30 Thread Eduardo Lima Mitev
From: Alejandro Piñeiro v2: * Mention extension gap at gl_API.xml (Emil Velikov) * Bail with INVALID_ENUM if extension not available on getStringi (Emil Velikov) * Use EXTRA_EXT macro when defining the extension at get.c/get_hash_params.py (Emil Velikov) *

[Mesa-dev] [PATCH v2 05/25] mesa: implement SPIR-V loading in glShaderBinary

2017-11-30 Thread Eduardo Lima Mitev
From: Nicolai Hähnle v2: * Add a gl_shader_spirv_data member to gl_shader, which already encapsulates a gl_spirv_module where the binary will be saved. (Eduardo Lima) * Just use the 'spirv_data' member to know whether a gl_shader has the SPIR_V_BINARY_ARB

[Mesa-dev] [PATCH v2 09/25] mesa: move nir_spirv_supported_capabilities definition

2017-11-30 Thread Eduardo Lima Mitev
From: Alejandro Piñeiro Due gl_spirv we will use it on more places, specifically on gl_constants, where we would like to use it without a pointer. --- src/compiler/spirv/nir_spirv.h | 15 ++- src/mesa/main/mtypes.h | 11 +++ 2 files changed, 13

[Mesa-dev] [PATCH v2 13/25] spirv_extensions: add list of extensions and to_string method

2017-11-30 Thread Eduardo Lima Mitev
From: Alejandro Piñeiro Ideally this should be generated somehow. One option would be gather all the extension dependencies listed on the core grammar, but there would be the possibility of not including some of the extensions. Note that spirv-tools is doing it just

[Mesa-dev] [PATCH v2 10/25] mesa: add gl_constants::SpirVCapabilities

2017-11-30 Thread Eduardo Lima Mitev
From: Nicolai Hähnle For drivers to declare which SPIR-V features they support. v2: Don't use a pointer (Ian Romanick) --- src/mesa/main/mtypes.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index

[Mesa-dev] [PATCH v2 04/25] mesa/glspirv: Add struct gl_shader_spirv_data

2017-11-30 Thread Eduardo Lima Mitev
This is a per-shader structure holding the SPIR-V data associated with the shader (binary module, specialization constants and entry-point). This is needed because both gl_shader and gl_linked_shader need to share this data. Instead of copying the data, we pass a reference to it upon program

[Mesa-dev] [PATCH v2 06/25] mesa/shaderapi: add a getter for GL_SPIR_V_BINARY_ARB

2017-11-30 Thread Eduardo Lima Mitev
From: Nicolai Hähnle v2: Use the 'spirv_data' member of gl_shader instead of a dedicated flag. (Timothy Arceri) --- src/mesa/main/shaderapi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index

[Mesa-dev] [PATCH v2 11/25] i965: initialize SPIR-V capabilities

2017-11-30 Thread Eduardo Lima Mitev
From: Alejandro Piñeiro Needed for ARB_gl_spirv. Right now those are the same that the intel vulkan driver, but those are not shared. From the ARB_spirv_extensions spec: "3. If a new GL extension is added that includes SPIR-V support via a new SPIR-V extension does

[Mesa-dev] [PATCH v2 08/25] spirv_extensions: rename nir_spirv_supported_extensions

2017-11-30 Thread Eduardo Lima Mitev
From: Alejandro Piñeiro Renamed to nir_spirv_supported_capabilities. The original name seemed to suggest that it was directly related to the SPIR-V extensions supported, but that is not the case. For example, float64 was supported on SPIR-V 1.0 core, without the need of

[Mesa-dev] [PATCH v2 07/25] mesa: refuse to compile SPIR-V shaders or link mixed shaders

2017-11-30 Thread Eduardo Lima Mitev
From: Nicolai Hähnle Note that gl_shader::CompileStatus will also indicate whether a shader has been successfully specialized. v2: Use the 'spirv_data' member of gl_shader to know if it is a SPIR-V shader, instead of a dedicated flag. (Timothy Arceri) ---

[Mesa-dev] [PATCH v2 01/25] mesa: add GL_ARB_gl_spirv boilerplate

2017-11-30 Thread Eduardo Lima Mitev
From: Nicolai Hähnle v2: * Add meson build bits (Eric Engestrom) * Return INVALID_OPERATION error on SpecializeShaderARB (Ian Romanick) Reviewed-by: Emil Velikov Reviewed-by: Ian Romanick Reviewed-by: Timothy

[Mesa-dev] [PATCH v2 03/25] mesa/glspirv: Add struct gl_spirv_module

2017-11-30 Thread Eduardo Lima Mitev
From: Nicolai Hähnle v2: * Make the SPIR-V module struct part of a larger gl_shader_spirv_data struct that will be introduced later, and don't reference it directly in gl_shader. (Eduardo Lima) * Readability improvements (Ian Romanick) Reviewed-by: Ian

[Mesa-dev] [PATCH v2 00/25] Initial gl_spirv and spirv_extensions support in Mesa and i965

2017-11-30 Thread Eduardo Lima Mitev
nsions boilerplate spirv_extensions: add list of extensions and to_string method spirv_extensions: define spirv_extensions_supported spirv_extensions: add spirv_supported_extensions on gl_constants spirv_extensions: i965: initialize SPIR-V extensions nir/spirv: add gl_spirv_validation me

[Mesa-dev] [PATCH v2 02/25] mesa: Add boilerplate for the GL 4.6 alias of glSpecializeShaderARB

2017-11-30 Thread Eduardo Lima Mitev
From: Neil Roberts --- src/mapi/glapi/gen/GL4x.xml | 11 +++ 1 file changed, 11 insertions(+) diff --git a/src/mapi/glapi/gen/GL4x.xml b/src/mapi/glapi/gen/GL4x.xml index 88dba5cd71a..0a8094166c8 100644 --- a/src/mapi/glapi/gen/GL4x.xml +++

Re: [Mesa-dev] [PATCH 00/24] Initial gl_spirv and spirv_extensions support in Mesa and i965

2017-11-28 Thread Eduardo Lima Mitev
/15/2017 02:22 PM, Eduardo Lima Mitev wrote: > Hello, > > This series is the first chunk of our on-going work to support > GL_ARB_gl_spirv [1] and GL_ARB_spirv_extensions [2] in Mesa and i965. It adds > API entry-points, API error checking, most of driver-agnostic setup and

Re: [Mesa-dev] [PATCH 21/24] mesa/glspirv: Create gl_linked_shader objects for a SPIR-V program

2017-11-28 Thread Eduardo Lima Mitev
On 11/27/2017 03:20 AM, Timothy Arceri wrote: > On 16/11/17 00:22, Eduardo Lima Mitev wrote: >> --- >>   src/mesa/main/glspirv.c | 51 >> ++--- >>   1 file changed, 48 insertions(+), 3 deletions(-) >> >> diff --g

Re: [Mesa-dev] [PATCH 17/24] mesa/main: Add a 'spirv' flag to gl_shader_program_data

2017-11-21 Thread Eduardo Lima Mitev
On 11/20/2017 01:54 PM, Timothy Arceri wrote: On 20/11/17 21:56, Eduardo Lima Mitev wrote: On 11/20/2017 11:31 AM, Timothy Arceri wrote: On 20/11/17 19:00, Eduardo Lima Mitev wrote: On 11/16/2017 12:23 AM, Timothy Arceri wrote: On 16/11/17 00:22, Eduardo Lima Mitev wrote: This will be used

  1   2   3   4   5   6   7   8   9   >