Re: [Mesa-dev] [PATCH] trace: fix a segfault when tracing indirect draw calls

2016-01-26 Thread Samuel Pitoiset
On 01/25/2016 08:07 PM, Marek Olšák wrote: On Sun, Jan 24, 2016 at 4:47 PM, Samuel Pitoiset wrote: Like other resources, the indirect draw buffer must be unwrapped. Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/trace/tr_context.c | 15 ++- 1 file changed, 14

Re: [Mesa-dev] [PATCH 03/17] gallium/cso: add support for compute shaders

2016-01-26 Thread Samuel Pitoiset
ops") is going to be removed. Marek On Sun, Jan 24, 2016 at 10:09 PM, Samuel Pitoiset wrote: Signed-off-by: Samuel Pitoiset --- src/gallium/auxiliary/cso_cache/cso_context.c | 53 +++ src/gallium/auxiliary/cso_cache/cso_context.h | 6 +++ 2 files changed,

Re: [Mesa-dev] [PATCH 07/17] gallium: add indirect compute parameters to pipe_grid_info

2016-01-26 Thread Samuel Pitoiset
On 01/25/2016 03:28 PM, Ilia Mirkin wrote: On Sun, Jan 24, 2016 at 4:09 PM, Samuel Pitoiset wrote: Like indirect draw, we need to store a resource and an offset that needs to be 4 byte aligned. When indirect is used, the size of the grid (in blocks) is stored with three 32-bit integers

Re: [Mesa-dev] [PATCH 18/18] trace: add all compute related functions

2016-01-26 Thread Samuel Pitoiset
On 01/26/2016 12:47 PM, Marek Olšák wrote: On Sun, Jan 24, 2016 at 10:18 PM, Samuel Pitoiset wrote: Signed-off-by: Samuel Pitoiset --- I have forgot this one... src/gallium/drivers/trace/tr_context.c| 80 +++ src/gallium/drivers/trace/tr_dump_state.c

Re: [Mesa-dev] [PATCH 04/17] gallium: disable compute shaders for meta ops

2016-01-26 Thread Samuel Pitoiset
On 01/26/2016 02:22 PM, Ilia Mirkin wrote: On Tue, Jan 26, 2016 at 5:28 AM, Marek Olšák wrote: On Tue, Jan 26, 2016 at 6:17 AM, Alex Deucher wrote: On Mon, Jan 25, 2016 at 6:35 PM, Nicolai Hähnle wrote: On 24.01.2016 16:09, Samuel Pitoiset wrote: Loosely based on tessellation shaders

Re: [Mesa-dev] [PATCH 15/17] st/mesa: add a state tracker for compute

2016-01-26 Thread Samuel Pitoiset
On 01/25/2016 04:02 PM, Ilia Mirkin wrote: How about st/mesa: add compute program dispatch callbacks or something along those lines. I don't think "state tracker" is the right term to use. Fine by me, thanks for the suggestion. On Sun, Jan 24, 2016 at 4:09 PM, Samuel

Re: [Mesa-dev] [PATCH 08/17] tgsi/ureg: add shared variables support for compute shaders

2016-01-26 Thread Samuel Pitoiset
On 01/26/2016 02:57 PM, Marek Olšák wrote: On Tue, Jan 26, 2016 at 2:25 PM, Ilia Mirkin wrote: I'd be fine with a new TGSI_FILE_MEMORY which provided options for shared, global, and local(/private?) memory. I believe the old TGSI_FILE_RESOURCE had support for these in a hacky way, this would

Re: [Mesa-dev] [PATCH 17/17] st/mesa: expose ARB_compute_shader when compute is supported

2016-01-26 Thread Samuel Pitoiset
On 01/26/2016 05:45 AM, Ilia Mirkin wrote: On Mon, Jan 25, 2016 at 11:00 PM, Michel Dänzer wrote: On 26.01.2016 01:17, Nicolai Hähnle wrote: On 25.01.2016 10:04, Ilia Mirkin wrote: Yeah so this isn't going to fly. r600/radeonsi both expose PIPE_CAP_COMPUTE, for clover, but won't support the

Re: [Mesa-dev] [PATCH 05/17] gallium: reserve one shader buffer for shared storage

2016-01-26 Thread Samuel Pitoiset
ng buffer. Thanks, Marek On Sun, Jan 24, 2016 at 10:09 PM, Samuel Pitoiset wrote: At least, one shader buffer must be available for compute shaders. Signed-off-by: Samuel Pitoiset --- src/gallium/include/pipe/p_state.h | 2 +- src/mesa/state_tracker/st_extensions.c | 6 -- 2 files ch

Re: [Mesa-dev] [PATCH v2] nv50: avoid freeing the symbols if they're about to be stored

2016-02-03 Thread Samuel Pitoiset
On 02/03/2016 08:00 PM, Ilia Mirkin wrote: Spotted by Coverity Signed-off-by: Ilia Mirkin --- v1 -> v2: forgot to remove the original free... src/gallium/drivers/nouveau/nv50/nv50_program.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/n

Re: [Mesa-dev] [PATCH] st/mesa: fix potential null deref if no shader is passed in

2016-02-03 Thread Samuel Pitoiset
Reviewed-by: Samuel Pitoiset On 02/03/2016 07:53 PM, Ilia Mirkin wrote: Spotted by Coverity Signed-off-by: Ilia Mirkin --- src/mesa/state_tracker/st_atom_storagebuf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mesa/state_tracker/st_atom_storagebuf.c b/src

