[Mesa-dev] [PATCH 1/3] glsl: Fix unused value warning reported by Coverity

2015-09-28 Thread Iago Toral Quiroga
We don't use param in this part of the code, so no point in advancing the pointer forward: >>> CID 1324983: Code maintainability issues (UNUSED_VALUE) >>> Assigning value from "param->get_next()" to "param" here, but that >>> stored value is overwritten before it can be used. --- src/g

[Mesa-dev] [PATCH 2/3] glsl: Fix null return coverity warning

2015-09-28 Thread Iago Toral Quiroga
Add an assert on the result of as_dereference() not being NULL: >>> CID 1324978: Null pointer dereferences (NULL_RETURNS) >>> Dereferencing a null pointer "deref_record->record->as_dereference()". Since we are introducing a new variable to hold the result of as_dereference(), take the o

[Mesa-dev] [PATCH] nir: split SSBO min/max atomic instrinsics into signed/unsigned versions

2015-09-28 Thread Iago Toral Quiroga
NIR is typeless so this is the only way to keep track of the type to select the proper atomic to use. --- I decided to squash the i965 changes in because otherwise we would break the build between the nir and i965 patches. Let me know if we rather split them anyway. src/glsl/nir/glsl_to_nir.cpp

[Mesa-dev] [PATCH 4/4] i965/gs/gen6: Maximum allowed size of SEND messages is 15 (4 bits)

2015-09-23 Thread Iago Toral Quiroga
Comit d48ac9306619 addressed this for VS, but we forgot to do the same for URB writes generated by the gen6 GS. --- src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp | 30 --- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/mesa/drivers/dri/i965/gen6_gs_visi

[Mesa-dev] [PATCH 3/3] i965: Define FIRST_SPILL_MRF and FIRST_PULL_LOAD_MRF only once and in one place

2015-09-22 Thread Iago Toral Quiroga
That should make tracking where we do spills and pull loads a bit easier. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 2 -- src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp | 2 -- src/mesa/drivers/dri/i965/brw_inst.h | 6 ++ src/mesa/drivers/dri/i965/brw_vec4_visitor

[Mesa-dev] [PATCH 0/3] Make pull constant loads in gen6 start at MRFs 16/17

2015-09-22 Thread Iago Toral Quiroga
lls, but it looks like the right thing to do in any case. I tested this on SandyBridge and IvyBridge and did not observe any regressions in piglit. Iago Toral Quiroga (3): i965: Fix remove_duplicate_mrf_writes so it can handle 24 MRFs in gen6 i965: make pull constant loads in gen6 start at MRFs

[Mesa-dev] [PATCH 2/3] i965: make pull constant loads in gen6 start at MRFs 16/17

2015-09-22 Thread Iago Toral Quiroga
So they do not conflict with our (un)spills (MRF 21..23) or our URB writes (MRF 1..15) --- src/mesa/drivers/dri/i965/brw_fs.cpp | 6 -- src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw

[Mesa-dev] [PATCH 1/3] i965: Fix remove_duplicate_mrf_writes so it can handle 24 MRFs in gen6

2015-09-22 Thread Iago Toral Quiroga
--- src/mesa/drivers/dri/i965/brw_fs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 225a312..81fe7f5 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.

[Mesa-dev] [PATCH] glsl: First argument to atomic functions must be a buffer variable

2015-09-21 Thread Iago Toral Quiroga
v2: - Add ssbo_in the names of the static functions so it is clear that this is specific to SSBO atomics. v3: - Move the check after the loop (Kristian Høgsberg) --- src/glsl/ast_function.cpp | 42 ++ 1 file changed, 42 insertions(+) diff --git a/s

[Mesa-dev] [PATCH] i965/fs: Fix comparison between signed and unsigned integer expressions

2015-09-18 Thread Iago Toral Quiroga
brw_fs_visitor.cpp: In member function 'void fs_visitor::emit_urb_writes()': brw_fs_visitor.cpp:977:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] --- src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[Mesa-dev] [PATCH 2/5] i965: Turn BRW_MAX_MRF into a macro that accepts a hardware generation

2015-09-18 Thread Iago Toral Quiroga
There are some bug reports about shaders failing to compile in gen6 because MRF 14 is used when we need to spill. For example: https://bugs.freedesktop.org/show_bug.cgi?id=86469 https://bugs.freedesktop.org/show_bug.cgi?id=90631 Discussion in bugzilla pointed to the fact that gen6 might actually h

[Mesa-dev] [PATCH 5/5] i965: Maximum allowed size of SEND messages is 15 (4 bits)

2015-09-18 Thread Iago Toral Quiroga
Until now we only used MRFs 1..15 for regular SEND messages, so the message length could not possibly exceed the maximum size. Now that we allow to use MRF registers 1..23 in gen6, we need to be careful not to build messages that can go beyond the limit. That could occur, specifically, when buildin