Re: [Mesa-dev] [PATCH v2] nv50: avoid freeing the symbols if they're about to be stored

2016-02-03 Thread Samuel Pitoiset
On 02/03/2016 09:55 PM, Ilia Mirkin wrote: On Wed, Feb 3, 2016 at 3:47 PM, Samuel Pitoiset wrote: On 02/03/2016 08:00 PM, Ilia Mirkin wrote: Spotted by Coverity Signed-off-by: Ilia Mirkin --- v1 -> v2: forgot to remove the original free... src/gallium/drivers/nouveau/n

[Mesa-dev] [PATCH] tgsi: use TGSI_WRITEMASK_XYZW instead of hardcoding the mask

2016-02-04 Thread Samuel Pitoiset
Signed-off-by: Samuel Pitoiset --- src/gallium/auxiliary/tgsi/tgsi_transform.h | 2 +- src/gallium/auxiliary/tgsi/tgsi_ureg.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gallium/auxiliary/tgsi/tgsi_transform.h b/src/gallium/auxiliary/tgsi/tgsi_transform.h

Re: [Mesa-dev] [PATCH 3/3] nv50: add PIPE_QUERY_OCCLUSION_PREDICATE support

2016-02-05 Thread Samuel Pitoiset
This won't fly because you forgot to add PIPE_QUERY_OCCLUSION_PREDICATE in many places in nv50_query_hw.c (begin_query(), end_query()...). On 02/04/2016 06:52 PM, Ilia Mirkin wrote: Signed-off-by: Ilia Mirkin --- src/gallium/drivers/nouveau/nv50/nv50_query_hw.c | 3 +++ 1 file changed, 3 in

Re: [Mesa-dev] [PATCH 3/3] nv50: add PIPE_QUERY_OCCLUSION_PREDICATE support

2016-02-06 Thread Samuel Pitoiset
On 02/05/2016 03:23 PM, Ilia Mirkin wrote: Did I? I thought it was already there, and just forgotten here. Will recheck. You need to add it, otherwise you will hit an assert in begin_query(). On Feb 5, 2016 5:37 AM, "Samuel Pitoiset" mailto:samuel.pitoi...@gmail.com>>

[Mesa-dev] [PATCH v2 03/20] mesa: store shared size in gl_compute_program

2016-02-06 Thread Samuel Pitoiset
The size of shared variables needs to be stored in gl_compute_program in order to set up pipe_compute_state::req_local_mem. Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin --- src/mesa/main/mtypes.h| 5 + src/mesa/main/shaderapi.c | 1 + 2 files changed, 6 insertions(+) diff

[Mesa-dev] [PATCH v2 06/20] gallium: add a new interface for pipe_context::launch_grid()

2016-02-06 Thread Samuel Pitoiset
This introduces pipe_grid_info which contains all information to describe a launch_grid call. This will be used to implement indirect compute in the same fashion as indirect draw. Signed-off-by: Samuel Pitoiset Reviewed-by: Marek Olšák Reviewed-by: Ilia Mirkin --- src/gallium/drivers/ilo

[Mesa-dev] [PATCH v2 02/20] mesa: do not use a constant for MAX_COMPUTE_SHARED_SIZE

2016-02-06 Thread Samuel Pitoiset
This will allow to query the underlying drivers for the maximum total storage size of all variables declared as with PIPE_COMPUTE_CAP_MAX_LOCAL_SIZE. Signed-off-by: Samuel Pitoiset Reviewed-by: Marek Olšák Reviewed-by: Ilia Mirkin --- src/compiler/glsl/main.cpp | 1 + src/mesa/main

[Mesa-dev] [PATCH v2 10/20] st/mesa: add a second pipeline for compute

2016-02-06 Thread Samuel Pitoiset
Compute needs a new and different validation path. Changes from v2: - make use of unreachable() instead of assert() when the pipeline is invalid - move the st_pipeline enumeration to st_context.h instead of st_api.h Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin (v1) --- src

[Mesa-dev] [PATCH v2 08/20] gallium: add PIPE_SHADER_CAP_SUPPORTED_IRS

2016-02-06 Thread Samuel Pitoiset
This cap indicates the supported representations of programs. It should be a flag with the pipe_shader_ir enum values. It will allow to enable ARB_compute_shader if the underlying driver supports TGSI. Signed-off-by: Samuel Pitoiset --- src/gallium/auxiliary/gallivm/lp_bld_limits.h| 2

[Mesa-dev] [PATCH v2 00/20] add compute shaders support

2016-02-06 Thread Samuel Pitoiset
alues Samuel Pitoiset (19): mesa: do not use a constant for MAX_COMPUTE_SHARED_SIZE mesa: store shared size in gl_compute_program mesa: add PROGRAM_MEMORY gallium/cso: add support for compute shaders gallium: add a new interface for pipe_context::launch_grid() gallium: add indirect co

[Mesa-dev] [PATCH v2 15/20] st/mesa: add mappings for compute shader sysvals

2016-02-06 Thread Samuel Pitoiset
LOCAL_INVOCATION_ID, WORK_GROUP_ID and NUM_WORK_GROUPS are respectively mapped to THREAD_ID, BLOCK_ID and GRID_SIZE. Changes from v2: - add assertions in st_translate_program() Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin (v1) --- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 12

[Mesa-dev] [PATCH v2 11/20] st/mesa: add compute shader states

2016-02-06 Thread Samuel Pitoiset
Signed-off-by: Samuel Pitoiset Reviewed-by: Marek Olšák Reviewed-by: Ilia Mirkin --- src/mesa/state_tracker/st_atom.c| 2 +- src/mesa/state_tracker/st_atom.h| 1 + src/mesa/state_tracker/st_atom_shader.c | 36 + src/mesa/state_tracker/st_cb_program.c | 28

[Mesa-dev] [PATCH v2 13/20] st/mesa: add intrinsics for shared variables

2016-02-06 Thread Samuel Pitoiset
This adds GLSL intrinsics for load/store and atomic operations. Changes from v2: - use PROGRAM_MEMORY instead of PROGRAM_BUFFER Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin (v1) --- src/mesa/state_tracker/st_extensions.c | 3 + src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 91

[Mesa-dev] [PATCH v2 05/20] gallium/cso: add support for compute shaders

2016-02-06 Thread Samuel Pitoiset
Changes from v2: - removed cso_{save,restore}_compute_shader() functions and the compute_shader_saved variable because disabling compute shaders for meta ops is not currently needed Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin (v1) --- src/gallium/auxiliary/cso_cache

[Mesa-dev] [PATCH v2 07/20] gallium: add indirect compute parameters to pipe_grid_info

2016-02-06 Thread Samuel Pitoiset
Like indirect draw, we need to store a resource and an offset that needs to be 4 byte aligned. When indirect is used, the size of the grid (in blocks) is stored with three 32-bit integers. Changes from v2: - s/most values/block sizes/ Signed-off-by: Samuel Pitoiset Reviewed-by: Marek Olšák

[Mesa-dev] [PATCH v2 12/20] st/mesa: add conversion for compute shaders

2016-02-06 Thread Samuel Pitoiset
According to the spec, there are no predefined inputs nor any fixed-function outputs. Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin --- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 8 src/mesa/state_tracker/st_program.c| 19 ++- 2 files changed, 26

[Mesa-dev] [PATCH v2 01/20] mesa: make compute maximums reflect driver-provided values

2016-02-06 Thread Samuel Pitoiset
From: Ilia Mirkin Looks like the various max's were never plumbed through. Signed-off-by: Ilia Mirkin Signed-off-by: Samuel Pitoiset Reviewed-by: Marek Olšák --- src/compiler/glsl/builtin_variables.cpp | 15 ++- src/compiler/glsl/glsl_parser_extras.cpp | 7 +++

[Mesa-dev] [PATCH v2 04/20] mesa: add PROGRAM_MEMORY

2016-02-06 Thread Samuel Pitoiset
This will be used for shared, global and local memory areas. Signed-off-by: Samuel Pitoiset --- src/mesa/main/mtypes.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 432cda9..d50376b 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa

[Mesa-dev] [PATCH v2 16/20] st/mesa: add state validation for compute shaders

2016-02-06 Thread Samuel Pitoiset
This binds atomics, constants, samplers, ssbos, textures and ubos. Signed-off-by: Samuel Pitoiset Reviewed-by: Marek Olšák Reviewed-by: Ilia Mirkin --- src/mesa/state_tracker/st_atom.c| 6 src/mesa/state_tracker/st_atom.h| 5 src/mesa/state_tracker

[Mesa-dev] [PATCH v2 19/20] st/mesa: expose ARB_compute_shader when compute is supported

2016-02-06 Thread Samuel Pitoiset
ARB_compute_shader is only enabled if the underlying driver exposes TGSI through the PIPE_CAP_SHADER_SUPPORTED_IRS cap. Changes from v2: - make use of the new PIPE_CAP_SHADER_SUPPORTED_IRS cap instead of enabling the extension when PIPE_CAP_COMPUTE is enabled. Signed-off-by: Samuel Pitoiset

[Mesa-dev] [PATCH v2 09/20] tgsi/ureg: add shared variables support for compute shaders

2016-02-06 Thread Samuel Pitoiset
This introduces TGSI_FILE_MEMORY for shared, global and local memory. Only shared memory is currently supported. Changes from v2: - introduce TGSI_FILE_MEMORY Signed-off-by: Samuel Pitoiset --- src/gallium/auxiliary/tgsi/tgsi_build.c| 1 + src/gallium/auxiliary/tgsi/tgsi_dump.c | 5

[Mesa-dev] [PATCH v2 14/20] st/mesa: keep track of shared memory declarations

2016-02-06 Thread Samuel Pitoiset
Signed-off-by: Samuel Pitoiset --- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index d74b84c..9303495 100644 --- a/src

[Mesa-dev] [PATCH v2 17/20] st/mesa: add compute program dispatch callbacks

2016-02-06 Thread Samuel Pitoiset
This state tracker implements DispatchCompute() and DispatchComputeIndirect(). Signed-off-by: Samuel Pitoiset Reviewed-by: Marek Olšák Reviewed-by: Ilia Mirkin --- src/mesa/Makefile.sources | 2 + src/mesa/state_tracker/st_cb_compute.c | 85

[Mesa-dev] [PATCH v2 18/20] st/mesa: implement limits for ARB_compute_shader

2016-02-06 Thread Samuel Pitoiset
According to the spec, this also increases the following minimum values: - MAX_COMBINED_TEXTURE_IMAGE_UNITS 96 (6*16), was 80 - MAX_UNIFORM_BUFFER_BINDINGS 72 (6*12), was 60 Signed-off-by: Samuel Pitoiset Reviewed-by: Marek Olšák Reviewed-by: Ilia Mirkin --- src/mesa