[Mesa-dev] [PATCH 1/5] i965: Move MRF register asserts out of brw_reg.h

2015-09-18 Thread Iago Toral Quiroga
In a later patch we will make BRW_MAX_MRF return a different value depending on the hardware generation, but it is inconvenient to add a gen parameter to the brw_reg functions only for the assertions, so move these to places where we have the hardware generation available. Ken suggested to add the

[Mesa-dev] [PATCH 4/5] i965/vec4: Use MRF registers 21-23 for spilling in gen6

2015-09-18 Thread Iago Toral Quiroga
--- src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp index 0465770..7f06050 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_

[Mesa-dev] [PATCH 0/5] Enable up to 24 MRF registers in gen6

2015-09-18 Thread Iago Toral Quiroga
g: crash: 2, fail: 12, pass: 6722, skip: 5461 We might want to test this further with other instances of gen6 hardware though... I am not sure that we can safely conclude that all implementations of gen6 hardware have 24 MRF registers from my tests on just one particular SandyBridge laptop. Iago

[Mesa-dev] [PATCH 3/5] i965/fs: Use MRF registers 21-23 for spilling in gen6

2015-09-18 Thread Iago Toral Quiroga
--- src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp index 21fb3de..6900cee 100644 --- a/src/mesa/drivers/dri/i965

[Mesa-dev] [RFC 2/3] i965: Turn BRW_MAX_MRF into a macro that accepts a hardware generation

2015-09-16 Thread Iago Toral Quiroga
--- src/mesa/drivers/dri/i965/brw_eu_emit.c | 2 +- src/mesa/drivers/dri/i965/brw_fs.cpp| 4 ++-- src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 12 ++-- src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp | 16 src/mesa

[Mesa-dev] [RFC 1/3] i965: Move MRF register asserts to the generator

2015-09-16 Thread Iago Toral Quiroga
In a later patch we will make BRW_MAX_MRF return a different value depending on the hardware generation, but it is inconvenient to add a gen parameter to the brw_reg functions only for the assertions, so move them to the generator where checking for this is easier. FIXME: we would still need to ad

[Mesa-dev] [RFC 0/3] i965: Enable up to 24 MRF registers in gen6

2015-09-16 Thread Iago Toral Quiroga
hat end up going through the generator. Or maybe we think this is just not worth it if it only helps gen6... what do you think? Iago Toral Quiroga (3): i965: Move MRF register asserts to the generator i965: Turn BRW_MAX_MRF into a macro that accepts a hardware generation i965/fs: Use MRF regis

[Mesa-dev] [RFC 3/3] i965/fs: Use MRF registers 21-23 for spilling on gen6

2015-09-16 Thread Iago Toral Quiroga
--- src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp index 21fb3de..6900cee 100644 --- a/src/mesa/drivers/dri/i965

[Mesa-dev] [PATCH 2/2] glsl/opt_array_splitting: Fix indentation

2015-09-14 Thread Iago Toral Quiroga
--- src/glsl/opt_array_splitting.cpp | 54 +++- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/src/glsl/opt_array_splitting.cpp b/src/glsl/opt_array_splitting.cpp index 1fdd013..b7ea405 100644 --- a/src/glsl/opt_array_splitting.cpp +++ b/src/gls

[Mesa-dev] [PATCH 1/2] glsl/opt_array_splitting: Fix crash when doing array indexing into other arrays

2015-09-14 Thread Iago Toral Quiroga
When we find indirect indexing into an array, the current implementation of the array spliiting optimization pass does not look further into the expression tree. However, if the variable expression involves variable indexing into other arrays, we can miss that these other arrays also have variable