[Mesa-dev] [PATCH v2 20/20] trace: add all compute related functions

2016-02-06 Thread Samuel Pitoiset
Changes from v2: - remove use of MALLOC() Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin (v1) --- src/gallium/drivers/trace/tr_context.c| 75 +++ src/gallium/drivers/trace/tr_dump_state.c | 51 + src/gallium/drivers/trace

[Mesa-dev] [PATCH 12/12] nvc0: enable compute shaders on Fermi

2016-02-06 Thread Samuel Pitoiset
Kepler compute support is really different than Fermi and it's not ready yet. Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/src/ga

[Mesa-dev] [PATCH 00/12] nvc0: add compute shaders support on Fermi

2016-02-06 Thread Samuel Pitoiset
available below. Please review, thanks! Samuel Pitoiset (12): nvc0: allocate an area for compute user constbufs nvc0: allow to push constant buffers for compute on Fermi nvc0: bind constant buffers for compute on Fermi nvc0: bind driver consts on buffer 15 for compute on Fermi nvc0

[Mesa-dev] [PATCH 03/12] nvc0: bind constant buffers for compute on Fermi

2016-02-06 Thread Samuel Pitoiset
Loosely based on 3D. Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_compute.c | 60 + src/gallium/drivers/nouveau/nvc0/nvc0_context.c | 11 +++-- src/gallium/drivers/nouveau/nvc0/nvc0_screen.h | 2 +- src/gallium/drivers/nouveau/nvc0

[Mesa-dev] [PATCH 09/12] nv50/ir: add lock/unlock subops for load/store

2016-02-06 Thread Samuel Pitoiset
Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/codegen/nv50_ir.h| 2 ++ .../drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp| 16 ++-- src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp| 10 ++ 3 files changed, 26 insertions(+), 2

[Mesa-dev] [PATCH 08/12] nv50/ir: use s[] addr space for shared buffers

2016-02-06 Thread Samuel Pitoiset
Shared memory address space (FILE_MEMORY_SHARED) must be used instead of global memory when a shared memory area is declared. Signed-off-by: Samuel Pitoiset --- .../drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp | 42 +++--- 1 file changed, 30 insertions(+), 12 deletions

[Mesa-dev] [PATCH 06/12] nvc0: bind textures/samplers for compute on Fermi

2016-02-06 Thread Samuel Pitoiset
Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_compute.c | 140 +++- src/gallium/drivers/nouveau/nvc0/nvc0_context.h | 2 + src/gallium/drivers/nouveau/nvc0/nvc0_tex.c | 2 +- 3 files changed, 141 insertions(+), 3 deletions(-) diff --git a

[Mesa-dev] [PATCH 11/12] nv50/ir: add atomics support on shared memory for Fermi

2016-02-06 Thread Samuel Pitoiset
Signed-off-by: Samuel Pitoiset --- .../drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp | 1 + .../nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 102 - .../nouveau/codegen/nv50_ir_lowering_nvc0.h| 1 + 3 files changed, 102 insertions(+), 2 deletions(-) diff

[Mesa-dev] [PATCH 10/12] nv50/ir: make OP_SELP a compare instruction

2016-02-06 Thread Samuel Pitoiset
This OP_SELP insn will be used to handle compare and swap subops. Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp | 8 src/gallium/drivers/nouveau/codegen/nv50_ir_inlines.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff

[Mesa-dev] [PATCH 05/12] nvc0: bind shader buffers for compute on Fermi

2016-02-06 Thread Samuel Pitoiset
Loosely based on 3D. Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_compute.c | 34 + src/gallium/drivers/nouveau/nvc0/nvc0_context.c | 12 ++--- src/gallium/drivers/nouveau/nvc0/nvc0_context.h | 4 ++- src/gallium/drivers/nouveau/nvc0

[Mesa-dev] [PATCH 02/12] nvc0: allow to push constant buffers for compute on Fermi

2016-02-06 Thread Samuel Pitoiset
Constant buffers must be bound for compute like for 3D. This is done by adding a new 'shader' parameter to nvc0_cb_bo_push() which allows to use the compute channel for compute shaders, and the 3D channel for other shader types. Signed-off-by: Samuel Pitoiset --- src/gallium/drive

[Mesa-dev] [PATCH 07/12] nvc0: add support for indirect compute on Fermi

2016-02-06 Thread Samuel Pitoiset
When indirect compute is used, the size of the grid (in blocks) is stored as three integers inside a buffer. This requires a macro to set up GRIDDIM_YX and GRIDDIM_Z. Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/mme/Makefile | 2 +- src/gallium/drivers/nouveau/nvc0

[Mesa-dev] [PATCH 04/12] nvc0: bind driver consts on buffer 15 for compute on Fermi

2016-02-06 Thread Samuel Pitoiset
Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_compute.c | 13 ++--- src/gallium/drivers/nouveau/nvc0/nvc0_program.c | 2 ++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c b/src/gallium/drivers

[Mesa-dev] [PATCH 01/12] nvc0: allocate an area for compute user constbufs

2016-02-06 Thread Samuel Pitoiset
For compute shaders, we might need to upload uniforms. Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 14 +++--- src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c | 12 ++-- src/gallium/drivers/nouveau/nvc0/nvc0_tex.c

Re: [Mesa-dev] [PATCH v2 3/5] nv50: add PIPE_QUERY_OCCLUSION_PREDICATE support

2016-02-07 Thread Samuel Pitoiset
Reviewed-by: Samuel Pitoiset On 02/07/2016 02:53 AM, Ilia Mirkin wrote: Signed-off-by: Ilia Mirkin v1 -> v2: adjust begin/end methods as well --- Tested this time around. src/gallium/drivers/nouveau/nv50/nv50_query_hw.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/

Re: [Mesa-dev] [PATCH 02/12] nvc0: allow to push constant buffers for compute on Fermi

2016-02-07 Thread Samuel Pitoiset
On 02/06/2016 11:52 PM, Ilia Mirkin wrote: On Sat, Feb 6, 2016 at 5:38 PM, Samuel Pitoiset wrote: Constant buffers must be bound for compute like for 3D. This is done by adding a new 'shader' parameter to nvc0_cb_bo_push() which allows to use the compute channel for compute shader

Re: [Mesa-dev] [PATCH 04/12] nvc0: bind driver consts on buffer 15 for compute on Fermi

2016-02-07 Thread Samuel Pitoiset
On 02/07/2016 12:02 AM, Ilia Mirkin wrote: On Sat, Feb 6, 2016 at 5:38 PM, Samuel Pitoiset wrote: Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_compute.c | 13 ++--- src/gallium/drivers/nouveau/nvc0/nvc0_program.c | 2 ++ 2 files changed, 12

Re: [Mesa-dev] [PATCH 06/12] nvc0: bind textures/samplers for compute on Fermi

2016-02-07 Thread Samuel Pitoiset
but this is definitely possible, I'll do. On Sat, Feb 6, 2016 at 5:38 PM, Samuel Pitoiset wrote: Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_compute.c | 140 +++- src/gallium/drivers/nouveau/nvc0/nvc0_context.h | 2 + src/galli

Re: [Mesa-dev] [PATCH 07/12] nvc0: add support for indirect compute on Fermi

2016-02-07 Thread Samuel Pitoiset
On 02/07/2016 12:13 AM, Ilia Mirkin wrote: On Sat, Feb 6, 2016 at 5:38 PM, Samuel Pitoiset wrote: When indirect compute is used, the size of the grid (in blocks) is stored as three integers inside a buffer. This requires a macro to set up GRIDDIM_YX and GRIDDIM_Z. Signed-off-by: Samuel

Re: [Mesa-dev] [PATCH 11/12] nv50/ir: add atomics support on shared memory for Fermi

2016-02-07 Thread Samuel Pitoiset
On 02/07/2016 12:23 AM, Ilia Mirkin wrote: On Sat, Feb 6, 2016 at 5:38 PM, Samuel Pitoiset wrote: Signed-off-by: Samuel Pitoiset --- .../drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp | 1 + .../nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 102 - .../nouveau

Re: [Mesa-dev] [PATCH 01/12] nvc0: allocate an area for compute user constbufs

2016-02-07 Thread Samuel Pitoiset
On 02/07/2016 10:38 AM, Michael Schellenberger Costa wrote: Hi, Am 06/02/2016 um 23:38 schrieb Samuel Pitoiset: For compute shaders, we might need to upload uniforms. Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 14 +++--- src

Re: [Mesa-dev] [PATCH 07/12] nvc0: add support for indirect compute on Fermi

2016-02-07 Thread Samuel Pitoiset
On 02/07/2016 05:56 AM, Ilia Mirkin wrote: On Sat, Feb 6, 2016 at 6:13 PM, Ilia Mirkin wrote: On Sat, Feb 6, 2016 at 5:38 PM, Samuel Pitoiset wrote: When indirect compute is used, the size of the grid (in blocks) is stored as three integers inside a buffer. This requires a macro to set up

Re: [Mesa-dev] [PATCH v2 08/20] gallium: add PIPE_SHADER_CAP_SUPPORTED_IRS

2016-02-07 Thread Samuel Pitoiset
On 02/07/2016 12:50 AM, Ilia Mirkin wrote: On Sat, Feb 6, 2016 at 5:04 PM, Samuel Pitoiset wrote: This cap indicates the supported representations of programs. It should be a flag with the pipe_shader_ir enum values. It will allow to enable ARB_compute_shader if the underlying driver

Re: [Mesa-dev] [PATCH v2 09/20] tgsi/ureg: add shared variables support for compute shaders

2016-02-07 Thread Samuel Pitoiset
On 02/07/2016 12:51 AM, Ilia Mirkin wrote: On Sat, Feb 6, 2016 at 5:04 PM, Samuel Pitoiset wrote: This introduces TGSI_FILE_MEMORY for shared, global and local memory. Only shared memory is currently supported. Changes from v2: - introduce TGSI_FILE_MEMORY Signed-off-by: Samuel Pitoiset

Re: [Mesa-dev] [PATCH v2 19/20] st/mesa: expose ARB_compute_shader when compute is supported

2016-02-07 Thread Samuel Pitoiset
On 02/07/2016 01:02 AM, Ilia Mirkin wrote: On Sat, Feb 6, 2016 at 5:04 PM, Samuel Pitoiset wrote: ARB_compute_shader is only enabled if the underlying driver exposes TGSI through the PIPE_CAP_SHADER_SUPPORTED_IRS cap. Changes from v2: - make use of the new PIPE_CAP_SHADER_SUPPORTED_IRS