[Mesa-dev] [PATCH v5 04/70] i965: set ARB_shader_storage_buffer_object related constant values

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez v2: - Add tessellation shader constants assignment v3: - Set MaxShaderStorageBufferBindings to 36. Signed-off-by: Samuel Iglesias Gonsalvez Reviewed-by: Jordan Justen --- src/mesa/drivers/dri/i965/brw_context.c | 12 1 file changed, 12 insertions(

[Mesa-dev] [PATCH v5 10/70] glsl: add support for unsized arrays in shader storage blocks

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez They only can be defined in the last position of the shader storage blocks. When an unsized array is used in different shaders, it might be converted in different sized arrays, avoid get a linker error in that case. v2: - Rework error condition and error messages

[Mesa-dev] [PATCH v5 06/70] i965: Upload Shader Storage Buffer Object surfaces

2015-09-10 Thread Iago Toral Quiroga
Since these are a special kind of UBOs we emit them together reusing the same infrastructure, however, we use a RAW surface so we can reuse existing untyped read/write/atomic messages which include a pixel mask header that we need to set to obtain correct behavior with helper invocations of the fra

[Mesa-dev] [PATCH v5 00/70] ARB_shader_storage_buffer_object (mesa, i965)

2015-09-10 Thread Iago Toral Quiroga
er. i965/vec4: Import helpers to convert vectors into arrays and back. i965/vec4: Import surface message builder functions. Iago Toral Quiroga (29): i965: Use 16-byte offset alignment for shader storage buffers i965: Implement DriverFlags.NewShaderStorageBuffer i965: Set MaxShaderStorageB

[Mesa-dev] [PATCH v5 11/70] glsl: Add parser/compiler support for unsized array's length()

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez The unsized array length is computed with the following formula: array.length() = max((buffer_object_size - offset_of_array) / stride_of_array, 0) Of these, only the buffer size needs to be provided by the backends, the frontend already knows the values of the

[Mesa-dev] [PATCH v5 70/70] glsl: Mark as active all elements of shared/std140 block arrays

2015-09-10 Thread Iago Toral Quiroga
From: Antia Puentes Commit 1ca25ab (glsl: Do not eliminate 'shared' or 'std140' blocks or block members) considered as active 'shared' and 'std140' uniform blocks and uniform block arrays, but did not include the block array elements. Because of that, it was possible to have an active uniform blo

[Mesa-dev] [PATCH v5 69/70] docs: Mark ARB_shader_storage_buffer_object as done for i965

2015-09-10 Thread Iago Toral Quiroga
v2: - Mark it too for GLES 3.1 --- docs/GL3.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/GL3.txt b/docs/GL3.txt index 561f204..b451e41 100644 --- a/docs/GL3.txt +++ b/docs/GL3.txt @@ -164,7 +164,7 @@ GL 4.3, GLSL 4.30: GL_ARB_program_interface_query

[Mesa-dev] [PATCH v5 67/70] mesa: enable ARB_shader_storage_buffer_object extension for GLES 3.1

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Signed-off-by: Samuel Iglesias Gonsalvez Reviewed-by: Tapani Pälli --- src/glsl/glsl_parser_extras.cpp | 2 +- src/glsl/glsl_parser_extras.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_

[Mesa-dev] [PATCH v5 64/70] main/tests: add ARB_shader_storage_buffer_object tokens to enum_strings

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Signed-off-by: Samuel Iglesias Gonsalvez --- src/mesa/main/tests/enum_strings.cpp | 15 +++ 1 file changed, 15 insertions(+) diff --git a/src/mesa/main/tests/enum_strings.cpp b/src/mesa/main/tests/enum_strings.cpp index 8218cc9..96b2246 100644 --- a

[Mesa-dev] [PATCH v5 55/70] mesa: add glShaderStorageBlockBinding()

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Defined in ARB_shader_storage_buffer_object extension. Signed-off-by: Samuel Iglesias Gonsalvez --- src/mesa/main/uniforms.c | 52 src/mesa/main/uniforms.h | 4 2 files changed, 56 insertions(+) diff --git

[Mesa-dev] [PATCH v5 68/70] i965: Enable ARB_shader_storage_buffer_object extension for gen7+

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Signed-off-by: Samuel Iglesias Gonsalvez --- 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 3c764be..445b61a 10064

[Mesa-dev] [PATCH v5 65/70] glapi: add ARB_shader_storage_block_buffer_object

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Signed-off-by: Samuel Iglesias Gonsalvez Reviewed-by: Jordan Justen --- .../glapi/gen/ARB_shader_storage_buffer_object.xml | 36 ++ src/mapi/glapi/gen/GL4x.xml| 18 ++- src/mapi/glapi/gen/Makefile.am

[Mesa-dev] [PATCH v5 66/70] mesa: Add getters for the GL_ARB_shader_storage_buffer_object max constants

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez v2: - Add tessellation shader constants support v3: - Add GLES 3.1 support. v4: - Move the getters to the proper place Signed-off-by: Samuel Iglesias Gonsalvez Reviewed-by: Tapani Pälli --- src/mesa/main/get.c | 7 +++ src/mesa/main/get_hash

[Mesa-dev] [PATCH v5 58/70] glsl: Allow use of memory qualifiers with ARB_shader_storage_buffer_object.

2015-09-10 Thread Iago Toral Quiroga
--- src/glsl/glsl_lexer.ll | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/glsl/glsl_lexer.ll b/src/glsl/glsl_lexer.ll index 90e84ed..2142817 100644 --- a/src/glsl/glsl_lexer.ll +++ b/src/glsl/glsl_lexer.ll @@ -406,11 +406,11 @@ image2DShadow KEYWORD(13

[Mesa-dev] [PATCH v5 63/70] main: Add SHADER_STORAGE_BLOCK and BUFFER_VARIABLE support for ARB_program_interface_query

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Including TOP_LEVEL_ARRAY_SIZE and TOP_LEVEL_ARRAY_STRIDE queries. v2: - Use std430_array_stride() to get top level array stride following std430's rules. Signed-off-by: Samuel Iglesias Gonsalvez Reviewed-by: Tapani Pälli --- src/glsl/ir_uniform.h

[Mesa-dev] [PATCH v5 62/70] glsl: Do not allow reads from write-only buffer variables

2015-09-10 Thread Iago Toral Quiroga
The error location won't be right, but fixing that would require to check for this as we process each type of AST node that can involve a variable read. v2: - Limit the check to buffer variables, image variables have different semantics involved. --- src/glsl/ast_to_hir.cpp | 56 +++

[Mesa-dev] [PATCH v5 50/70] nir: Implement lowered SSBO atomic intrinsics

2015-09-10 Thread Iago Toral Quiroga
The original GLSL IR intrinsics have been lowered to an internal version that accepts a block index and an offset instead of a SSBO reference. v2 (Connor): - Document the sources used by the atomic intrinsics. Reviewed-by: Connor Abbott --- src/glsl/nir/glsl_to_nir.cpp | 55 +

[Mesa-dev] [PATCH v5 57/70] glsl: fix UNIFORM_BUFFER_START or UNIFORM_BUFFER_SIZE query when no buffer object is bound

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez According to ARB_uniform_buffer_object spec: "If the parameter (starting offset or size) was not specified when the buffer object was bound (e.g. if bound with BindBufferBase), or if no buffer object is bound to , zero is returned." Signed-off-by: Samuel Iglesi

[Mesa-dev] [PATCH v5 53/70] i965/vec4: Implement lowered SSBO atomic intrinsics

2015-09-10 Thread Iago Toral Quiroga
The original GLSL IR intrinsics have been lowered to an internal version that accepts a block index and an offset instead of a SSBO reference. --- src/mesa/drivers/dri/i965/brw_vec4.h | 1 + src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 103 + 2 files changed

[Mesa-dev] [PATCH v5 56/70] mesa: Add queries for GL_SHADER_STORAGE_BUFFER

2015-09-10 Thread Iago Toral Quiroga
These handle querying the buffer name attached to a giving binding point as well as the start offset and size of that buffer. --- src/mesa/main/get.c | 31 +++ 1 file changed, 31 insertions(+) diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index d5df530..24442f

[Mesa-dev] [PATCH v5 51/70] i965/nir/fs: Implement nir_intrinsic_ssbo_atomic_*

2015-09-10 Thread Iago Toral Quiroga
--- src/mesa/drivers/dri/i965/brw_fs.h | 2 + src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 77 2 files changed, 79 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h index b48134e..2016887 100644 --- a/src/mesa

[Mesa-dev] [PATCH v5 54/70] glsl: First argument to atomic functions must be a buffer variable

2015-09-10 Thread Iago Toral Quiroga
v2: - Add ssbo_in the names of the static functions so it is clear that this is specific to SSBO atomics. --- src/glsl/ast_function.cpp | 37 + 1 file changed, 37 insertions(+) diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp index 0fb89

[Mesa-dev] [PATCH v5 61/70] glsl: Do not allow assignments to read-only buffer variables

2015-09-10 Thread Iago Toral Quiroga
v2: - Merge the error check for the readonly qualifier with the already existing check for variables flagged as readonly (Timothy). - Limit the check to buffer variables, image variables have different semantics involved (Curro). --- src/glsl/ast_to_hir.cpp | 11 ++- 1 file cha

[Mesa-dev] [PATCH v5 59/70] glsl: Apply memory qualifiers to buffer variables

2015-09-10 Thread Iago Toral Quiroga
v2: - Save memory qualifier info in the top level members of a shader storage block. - Add a checks to record_compare() which is used when comparing shader storage buffer declarations in different shaders. - Always report an error for incompatible readonly/writeonly definitions, w

[Mesa-dev] [PATCH v5 49/70] glsl: lower SSBO atomic intrinsics

2015-09-10 Thread Iago Toral Quiroga
The first argument to SSBO atomics is a reference to a SSBO buffer variable so we want to compute its block index and offset and provide these values to an internal version of the intrinsic that takes them instead of the buffer variable reference. v2: - Support single components of integer vectors

[Mesa-dev] [PATCH v5 52/70] i965/nir/vec4: Implement nir_intrinsic_ssbo_atomic_*

2015-09-10 Thread Iago Toral Quiroga
--- src/mesa/drivers/dri/i965/brw_vec4.h | 1 + src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 78 ++ 2 files changed, 79 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h b/src/mesa/drivers/dri/i965/brw_vec4.h index 082e209..d152713 100644 --- a/sr

[Mesa-dev] [PATCH v5 60/70] glsl: Allow memory qualifiers on shader storage buffer blocks

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez v2: - Memory qualifiers on shader storage buffer objects do not come in the form of layout qualifiers, they are block-level qualifiers. --- src/glsl/glsl_parser.yy | 14 ++ 1 file changed, 14 insertions(+) diff --git a/src/glsl/glsl_parser.yy b/

[Mesa-dev] [PATCH v5 42/70] i965/nir/vec4: Implement nir_intrinsic_load_ssbo

2015-09-10 Thread Iago Toral Quiroga
--- src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 54 ++ 1 file changed, 54 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp index 450441d..77a2414 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp

[Mesa-dev] [PATCH v5 41/70] i965/nir/fs: Implement nir_intrinsic_load_ssbo

2015-09-10 Thread Iago Toral Quiroga
--- src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 62 1 file changed, 62 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index 6ccbf89..7fe8062 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp +++ b

[Mesa-dev] [PATCH v5 47/70] glsl: Add atomic functions from ARB_shader_storage_buffer_object

2015-09-10 Thread Iago Toral Quiroga
--- src/glsl/builtin_functions.cpp | 185 + 1 file changed, 185 insertions(+) diff --git a/src/glsl/builtin_functions.cpp b/src/glsl/builtin_functions.cpp index 73a2074..d09cc23 100644 --- a/src/glsl/builtin_functions.cpp +++ b/src/glsl/builtin_functions.cp

[Mesa-dev] [PATCH v5 46/70] glsl: Rename atomic counter functions

2015-09-10 Thread Iago Toral Quiroga
Shader Storage Buffer Object will add new atomic functions that are not associated with counters, so better have atomic counter-specific functions explicitly include the word "counter" in their names. Reviewed-by: Timothy Arceri --- src/glsl/builtin_functions.cpp | 30 +++

[Mesa-dev] [PATCH v5 48/70] glsl: use ir_rvalue instead of ir_dereference in auxiliary functions

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez In a later commit we will need to handle ir_swizzle nodes too, which are not an ir_dereference. That can happen, for example, when we pass a component of an integer vector as argument to any of the SSBO atomic functions. Signed-off-by: Samuel Iglesias Gonsalvez -

[Mesa-dev] [PATCH v5 43/70] i965/vec4: Implement __intrinsic_load_ssbo

2015-09-10 Thread Iago Toral Quiroga
--- src/mesa/drivers/dri/i965/brw_vec4.h | 1 + src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 76 ++ 2 files changed, 77 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h b/src/mesa/drivers/dri/i965/brw_vec4.h index ab62be2..082e209 100644 ---

[Mesa-dev] [PATCH v5 44/70] nir/glsl_to_nir: ignore an instruction's dest if it hasn't any

2015-09-10 Thread Iago Toral Quiroga
Reviewed-by: Connor Abbott --- src/glsl/nir/glsl_to_nir.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp index cb7b196..a387a54 100644 --- a/src/glsl/nir/glsl_to_nir.cpp +++ b/src/glsl/nir/glsl_to_nir.cpp @@ -103

[Mesa-dev] [PATCH v5 39/70] i965/vec4: Implement __intrinsic_store_ssbo

2015-09-10 Thread Iago Toral Quiroga
--- src/mesa/drivers/dri/i965/brw_vec4.h | 2 + src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 157 + 2 files changed, 159 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h b/src/mesa/drivers/dri/i965/brw_vec4.h index c0e46ad..ab62be2 100644 --

[Mesa-dev] [PATCH v5 40/70] nir: Implement __intrinsic_load_ssbo

2015-09-10 Thread Iago Toral Quiroga
v2: - Fix ssbo loads with boolean variables. Reviewed-by: Connor Abbott --- src/glsl/nir/glsl_to_nir.cpp| 80 - src/glsl/nir/nir_intrinsics.h | 2 +- src/glsl/nir/nir_lower_phis_to_scalar.c | 2 + 3 files changed, 81 insertions(+), 3 deleti

[Mesa-dev] [PATCH v5 45/70] glsl: atomic counters can be declared as buffer-qualified variables

2015-09-10 Thread Iago Toral Quiroga
From: Kristian Høgsberg --- src/glsl/ast_to_hir.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index 566cc87..a364aae 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -2789,7 +2789,7 @@ apply_ty

[Mesa-dev] [PATCH v5 32/70] glsl: shader storage blocks use different max block size values than uniforms

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Signed-off-by: Samuel Iglesias Gonsalvez --- src/glsl/linker.cpp | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index a9a6dc5..323c162 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/link

[Mesa-dev] [PATCH v5 34/70] i965/vec4: Import helpers to convert vectors into arrays and back.

2015-09-10 Thread Iago Toral Quiroga
From: Francisco Jerez These functions handle the conversion of a vec4 into the form expected by the dataport unit in message and message return payloads. The conversion is not always trivial because some messages don't support SIMD4x2 for some generations, in which case a strided copy may be nec

[Mesa-dev] [PATCH v5 31/70] glsl: ignore buffer variables when counting uniform components

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Signed-off-by: Samuel Iglesias Gonsalvez Reviewed-by: Jordan Justen --- src/glsl/link_uniforms.cpp | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp index 1d678c2..cc38287

[Mesa-dev] [PATCH v5 33/70] i965/vec4: Introduce VEC4 IR builder.

2015-09-10 Thread Iago Toral Quiroga
From: Francisco Jerez See "i965/fs: Introduce FS IR builder." for the rationale. v2: Drop scalarizing VEC4 builder. v3: Take a backend_shader as constructor argument. Improve handling of debug annotations and execution control flags. Rename "instr" variable. Initialize cursor to NULL

[Mesa-dev] [PATCH v5 37/70] i965/nir/fs: Implement nir_intrinsic_store_ssbo

2015-09-10 Thread Iago Toral Quiroga
--- src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 71 1 file changed, 71 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index 3c55a12..6ccbf89 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp +++ b

[Mesa-dev] [PATCH v5 36/70] nir: Implement __intrinsic_store_ssbo

2015-09-10 Thread Iago Toral Quiroga
v2 (Connor): - Make the STORE() macro take arguments for the extra sources (and their size) and any extra indices required. --- src/glsl/nir/glsl_to_nir.cpp | 36 src/glsl/nir/nir_intrinsics.h | 20 2 files changed, 48 insertions(+), 8

[Mesa-dev] [PATCH v5 35/70] i965/vec4: Import surface message builder functions.

2015-09-10 Thread Iago Toral Quiroga
From: Francisco Jerez Implement helper functions that can be used to construct and send untyped and typed surface read, write and atomic messages to the shared dataport unit. v2: Split from the FS implementation. v3: Rewrite to avoid evil array_reg, emit_collect and emit_zip. --- .../drivers/dr

[Mesa-dev] [PATCH v5 29/70] glsl: a shader storage buffer must be smaller than the maximum size allowed

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Otherwise, generate a link time error as per the ARB_shader_storage_buffer_object spec. v2: - Fix error message (Jordan) Signed-off-by: Samuel Iglesias Gonsalvez Reviewed-by: Jordan Justen --- src/glsl/glsl_types.cpp | 9 +++-- src/glsl/link_unif

[Mesa-dev] [PATCH v5 27/70] glsl: Add std430 interface packing support to program_resource_visitor's member functions

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez They are used to calculate the offset, array stride of uniform/shader storage buffer variables. Take into account this info to get the right value for std430. Signed-off-by: Samuel Iglesias Gonsalvez --- src/glsl/link_uniform_blocks.cpp | 19 +++--- src/glsl

[Mesa-dev] [PATCH v5 38/70] i965/nir/vec4: Implement nir_intrinsic_store_ssbo

2015-09-10 Thread Iago Toral Quiroga
--- src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 148 + 1 file changed, 148 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp index f47b029..450441d 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cp

[Mesa-dev] [PATCH v5 22/70] glsl: ignore default qualifier declarations when checking for duplicate layout qualifiers

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Signed-off-by: Samuel Iglesias Gonsalvez --- src/glsl/ast.h | 3 +++ src/glsl/glsl_parser.yy | 5 - src/glsl/glsl_parser_extras.cpp | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/glsl/ast.h b/src/glsl/ast.h i

[Mesa-dev] [PATCH v5 25/70] glsl: Add std430 related member functions to glsl_type class

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez They are used to calculate size, base alignment and array stride values for a glsl_type following std430 rules. Signed-off-by: Samuel Iglesias Gonsalvez --- src/glsl/glsl_types.cpp | 209 src/glsl/glsl_types.h |

[Mesa-dev] [PATCH v5 21/70] glsl: layout qualifier can appear more than once since OpenGL 4.20

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Also if GL_ARB_shading_language_420pack extension is enabled. Signed-off-by: Samuel Iglesias Gonsalvez --- src/glsl/glsl_parser.yy | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy in

[Mesa-dev] [PATCH v5 30/70] glsl: number of active shader storage blocks must be within allowed limits

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Notice that we should differentiate between shader storage blocks and uniform blocks, since they have different limits. Signed-off-by: Samuel Iglesias Gonsalvez Reviewed-by: Jordan Justen --- src/glsl/linker.cpp | 43 +++

[Mesa-dev] [PATCH v5 24/70] glsl: allow default qualifiers for shader storage block definitions

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez This kind of definitions: layout(xxx) buffer; was not supported by commit 84fc5fece006. Signed-off-by: Samuel Iglesias Gonsalvez --- src/glsl/glsl_parser.yy | 46 - src/glsl/glsl_parser_extras.cpp | 20 ++

[Mesa-dev] [PATCH v5 19/70] i965/wm: emit null buffer surfaces when null buffers are attached

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Otherwise we can expect odd things to happen if, for example, we ask for the size of the attached buffer from shader code, since that might query this value from the surface we uploaded and get random results. Signed-off-by: Samuel Iglesias Gonsalvez Reviewed-by:

[Mesa-dev] [PATCH v5 18/70] i965/fs/nir: implement nir_intrinsic_get_buffer_size

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Signed-off-by: Samuel Iglesias Gonsalvez --- src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 25 + 1 file changed, 25 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index a6c6a2f

[Mesa-dev] [PATCH v5 28/70] glsl: add std430 interface packing support to ssbo related operations

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez v2: - Get interface packing information from interface's type, not the variable type. - Simplify is_std430 condition in emit_access() for readability (Jordan) - Add a commment explaing why array of three-component vector case is different in std430 than the rest

[Mesa-dev] [PATCH v5 26/70] glsl: Add parser/compiler support for std430 interface packing qualifier

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez v2: - Fix a missing check in has_layout() Signed-off-by: Samuel Iglesias Gonsalvez Reviewed-by: Jordan Justen --- src/glsl/ast.h | 1 + src/glsl/ast_to_hir.cpp | 20 src/glsl/ast_type.cpp| 2 ++ src/

[Mesa-dev] [PATCH v5 05/70] i965: Set MaxShaderStorageBuffers for compute shaders

2015-09-10 Thread Iago Toral Quiroga
v2: - Set it after the driver's MaxShaderStorageBuffers value assignment. Reviewed-by: Jordan Justen --- src/mesa/drivers/dri/i965/brw_context.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 9982049

[Mesa-dev] [PATCH v5 20/70] i965/wm: surfaces should have the API buffer size, not the drm buffer size

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez The returned drm buffer object has a size multiple of 4096 but that should not be exposed to the API user, which is working with a different size. As far as I can see this problem is only visible in the calculation of the length of unsized arrays used in SSBOs, as

[Mesa-dev] [PATCH v5 15/70] i965/vec4/nir: implement nir_intrinsic_get_buffer_size

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Signed-off-by: Samuel Iglesias Gonsalvez --- src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 26 ++ 1 file changed, 26 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp index

[Mesa-dev] [PATCH v5 12/70] glsl: implement unsized array length

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez v2: - Reduce the number of lines over 80 character line width limit. (Thomas Hellan) v3: - Inject the formula to compute the array length in the IR, backends only need to provide the buffer size (Curro) - Create an auxiliary function to simplify code (Jordan J

[Mesa-dev] [PATCH v5 08/70] i965/fs: Do not split buffer variables

2015-09-10 Thread Iago Toral Quiroga
Buffer variables are the same as uniforms, only that read/write, so we want the same treatment. Reviewed-by: Jordan Justen --- src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp b/src/me

[Mesa-dev] [PATCH v5 13/70] nir: Implement ir_unop_get_buffer_size

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez This is how backends provide the buffer size required to compute the size of unsized arrays in the previous patch Signed-off-by: Samuel Iglesias Gonsalvez --- src/glsl/nir/glsl_to_nir.cpp | 10 ++ src/glsl/nir/nir_intrinsics.h | 7 +++ 2 files chan

[Mesa-dev] [PATCH v5 02/70] i965: Use 16-byte offset alignment for shader storage buffers

2015-09-10 Thread Iago Toral Quiroga
This is the same we do for other things like uniforms because it ensures optimal performance. Reviewed-by: Jordan Justen --- src/mesa/drivers/dri/i965/brw_context.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_contex

[Mesa-dev] [PATCH v5 23/70] glsl: refactor parser processing of an interface block definition

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez --- src/glsl/ast.h | 5 ++ src/glsl/glsl_parser.yy | 127 +--- src/glsl/glsl_parser_extras.cpp | 122 ++ 3 files changed, 128 insertions(+), 126 deletions(-) diff -

[Mesa-dev] [PATCH v5 09/70] glsl: return error if unsized arrays are found in OpenGL ES

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Signed-off-by: Samuel Iglesias Gonsalvez --- src/glsl/ast_to_hir.cpp | 16 1 file changed, 16 insertions(+) diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index 72c6459..b67ae70 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl

[Mesa-dev] [PATCH v5 17/70] i965/fs: Implement FS_OPCODE_GET_BUFFER_SIZE

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Signed-off-by: Samuel Iglesias Gonsalvez --- src/mesa/drivers/dri/i965/brw_defines.h| 1 + src/mesa/drivers/dri/i965/brw_fs.cpp | 1 + src/mesa/drivers/dri/i965/brw_fs.h | 3 ++ src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 47

[Mesa-dev] [PATCH v5 16/70] i965/vec4: Implement ir_unop_get_buffer_size

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Signed-off-by: Samuel Iglesias Gonsalvez --- src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 24 ++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/b

[Mesa-dev] [PATCH v5 14/70] i965/vec4: Implement VS_OPCODE_GET_BUFFER_SIZE

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Notice that Skylake needs to include a header in the sampler message so it will need some tweaks to work there. Signed-off-by: Samuel Iglesias Gonsalvez --- src/mesa/drivers/dri/i965/brw_defines.h | 3 +++ src/mesa/drivers/dri/i965/brw_shader.cpp

[Mesa-dev] [PATCH v5 03/70] i965: Implement DriverFlags.NewShaderStorageBuffer

2015-09-10 Thread Iago Toral Quiroga
We use the same dirty state for SSBOs and UBOs because they share the same infrastructure. Reviewed-by: Jordan Justen --- src/mesa/drivers/dri/i965/brw_state_upload.c | 1 + src/mesa/drivers/dri/i965/intel_buffer_objects.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/mesa/drive

[Mesa-dev] [PATCH v5 01/70] mesa: set MAX_SHADER_STORAGE_BUFFERS to 15.

2015-09-10 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez This patch sets the same value used for uniform buffers. Signed-off-by: Samuel Iglesias Gonsalvez --- src/mesa/main/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h index b35031d..69acd7

[Mesa-dev] [PATCH v5 07/70] i965: handle visiting of ir_var_shader_storage variables

2015-09-10 Thread Iago Toral Quiroga
Reviewed-by: Jordan Justen --- src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp index f6e59ce..ec41262 100644 --- a/src/mesa/driv

[Mesa-dev] [PATCH v5] i965/vec4: Don't unspill the same register in consecutive instructions

2015-09-04 Thread Iago Toral Quiroga
If we have spilled/unspilled a register in the current instruction, avoid emitting unspills for the same register in the same instruction or consecutive instructions following the current one as long as they keep reading the spilled register. This should allow us to avoid emitting costy unspills th

[Mesa-dev] [PATCH v4] i965/vec4: Don't unspill the same register in consecutive instructions

2015-09-04 Thread Iago Toral Quiroga
If we have spilled/unspilled a register in the current instruction, avoid emitting unspills for the same register in the same instruction or consecutive instructions following the current one as long as they keep reading the spilled register. This should allow us to avoid emitting costy unspills th

[Mesa-dev] [PATCH] nir: UBO loads no longer use const_index[1]

2015-09-01 Thread Iago Toral Quiroga
Commit 2126c68e5cba killed the array elements parameter on load/store intrinsics that was stored in const_index[1]. It looks like that patch missed to remove this assignment in the UBO path. --- src/glsl/nir/glsl_to_nir.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/glsl/nir/glsl_to_ni

[Mesa-dev] [PATCH v4 (part2) 24/59] glsl: a shader storage buffer must be smaller than the maximum size allowed

2015-08-05 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Otherwise, generate a link time error as per the ARB_shader_storage_buffer_object spec. Signed-off-by: Samuel Iglesias Gonsalvez --- src/glsl/glsl_types.cpp | 9 +++-- src/glsl/link_uniform_blocks.cpp | 17 + src/glsl/linker.cpp

[Mesa-dev] [PATCH v4 (part2) 31/59] i965/vec4: Implement SSBO reads

2015-08-05 Thread Iago Toral Quiroga
--- src/mesa/drivers/dri/i965/brw_vec4.h | 1 + src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 76 ++ 2 files changed, 77 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h b/src/mesa/drivers/dri/i965/brw_vec4.h index ab1ff81..8cbf3b4 100644 ---

[Mesa-dev] [PATCH v4 (part2) 25/59] glsl: number of active shader storage blocks must be within allowed limits

2015-08-05 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Notice that we should differentiate betweeb shader storage blocks and uniform blocks, since they have different limits. Signed-off-by: Samuel Iglesias Gonsalvez --- src/glsl/linker.cpp | 43 +++ 1 file changed, 39 insertio

[Mesa-dev] [PATCH v4 (part2) 16/59] i965/fs: Implement generator code for unsized array's length calculation

2015-08-05 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Signed-off-by: Samuel Iglesias Gonsalvez --- src/mesa/drivers/dri/i965/brw_defines.h| 1 + src/mesa/drivers/dri/i965/brw_fs.cpp | 1 + src/mesa/drivers/dri/i965/brw_fs.h | 3 ++ src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 47

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