Re: [Mesa-dev] [PATCH v2 06/20] gallium: add a new interface for pipe_context::launch_grid()

2016-02-07 Thread Samuel Pitoiset
On 02/06/2016 11:04 PM, Samuel Pitoiset wrote: This introduces pipe_grid_info which contains all information to describe a launch_grid call. This will be used to implement indirect compute in the same fashion as indirect draw. Signed-off-by: Samuel Pitoiset Reviewed-by: Marek Olšák Reviewed

Re: [Mesa-dev] [PATCH v2 05/20] gallium/cso: add support for compute shaders

2016-02-07 Thread Samuel Pitoiset
they are currently not used. Let's wait for Marek to be sure. :-) On Sat, Feb 6, 2016 at 5:04 PM, Samuel Pitoiset wrote: Changes from v2: - removed cso_{save,restore}_compute_shader() functions and the compute_shader_saved variable because disabling compute shaders for meta

Re: [Mesa-dev] [PATCH v2 06/20] gallium: add a new interface for pipe_context::launch_grid()

2016-02-07 Thread Samuel Pitoiset
On 02/07/2016 07:00 PM, Ilia Mirkin wrote: On Sun, Feb 7, 2016 at 5:59 AM, Samuel Pitoiset wrote: On 02/06/2016 11:04 PM, Samuel Pitoiset wrote: This introduces pipe_grid_info which contains all information to describe a launch_grid call. This will be used to implement indirect compute

[Mesa-dev] [PATCH v2 02/11] nvc0: bind constant buffers for compute on Fermi

2016-02-07 Thread Samuel Pitoiset
Loosely based on 3D. Changes from v2: - get rid of the 's' param to nvc0_cb_bo_push() because it doesn't matter to upload constbufs for compute using the 3d chan Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_compute.c | 60 +++

[Mesa-dev] [PATCH v2 04/11] nvc0: bind shader buffers for compute on Fermi

2016-02-07 Thread Samuel Pitoiset
Loosely based on 3D. Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_compute.c | 34 + src/gallium/drivers/nouveau/nvc0/nvc0_context.c | 12 ++--- src/gallium/drivers/nouveau/nvc0/nvc0_context.h | 4 ++- src/gallium/drivers/nouveau/nvc0

[Mesa-dev] [PATCH v2 09/11] nv50/ir: make OP_SELP a compare instruction

2016-02-07 Thread Samuel Pitoiset
This OP_SELP insn will be used to handle compare and swap subops. Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp | 8 src/gallium/drivers/nouveau/codegen/nv50_ir_inlines.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff

[Mesa-dev] [PATCH v2 01/11] nvc0: allocate an area for compute user constbufs

2016-02-07 Thread Samuel Pitoiset
For compute shaders, we might need to upload uniforms. Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 14 +++--- src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c | 12 ++-- src/gallium/drivers/nouveau/nvc0/nvc0_tex.c

[Mesa-dev] [PATCH v2 06/11] nvc0: add support for indirect compute on Fermi

2016-02-07 Thread Samuel Pitoiset
When indirect compute is used, the size of the grid (in blocks) is stored as three integers inside a buffer. This requires a macro to set up GRIDDIM_YX and GRIDDIM_Z. Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/mme/Makefile | 2 +- src/gallium/drivers/nouveau/nvc0

[Mesa-dev] [PATCH v2 08/11] nv50/ir: add lock/unlock subops for load/store

2016-02-07 Thread Samuel Pitoiset
Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/codegen/nv50_ir.h| 2 ++ .../drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp| 16 ++-- src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp| 10 ++ 3 files changed, 26 insertions(+), 2

[Mesa-dev] [PATCH v2 05/11] nvc0: bind textures/samplers for compute on Fermi

2016-02-07 Thread Samuel Pitoiset
Changes from v2: - refactor the code to share (almost) the same logic between 3d and compute Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_compute.c | 38 +++-- src/gallium/drivers/nouveau/nvc0/nvc0_context.h | 2 ++ src/gallium/drivers

[Mesa-dev] [PATCH v2 03/11] nvc0: bind driver consts on buffer 15 for compute on Fermi

2016-02-07 Thread Samuel Pitoiset
Changes from v2: - always bind the driver consts even if user params come in via clover Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_compute.c | 12 +--- src/gallium/drivers/nouveau/nvc0/nvc0_program.c | 2 ++ 2 files changed, 11 insertions(+), 3 deletions

[Mesa-dev] [PATCH v2 10/11] nv50/ir: add atomics support on shared memory for Fermi

2016-02-07 Thread Samuel Pitoiset
Changes from v2: - make sure the op is OP_SELP when emitting the predicate and add one assert - use bld.getSSA() for mkOp2() - add cross edge between tryLockAndSetBB and joinBB Signed-off-by: Samuel Pitoiset --- .../drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp | 4 + .../nouveau

[Mesa-dev] [PATCH v2 11/11] nvc0: enable compute shaders on Fermi

2016-02-07 Thread Samuel Pitoiset
Kepler compute support is really different than Fermi and it's not ready yet. Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/src/ga

[Mesa-dev] [PATCH v2 07/11] nv50/ir: use s[] addr space for shared buffers

2016-02-07 Thread Samuel Pitoiset
Shared memory address space (FILE_MEMORY_SHARED) must be used instead of global memory when a shared memory area is declared. Changes from v2: - oops, do not remove TGSI_FILE_BUFFER in a switch in nv50_ir_from_tgsi.cpp Signed-off-by: Samuel Pitoiset --- .../drivers/nouveau/codegen

[Mesa-dev] [PATCH] trace: remove useless MALLOC() in trace_context_draw_vbo()

2016-02-07 Thread Samuel Pitoiset
There is no need to allocate memory when unwrapping the indirect buf. Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/trace/tr_context.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers

Re: [Mesa-dev] [PATCH] trace: remove useless MALLOC() in trace_context_draw_vbo()

2016-02-07 Thread Samuel Pitoiset
good. On Sun, Feb 7, 2016 at 4:36 PM, Samuel Pitoiset wrote: There is no need to allocate memory when unwrapping the indirect buf. Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/trace/tr_context.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git

[Mesa-dev] [PATCH] trace: add missing pipe_context::clear_texture()

2016-02-07 Thread Samuel Pitoiset
This fixes a crash with bin/arb_clear_texture-base-formats and probably some other tests which use clear_texture(). Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/trace/tr_context.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/src/gallium/drivers

Re: [Mesa-dev] [PATCH] trace: add missing pipe_context::clear_texture()

2016-02-07 Thread Samuel Pitoiset
On 02/07/2016 11:39 PM, Ilia Mirkin wrote: On Sun, Feb 7, 2016 at 5:32 PM, Samuel Pitoiset wrote: This fixes a crash with bin/arb_clear_texture-base-formats and probably some other tests which use clear_texture(). Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/trace/tr_context.c

[Mesa-dev] [PATCH] st/mesa: check ureg_create() retval in create_pbo_upload_vs()

2016-02-09 Thread Samuel Pitoiset
This avoids a possible NULL dereference because ureg_create() might return a NULL pointer. Spotted by coverity. Signed-off-by: Samuel Pitoiset Cc: Nicolai Hähnle --- src/mesa/state_tracker/st_cb_texture.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mesa/state_tracker

[Mesa-dev] [PATCH v3 00/19] add compute shaders support

2016-02-10 Thread Samuel Pitoiset
don't get strong objections. :-) Please review, thanks! Ilia Mirkin (1): mesa: make compute maximums reflect driver-provided values Samuel Pitoiset (18): mesa: do not use a constant for MAX_COMPUTE_SHARED_SIZE mesa: store shared size in gl_compute_program mesa: add PROGRAM_MEMORY g

[Mesa-dev] [PATCH v3 04/19] mesa: add PROGRAM_MEMORY

2016-02-10 Thread Samuel Pitoiset
This will be used for shared, global and local memory areas. Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin --- src/mesa/main/mtypes.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 432cda9..d50376b 100644 --- a/src/mesa/main

[Mesa-dev] [PATCH v3 10/19] st/mesa: add a second pipeline for compute

2016-02-10 Thread Samuel Pitoiset
Compute needs a new and different validation path. Changes from v2: - make use of unreachable() instead of assert() when the pipeline is invalid - move the st_pipeline enumeration to st_context.h instead of st_api.h Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin (v1) --- src

[Mesa-dev] [PATCH v3 03/19] mesa: store shared size in gl_compute_program

2016-02-10 Thread Samuel Pitoiset
The size of shared variables needs to be stored in gl_compute_program in order to set up pipe_compute_state::req_local_mem. Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin --- src/mesa/main/mtypes.h| 5 + src/mesa/main/shaderapi.c | 1 + 2 files changed, 6 insertions(+) diff

[Mesa-dev] [PATCH v3 05/19] gallium/cso: add support for compute shaders

2016-02-10 Thread Samuel Pitoiset
Changes from v2: - removed cso_{save,restore}_compute_shader() functions and the compute_shader_saved variable because disabling compute shaders for meta ops is not currently needed Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin (v1) Reviewed-by: Marek Olšák --- src/gallium

[Mesa-dev] [PATCH v3 07/19] gallium: add indirect compute parameters to pipe_grid_info

2016-02-10 Thread Samuel Pitoiset
Like indirect draw, we need to store a resource and an offset that needs to be 4 byte aligned. When indirect is used, the size of the grid (in blocks) is stored with three 32-bit integers. Changes from v2: - s/most values/block sizes/ Signed-off-by: Samuel Pitoiset Reviewed-by: Marek Olšák

[Mesa-dev] [PATCH v3 13/19] st/mesa: add intrinsics for shared variables

2016-02-10 Thread Samuel Pitoiset
This adds GLSL intrinsics for load/store and atomic operations. Changes from v2: - use PROGRAM_MEMORY instead of PROGRAM_BUFFER Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin (v1) --- src/mesa/state_tracker/st_extensions.c | 3 + src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 91

[Mesa-dev] [PATCH v3 11/19] st/mesa: add compute shader states

2016-02-10 Thread Samuel Pitoiset
Signed-off-by: Samuel Pitoiset Reviewed-by: Marek Olšák Reviewed-by: Ilia Mirkin --- src/mesa/state_tracker/st_atom.c| 2 +- src/mesa/state_tracker/st_atom.h| 1 + src/mesa/state_tracker/st_atom_shader.c | 36 + src/mesa/state_tracker/st_cb_program.c | 28

[Mesa-dev] [PATCH v3 12/19] st/mesa: add conversion for compute shaders

2016-02-10 Thread Samuel Pitoiset
According to the spec, there are no predefined inputs nor any fixed-function outputs. Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin --- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 8 src/mesa/state_tracker/st_program.c| 19 ++- 2 files changed, 26

[Mesa-dev] [PATCH v3 08/19] gallium: add PIPE_SHADER_CAP_SUPPORTED_IRS

2016-02-10 Thread Samuel Pitoiset
This cap indicates the supported representations of programs. It should be a mask of pipe_shader_ir bits. It will allow to enable ARB_compute_shader if the underlying driver supports TGSI. Changes from v2: - improve description of PIPE_SHADER_CAP_SUPPORTED_IRS Signed-off-by: Samuel Pitoiset

[Mesa-dev] [PATCH v3 06/19] gallium: add a new interface for pipe_context::launch_grid()

2016-02-10 Thread Samuel Pitoiset
This introduces pipe_grid_info which contains all information to describe a launch_grid call. This will be used to implement indirect compute in the same fashion as indirect draw. Changes from v2: - correctly initialize pipe_grid_info for nv50/nvc0 Signed-off-by: Samuel Pitoiset Reviewed-by

[Mesa-dev] [PATCH v3 02/19] mesa: do not use a constant for MAX_COMPUTE_SHARED_SIZE

2016-02-10 Thread Samuel Pitoiset
This will allow to query the underlying drivers for the maximum total storage size of all variables declared as with PIPE_COMPUTE_CAP_MAX_LOCAL_SIZE. Signed-off-by: Samuel Pitoiset Reviewed-by: Marek Olšák Reviewed-by: Ilia Mirkin --- src/compiler/glsl/main.cpp | 1 + src/mesa/main

[Mesa-dev] [PATCH v3 01/19] mesa: make compute maximums reflect driver-provided values

2016-02-10 Thread Samuel Pitoiset
From: Ilia Mirkin Looks like the various max's were never plumbed through. Signed-off-by: Ilia Mirkin Signed-off-by: Samuel Pitoiset Reviewed-by: Marek Olšák --- src/compiler/glsl/builtin_variables.cpp | 15 ++- src/compiler/glsl/glsl_parser_extras.cpp | 7 +++

[Mesa-dev] [PATCH v3 15/19] st/mesa: add mappings for compute shader sysvals

2016-02-10 Thread Samuel Pitoiset
LOCAL_INVOCATION_ID, WORK_GROUP_ID and NUM_WORK_GROUPS are respectively mapped to THREAD_ID, BLOCK_ID and GRID_SIZE. Changes from v2: - add assertions in st_translate_program() Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin (v1) --- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 12

[Mesa-dev] [PATCH v3 09/19] tgsi/ureg: add shared variables support for compute shaders

2016-02-10 Thread Samuel Pitoiset
This introduces TGSI_FILE_MEMORY for shared, global and local memory. Only shared memory is currently supported. Changes from v2: - introduce TGSI_FILE_MEMORY Signed-off-by: Samuel Pitoiset --- src/gallium/auxiliary/tgsi/tgsi_build.c| 1 + src/gallium/auxiliary/tgsi/tgsi_dump.c | 5

[Mesa-dev] [PATCH v3 14/19] st/mesa: keep track of shared memory declarations

2016-02-10 Thread Samuel Pitoiset
Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin --- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index e0a38c4

[Mesa-dev] [PATCH v3 17/19] st/mesa: add compute program dispatch callbacks

2016-02-10 Thread Samuel Pitoiset
This state tracker implements DispatchCompute() and DispatchComputeIndirect(). Signed-off-by: Samuel Pitoiset Reviewed-by: Marek Olšák Reviewed-by: Ilia Mirkin --- src/mesa/Makefile.sources | 2 + src/mesa/state_tracker/st_cb_compute.c | 85

[Mesa-dev] [PATCH v3 16/19] st/mesa: add state validation for compute shaders

2016-02-10 Thread Samuel Pitoiset
This binds atomics, constants, samplers, ssbos, textures and ubos. Signed-off-by: Samuel Pitoiset Reviewed-by: Marek Olšák Reviewed-by: Ilia Mirkin --- src/mesa/state_tracker/st_atom.c| 6 src/mesa/state_tracker/st_atom.h| 5 src/mesa/state_tracker

[Mesa-dev] [PATCH v3 18/19] st/mesa: implement limits for ARB_compute_shader

2016-02-10 Thread Samuel Pitoiset
/compute_supported_irs/ - disable ARB_compute_shader and add a comment which explains why Signed-off-by: Samuel Pitoiset Reviewed-by: Marek Olšák (v1) Reviewed-by: Ilia Mirkin (v1) --- src/mesa/state_tracker/st_extensions.c | 33 +++-- 1 file changed, 31 insertions(+), 2 deletions

[Mesa-dev] [PATCH v3 19/19] trace: add all compute related functions

2016-02-10 Thread Samuel Pitoiset
Changes from v3: - dump the TGSI compute program Changes from v2: - remove use of MALLOC() Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin (v1) --- src/gallium/drivers/trace/tr_context.c| 75 +++ src/gallium/drivers/trace/tr_dump_state.c | 60

Re: [Mesa-dev] [PATCH v3 11/19] st/mesa: add compute shader states

2016-02-11 Thread Samuel Pitoiset
On 02/11/2016 11:51 AM, Marek Olšák wrote: This needs a cleanup, because some program variant code has been unified. See below. Right, sorry I didn't see that you pushed your refactoring patch. Thanks! On Wed, Feb 10, 2016 at 7:10 PM, Samuel Pitoiset wrote: Signed-off-by: S

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