[Mesa-dev] [PATCH] main: fix GL_MAX_NUM_ACTIVE_VARIABLES value for shader storage blocks

2015-10-27 Thread Samuel Iglesias Gonsalvez
.functional.program_interface_query.shader_storage_block.active_variables.block_array Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/mesa/main/program_resource.c | 21 - 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/program_resource.c b/src/mesa/main/program_resource.c

[Mesa-dev] [PATCH] main: fix basename match's check if it's an array or struct

2015-10-27 Thread Samuel Iglesias Gonsalvez
array dEQP-GLES31.functional.program_interface_query.shader_storage_block.resource_list.block_array_single_element Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/mesa/main/shader_query.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[Mesa-dev] [PATCH v2] main: Remove interface block array index for doing the name comparison

2015-10-26 Thread Samuel Iglesias Gonsalvez
etProgramResourceName() (Tapani) Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> Cc: Tapani Pälli <tapani.pa...@intel.com> --- src/mesa/main/shader_query.cpp | 43 +- 1 file changed, 42 insertions(+), 1 deletion(-) diff --

[Mesa-dev] [PATCH] glsl: add buffer block number information to atomic counter variables.

2015-10-23 Thread Samuel Iglesias Gonsalvez
.functional.atomic_counter.* tests and 9 dEQP-GLES31.functional.synchronization.inter_call. without_memory_barrier.ssbo_atomic_counter_mixed_dispatch_* tests for i965 driver. Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/glsl/ir.h| 1 + sr

[Mesa-dev] [PATCH 1/2] main: Remove interface block array index for doing the name comparison

2015-10-22 Thread Samuel Iglesias Gonsalvez
ck.resource_list.block_array dEQP-GLES31.functional.program_interface_query.shader_storage_block.resource_list.block_array_single_element Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> Cc: Tapani Pälli <tapani.pa...@intel.com> --- src/mesa/main/program_resource.c | 6 ++--- src/mesa/main/shader_query.cpp | 58 +++

[Mesa-dev] [PATCH 2/2] glsl: fix GL_BUFFER_DATA_SIZE value for shader storage blocks with unsize arrays

2015-10-22 Thread Samuel Iglesias Gonsalvez
EQP-GLES31.functional.program_interface_query.shader_storage_block.buffer_data_size.named_block dEQP-GLES31.functional.program_interface_query.shader_storage_block.buffer_data_size.unnamed_block dEQP-GLES31.functional.program_interface_query.shader_storage_block.buffer_data_size.block_array Signed-off-by: Samuel Iglesias Gonsalvez <sigles.

[Mesa-dev] [RFC PATCH] i965: book space at the end of p->store for SEND opcodes to avoid invalid memory access

2015-10-21 Thread Samuel Iglesias Gonsalvez
ecutive SEND at the end of the store table. That should be enough to avoid this invalid memory access problem. Fixes ~120 dEQP-GLES31.functional.ssbo.* tests. Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/mesa/drivers/dri/i965/brw_eu_emit.c | 12 +++-

[Mesa-dev] i965: Invalid memory accesses after resizing brw_codegen's store table

2015-10-21 Thread Samuel Iglesias Gonsalvez
tober/097183.html [1] $ git clone -b dEQP-functional-ssbo-fixes-v1 \ https://github.com/Igalia/mesa.git Samuel Iglesias Gonsalvez (1): i965: book space at the end of p->store for SEND opcodes to avoid invalid memory access src/mesa/drivers/dri/i965/brw_eu_emit.c | 12 +++- 1 f

[Mesa-dev] [PATCH] glsl: fix shader storage block member rules when adding program resources

2015-10-21 Thread Samuel Iglesias Gonsalvez
dEQP-GLES31.functional.ssbo.layout.random.all_per_block_buffers.33 dEQP-GLES31.functional.ssbo.layout.random.all_shared_buffer.3 Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/glsl/linker.cpp | 34 +- 1 file changed, 29 insertions

[Mesa-dev] [PATCH] glsl: fix segfault when indirect indexing a buffer variable which is an array

2015-10-19 Thread Samuel Iglesias Gonsalvez
Fixes a regression added by bb5aeb854915ba67abc56257f830d002c956439e. Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- Piglit test that checks the regression: http://patchwork.freedesktop.org/patch/62183/ src/glsl/lower_ubo_reference.cpp | 2 +- 1 file chan

[Mesa-dev] [PATCH] glsl: fix check SSBOs support for builtin functions

2015-10-16 Thread Samuel Iglesias Gonsalvez
.* Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/glsl/builtin_functions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glsl/builtin_functions.cpp b/src/glsl/builtin_functions.cpp index f0f6be2..aae25f8 100644 --- a/sr

[Mesa-dev] [PATCH] glsl: fix matrix stride calculation for std430's row_major matrices with two columns

2015-10-13 Thread Samuel Iglesias Gonsalvez
array_basic_type.std430.row_major_mat2 dEQP-GLES31.functional.ssbo.layout.instance_array_basic_type.std430.row_major_mat2x3 dEQP-GLES31.functional.ssbo.layout.instance_array_basic_type.std430.row_major_mat2x4 v2: - Add spec quote in both commit log and code (Timothy) Signed-off-by: Samuel Igl

[Mesa-dev] [PATCH v3 2/6] main: fix TOP_LEVEL_ARRAY_SIZE and TOP_LEVEL_ARRAY_STRIDE

2015-10-07 Thread Samuel Iglesias Gonsalvez
storage block is instanced - Write auxiliary function to do the check. Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> Tested-by: Tapani Pälli <tapani.pa...@intel.com> --- src/mesa/main/shader_query.cpp | 51 +- 1 file changed, 5

[Mesa-dev] [PATCH v3 3/6] main: consider that unsized arrays have at least one active element

2015-10-07 Thread Samuel Iglesias Gonsalvez
d_array flag (Timothy) Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/mesa/main/shader_query.cpp | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp index 56f990b..3748b

[Mesa-dev] [PATCH v3 1/6] main: fix goto in program_resource_top_level_array_stride

2015-10-07 Thread Samuel Iglesias Gonsalvez
Use found_top_level_array_stride instead of found_top_level_array_size. Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/mesa/main/shader_query.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/shader_query.cpp b/src/mes

[Mesa-dev] [PATCH v3 4/6] main: buffer array variables can have array size of 0 if they are unsized

2015-10-07 Thread Samuel Iglesias Gonsalvez
an array_stride > 0. Use it instead of is_unsized_array flag (Timothy). Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/mesa/main/shader_query.cpp | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/shader_query.cpp b/src/

[Mesa-dev] [PATCH v3 6/6] main: fix length of values written to glGetProgramResourceiv() for ACTIVE_VARIABLES

2015-10-07 Thread Samuel Iglesias Gonsalvez
Return the number of values written. Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/mesa/main/shader_query.cpp | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp

[Mesa-dev] [PATCH v3 5/6] glsl: fix matrix stride calculation for std430's row_major matrices with two columns

2015-10-07 Thread Samuel Iglesias Gonsalvez
.row_major_mat2x3 dEQP-GLES31.functional.ssbo.layout.instance_array_basic_type.std430.row_major_mat2x4 Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/glsl/lower_ubo_reference.cpp | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/glsl/lower_ubo_referen

[Mesa-dev] [PATCH] main: fix length of values written to glGetProgramResourceiv() for ACTIVE_VARIABLES

2015-10-06 Thread Samuel Iglesias Gonsalvez
Return the number of values written. Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/mesa/main/shader_query.cpp | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp

[Mesa-dev] [PATCH v2] main: buffer array variables can have array size of 0 if they are unsized

2015-10-06 Thread Samuel Iglesias Gonsalvez
to an array of basic types, the value one is written to . If the variable is a shader storage block member in an array with no declared size, the value zero is written to . v2: - Unsized arrays of arrays have an array size different than zero Signed-off-by: Samuel Iglesias Gonsalvez <sig

[Mesa-dev] [PATCH v2] glsl: Add is_unsized_array flag to gl_uniform_storage

2015-10-06 Thread Samuel Iglesias Gonsalvez
v2: - Fix uniform's is_unsized_array flag assignment Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/glsl/ir_uniform.h | 5 + src/glsl/link_uniforms.cpp | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/glsl/ir_uniform.h b/src/glsl/ir_uniform.h

[Mesa-dev] [PATCH 2/4] glsl: Add SSBO's load/store/unsize-array-length-calculation support for AoA

2015-10-06 Thread Samuel Iglesias Gonsalvez
Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> Cc: Timothy Arceri <t_arc...@yahoo.com.au> --- src/glsl/lower_ubo_reference.cpp | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/glsl/lower_ubo_reference.cpp b/src/glsl/lower_ubo_r

[Mesa-dev] [PATCH 1/4] glsl: add std430 layout support for AoA

2015-10-06 Thread Samuel Iglesias Gonsalvez
Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> Cc: Timothy Arceri <t_arc...@yahoo.com.au> --- src/glsl/glsl_types.cpp | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp index c53ba20..3c

[Mesa-dev] [PATCH 3/4] glsl: fix std430's array_stride calculation for AoA

2015-10-06 Thread Samuel Iglesias Gonsalvez
Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> Cc: Timothy Arceri <t_arc...@yahoo.com.au> --- src/glsl/link_uniforms.cpp | 2 +- src/glsl/lower_ubo_reference.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/glsl/link_uniforms.cp

[Mesa-dev] [PATCH 4/4] main: array stride for unsized arrays of arrays are calculated like records

2015-10-06 Thread Samuel Iglesias Gonsalvez
Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> Cc: Timothy Arceri <t_arc...@yahoo.com.au> --- src/mesa/main/shader_query.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp index a1c8

[Mesa-dev] [PATCH 0/4] std430 layout support for AoA

2015-10-06 Thread Samuel Iglesias Gonsalvez
Hello, This series adds std430 layour support for Arrays of Arrays. It should be applied on top of latest Timothy's work: http://lists.freedesktop.org/archives/mesa-dev/2015-September/094652.html Piglit patches will be sent soon. Thanks, Sam Samuel Iglesias Gonsalvez (4): glsl: add std430

[Mesa-dev] [PATCH v2] main: fix TOP_LEVEL_ARRAY_SIZE and TOP_LEVEL_ARRAY_STRIDE

2015-10-06 Thread Samuel Iglesias Gonsalvez
Gonsalvez <sigles...@igalia.com> Tested-by: Tapani Pälli <tapani.pa...@intel.com> v2: - Fix check when the shader storage block is instanced - Write auxiliary function to do the check. Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/mesa/main/sha

[Mesa-dev] [PATCH 4/6] main: consider that unsized arrays have at least one active element

2015-10-02 Thread Samuel Iglesias Gonsalvez
(and name length) of the active variables. When it is an unsized array, we want to indicate it has one active element so the returned name would have "[0]" at the end. Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/mesa/main/shader_query.cpp | 6 +- 1

[Mesa-dev] [PATCH 2/6] main: fix goto in program_resource_top_level_array_stride

2015-10-02 Thread Samuel Iglesias Gonsalvez
Use found_top_level_array_stride instead of found_top_level_array_size. Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/mesa/main/shader_query.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesa/main/shader_query.cpp b/src/mes

[Mesa-dev] [PATCH 1/6] main: fix TOP_LEVEL_ARRAY_SIZE and TOP_LEVEL_ARRAY_STRIDE

2015-10-02 Thread Samuel Iglesias Gonsalvez
.functional.ssbo.layout.single_basic_array.std140.column_major_mat3x4 dEQP-GLES31.functional.ssbo.layout.single_basic_array.std430.mat3x4 dEQP-GLES31.functional.ssbo.layout.single_basic_array.std430.row_major_mat3x4 dEQP-GLES31.functional.ssbo.layout.single_basic_array.std430.column_major_mat3x4 Signed-off-by: Samuel Iglesias

[Mesa-dev] [PATCH 6/6] glsl: fix matrix stride calculation for std430's row_major matrices with two columns

2015-10-02 Thread Samuel Iglesias Gonsalvez
.row_major_mat2x3 dEQP-GLES31.functional.ssbo.layout.instance_array_basic_type.std430.row_major_mat2x4 Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/glsl/lower_ubo_reference.cpp | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/glsl/lower_ubo_referen

[Mesa-dev] [PATCH 5/6] main: buffer array variables can have array size of 0 if they are unsized

2015-10-02 Thread Samuel Iglesias Gonsalvez
to an array of basic types, the value one is written to . If the variable is a shader storage block member in an array with no declared size, the value zero is written to . Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/mesa/main/shader_query.cpp | 6 +-

[Mesa-dev] [PATCH 3/6] glsl: Add is_unsized_array flag to gl_uniform_storage

2015-10-02 Thread Samuel Iglesias Gonsalvez
--- src/glsl/ir_uniform.h | 5 + src/glsl/link_uniforms.cpp | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/glsl/ir_uniform.h b/src/glsl/ir_uniform.h index 858a7da..6954759 100644 --- a/src/glsl/ir_uniform.h +++ b/src/glsl/ir_uniform.h @@ -199,6 +199,11 @@ struct

[Mesa-dev] [PATCH] glsl: emit row_major matrix's SSBO stores only for components in writemask

2015-10-01 Thread Samuel Iglesias Gonsalvez
disabled component. Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/glsl/lower_ubo_reference.cpp | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/glsl/lower_ubo_reference.cpp b/src/glsl/lower_ubo_reference.cpp index e581306..247620e 100644 --- a/sr

[Mesa-dev] [PATCH v2] i965/vec4/nir: add nir_intrinsic_memory_barrier support

2015-09-29 Thread Samuel Iglesias Gonsalvez
Fix OpenGL ES 3.1 conformance tests: advanced-readWrite-case1-vsfs and advanced-matrix-vsfs. v2: - Fix SHADER_OPCODE_MEMORY_FENCE emission and the allocation of 'tmp' (Francisco). Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> Tested-by: Tapani Pälli <tapani.pa...@

[Mesa-dev] [PATCH v2] glsl: apply shader storage block member rules when adding program resources

2015-09-29 Thread Samuel Iglesias Gonsalvez
array element." v2: - Simplify 'if' conditions and return true if it is not a buffer variable, because these rules only apply to buffer variables (Timothy). Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/glsl

[Mesa-dev] [PATCH] glsl: assert base_alignment > 0 for records

2015-09-29 Thread Samuel Iglesias Gonsalvez
From GLSL 1.50 spec, section 4.1.8 "Structures": "Structures must have at least one member declaration." So the base_alignment should be higher than zero. Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> Cc: Ilia Mirkin <imir...@alum.mit.edu> ---

[Mesa-dev] [PATCH] util: use strnlen() in strndup() implementations

2015-09-29 Thread Samuel Iglesias Gonsalvez
If the string being copied is not NULL-terminated the result of strlen() is undefined. Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/util/ralloc.c | 5 + src/util/strndup.c | 6 ++ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/util/ra

[Mesa-dev] [PATCH] util: implement strndup for WIN32

2015-09-28 Thread Samuel Iglesias Gonsalvez
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92124 Cc: Jose Fonseca --- I tested it on MSVC but not MinGW. I hope I did not something wrong. src/mesa/main/shader_query.cpp | 1 + src/util/Makefile.sources | 1 + src/util/strndup.c | 47

[Mesa-dev] [PATCH] main: replace str*dup() by str*cpy() to be compliant with C89, C99.

2015-09-28 Thread Samuel Iglesias Gonsalvez
); ^ Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92124 Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/mesa/main/shader_query.cpp | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/mes

[Mesa-dev] [PATCH 2/6] mesa: rename gl_shader_program's NumUniformBlocks to NumUniformShaderStorageBlocks

2015-09-25 Thread Samuel Iglesias Gonsalvez
Because it counts shader storage blocks too. Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/glsl/link_uniform_initializers.cpp | 2 +- src/glsl/link_uniforms.cpp | 4 ++-- src/glsl/linker.cpp| 10 +

[Mesa-dev] [PATCH 5/6] glsl: apply shader storage block member rules when adding program resources

2015-09-25 Thread Samuel Iglesias Gonsalvez
array element." Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/glsl/linker.cpp | 56 + 1 file changed, 56 insertions(+) diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index be04f5b..8cc9350 10064

[Mesa-dev] [PATCH 6/6] docs: mention ARB_shader_storage_buffer_object on 11.1.0 release notes

2015-09-25 Thread Samuel Iglesias Gonsalvez
Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- docs/relnotes/11.1.0.html | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/relnotes/11.1.0.html b/docs/relnotes/11.1.0.html index e28fab6..c755c98 100644 --- a/docs/relnotes/11.1.0.html +++ b/docs/relnotes/11.1.

[Mesa-dev] [PATCH 1/6] main: fix ACTIVE_UNIFORM_BLOCKS value

2015-09-25 Thread Samuel Iglesias Gonsalvez
NumUniformBlocks also counts shader storage blocks. NumUniformBlocks variable will be renamed in a later patch to avoid misunderstandings. Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/mesa/main/shaderapi.c | 9 +++-- 1 file changed, 7 insertions(+), 2 del

[Mesa-dev] [PATCH 3/6] glsl: return the number of uniform blocks in error message

2015-09-25 Thread Samuel Iglesias Gonsalvez
Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/glsl/linker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index d6a62bf..be04f5b 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -

[Mesa-dev] [PATCH 4/6] main/tests: Enable glShaderStorageBlockBinding() check in dispatch_sanity test

2015-09-25 Thread Samuel Iglesias Gonsalvez
Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/mesa/main/tests/dispatch_sanity.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index 0ddda59..b19c6d7

[Mesa-dev] [PATCH 2/2] nir: Implement __intrinsic_load_ssbo

2015-09-23 Thread Samuel Iglesias Gonsalvez
From: Iago Toral Quiroga v2: - Fix ssbo loads with boolean variables. v3: - Simplify the changes (Kristian) Reviewed-by: Connor Abbott --- src/glsl/nir/glsl_to_nir.cpp| 66 +

[Mesa-dev] [PATCH 1/2] nir: modify the instruction insertion in nir_visitor::visit(ir_call *ir)

2015-09-23 Thread Samuel Iglesias Gonsalvez
This patch moves nir_instr_insert_after_cf_list call into each case in the intrinsics switch at nir_visitor::visit(ir_call *ir) and define a nir_dest variable which will be used when handling ir->return_deref after the switch. This patch simplifies the code for nir_intrinsic_load_ssbo

[Mesa-dev] [PATCH 0/2] Simplify nir_visitor::visit(ir_call *ir) changes for SSBO load

2015-09-23 Thread Samuel Iglesias Gonsalvez
ion of this patch. Sam Iago Toral Quiroga (1): nir: Implement __intrinsic_load_ssbo Samuel Iglesias Gonsalvez (1): nir: modify the instruction insertion in nir_visitor::visit(ir_call *ir) src/glsl/nir/glsl_to_nir.cpp| 79 +++-- src/glsl/nir/nir_intrinsic

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

2015-09-22 Thread Samuel Iglesias Gonsalvez
v2: - Fix a missing check in has_layout() v3: - Mention shader storage block in error message for layout qualifiers (Kristian). Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> Reviewed-by: Jordan Justen <jordan.l.jus...@intel.com> --- src/glsl/ast.h

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

2015-09-22 Thread Samuel Iglesias Gonsalvez
v2: - Remove inst->regs_written assignment as the instruction only writes to one register. Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 24 1 file changed, 24 insertions(+) diff --git a/src/mes

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

2015-09-22 Thread Samuel Iglesias Gonsalvez
They are used to calculate size, base alignment and array stride values for a glsl_type following std430 rules. v2: - Paste OpenGL 4.3 spec wording as it mentions stride of array. (Jordan) Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> Reviewed-by: Jordan Justen <jor

[Mesa-dev] [PATCH 1/2] glsl: fix indention in glsl_types.cpp

2015-09-22 Thread Samuel Iglesias Gonsalvez
No functional changes. Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/glsl/glsl_types.cpp | 140 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp

[Mesa-dev] [PATCH 2/2] glsl: Add unsized array support to glsl_type::std140_size()

2015-09-22 Thread Samuel Iglesias Gonsalvez
--- src/glsl/glsl_types.cpp | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp index b4525eb..07d7248 100644 --- a/src/glsl/glsl_types.cpp +++ b/src/glsl/glsl_types.cpp @@ -1351,7 +1351,7 @@ glsl_type::std140_size(bool

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

2015-09-22 Thread Samuel Iglesias Gonsalvez
cpp instead of using state->ARB_shader_storage_buffer_object_enable (Tapani). Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- src/glsl/ast_function.cpp | 13 + src/glsl/ir.cpp | 7 +++ s

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

2015-09-22 Thread Samuel Iglesias Gonsalvez
to std430_array_stride(). v3: - Simplify size_mul change for std430's case (Jordan) - Fix commit log lines length (Jordan) - Pass 'packing' instead of 'is_std430' to emit_access() (Kristian) Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> Reviewed-by: Jordan Justen <jor

[Mesa-dev] [PATCH] glsl: Move interface block processing to glsl_parser_extras.cpp

2015-09-22 Thread Samuel Iglesias Gonsalvez
No functional changes. --- 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 --git

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

2015-09-22 Thread Samuel Iglesias Gonsalvez
Otherwise, generate a link time error as per the ARB_shader_storage_buffer_object spec. v2: - Fix error message (Jordan) v3: - Move std140_size() changes to its own patch (Kristian) Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> Reviewed-by: Jordan Justen <jor

[Mesa-dev] [PATCH] i965/vec4/nir: add nir_intrinsic_memory_barrier support

2015-09-15 Thread Samuel Iglesias Gonsalvez
Fix OpenGL ES 3.1 conformance tests: advanced-readWrite-case1-vsfs and advanced-matrix-vsfs. Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> Tested-by: Tapani Pälli <tapani.pa...@intel.com> Cc: Francisco Jerez <curroje...@riseup.net> --- src/mesa/drivers/dri/i96

[Mesa-dev] [PATCH 14/17] glsl: Add user-defined default precision qualifiers to the symbol table

2015-07-29 Thread Samuel Iglesias Gonsalvez
From: Iago Toral Quiroga ito...@igalia.com Notice that the spec requires that a default precision has been set for every type used by a shader that can use a precision qualifier and does not have a predefined precision, however, at the moment, Mesa only checks this for floats in the fragment

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

2015-07-29 Thread Samuel Iglesias Gonsalvez
From: Antia Puentes apuen...@igalia.com 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

[Mesa-dev] [PATCH 11/17] mesa: Fix error returned by glCopyTexImage2D() upon an invalid internal format

2015-07-29 Thread Samuel Iglesias Gonsalvez
From: Eduardo Lima Mitev el...@igalia.com Page 161 of the OpenGL-ES 3.1 (PDF) spec, and page 207 of the OpenGL 4.5 (PDF), both on section '8.6. ALTERNATE TEXTURE IMAGE SPECIFICATION COMMANDS', states: An INVALID_ENUM error is generated if an invalid value is specified for

[Mesa-dev] [PATCH 04/17] i965/blorp: Improve precission of blitting coordinates when clipping

2015-07-29 Thread Samuel Iglesias Gonsalvez
From: Iago Toral Quiroga ito...@igalia.com We do this in two steps: first we clip the dst rect and adjust the src rect accordingly. Then we do it the other way around. In both passes the adjustment part involves multiplying by a scale factor that can lead to a small precision loss. This is

[Mesa-dev] [PATCH 05/17] mesa: Fix GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE for default framebuffer.

2015-07-29 Thread Samuel Iglesias Gonsalvez
From: Iago Toral Quiroga ito...@igalia.com From section 9.2. Binding and Managing Framebuffer Objects: Upon successful return from Get*FramebufferAttachmentParameteriv, if pname is FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, then params will contain one of NONE, FRAMEBUFFER_DEFAULT, TEXTURE, or

[Mesa-dev] [PATCH 00/17] dEQP fixes

2015-07-29 Thread Samuel Iglesias Gonsalvez
qualifiers to the symbol table glsl: Add precision information to ir_variable glsl: Add link time checks for GLSL precision qualifiers glsl: Precision qualifiers are not allowed on structs Samuel Iglesias Gonsalvez (1): mesa: fix deletion of inactive bound transform feedback object src

[Mesa-dev] [PATCH 03/17] mesa: fix deletion of inactive bound transform feedback object

2015-07-29 Thread Samuel Iglesias Gonsalvez
reverts to 0 (the default framebuffer object). Fixes: dEQP-GLES3.functional.lifetime.delete_bound.transform_feedback Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com --- src/mesa/main/transformfeedback.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git

[Mesa-dev] [PATCH 15/17] glsl: Add precision information to ir_variable

2015-07-29 Thread Samuel Iglesias Gonsalvez
From: Iago Toral Quiroga ito...@igalia.com We will need this later on when we implement proper support for precision qualifiers in the drivers and also to do link time checks for uniforms as indicated by the spec. This patch also adds compile-time checks for variables without precision

[Mesa-dev] [PATCH 17/17] glsl: Precision qualifiers are not allowed on structs

2015-07-29 Thread Samuel Iglesias Gonsalvez
From: Iago Toral Quiroga ito...@igalia.com As the comment in precision_qualifier_allowed() says, they are only allowed for float, integer and sampler types. --- src/glsl/ast_to_hir.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index

[Mesa-dev] [PATCH 12/17] glsl: Add API to put default precision qualifiers in the symbol table

2015-07-29 Thread Samuel Iglesias Gonsalvez
From: Iago Toral Quiroga ito...@igalia.com These have scoping rules that match the ones defined for other things such as variables, so we want them in the symbol table. --- src/glsl/glsl_symbol_table.cpp | 24 src/glsl/glsl_symbol_table.h | 2 ++ 2 files changed, 26

[Mesa-dev] [PATCH 16/17] glsl: Add link time checks for GLSL precision qualifiers

2015-07-29 Thread Samuel Iglesias Gonsalvez
From: Iago Toral Quiroga ito...@igalia.com Currently, we only consider precision qualifiers at compile-time. This patch adds precision information to ir_variable so we can also do link time checks. Specifically, from the GLSL ES3 spec, 4.5.3 Precision Qualifiers: The same uniform declared in

[Mesa-dev] [PATCH 02/17] glsl: Add function parameter declarations to the symbol table

2015-07-29 Thread Samuel Iglesias Gonsalvez
From: Iago Toral Quiroga ito...@igalia.com So they can hide declarations with the same name in other scopes. Otherwise we get a parsing error for things like: struct S { int val; }; int func (int S) { return S; } Fixes the following 2 dEQP tests:

[Mesa-dev] [PATCH 09/17] mesa: Validate target before resolving tex obj in glTex(ture)SubImageXD

2015-07-29 Thread Samuel Iglesias Gonsalvez
From: Eduardo Lima Mitev el...@igalia.com Currently, glTexSubImageXD attempt to resolve the texture object (by calling _mesa_get_current_tex_object()) before validating the given target. However, that method explicitly states that target must have been validated before calling it, so it never

[Mesa-dev] [PATCH 10/17] mesa: Add missing check of format and type in glTexSubImageXD on GLES 3.0

2015-07-29 Thread Samuel Iglesias Gonsalvez
From: Eduardo Lima Mitev el...@igalia.com Argument validation for glTexSubImageXD is missing a check of format and type against texture object's internal format when profile is OpenGL-ES 3.0+. This patch also groups together all format and type checks into a single block of code for clarity.

[Mesa-dev] [PATCH 06/17] mesa: Fix errors values returned by glShaderBinary()

2015-07-29 Thread Samuel Iglesias Gonsalvez
From: Eduardo Lima Mitev el...@igalia.com Page 68, section 7.2 'Shader Binaries of the of the OpenGL ES 3.1, and page 88 of the OpenGL 4.5 specs state: An INVALID_VALUE error is generated if count or length is negative. An INVALID_ENUM error is generated if binaryformat is not a

[Mesa-dev] [PATCH 01/17] glsl: Add variables to symbol table also for single declarations

2015-07-29 Thread Samuel Iglesias Gonsalvez
From: Iago Toral Quiroga ito...@igalia.com We were doing this for all variables in a declaration list, but not when there was just a single declaration. As a consequence, when we used a single variable declaration to redeclare a type that existed in a previous scope we would get a parsing error,

[Mesa-dev] [PATCH 08/17] glsl: Avoid buffer overflow when assigning attribute locations

2015-07-29 Thread Samuel Iglesias Gonsalvez
From: Iago Toral Quiroga ito...@igalia.com Shaders with excessive number of attributes (16) can produce a crash due to buffer overflow in assign_attribute_or_color_locations. The overflow can happen because we declare a fixed size array that can hold up to 16 attributes and we don't check that we

[Mesa-dev] [PATCH 13/17] glsl: Add default precision qualifiers to the symbol table

2015-07-29 Thread Samuel Iglesias Gonsalvez
From: Iago Toral Quiroga ito...@igalia.com The GLSL ES spec specifies default precision qualifiers for certain types, so populate the symbol table with these. Notice that the desktop GLSL spec also indicates defaults for some types but this is not really useful since precision qualifiers are

[Mesa-dev] [PATCH v4 (part2) 52/56] mesa: Add getters for the GL_ARB_shader_storage_buffer_object max constants

2015-07-23 Thread Samuel Iglesias Gonsalvez
v2: - Add tessellation shader constants support Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com --- src/mesa/main/get.c | 1 + src/mesa/main/get_hash_params.py | 14 ++ 2 files changed, 15 insertions(+) diff --git a/src/mesa/main/get.c b/src/mesa/main

[Mesa-dev] [PATCH v4 (part2) 04/56] i965: set ARB_shader_storage_buffer_object related constant values

2015-07-23 Thread Samuel Iglesias Gonsalvez
v2: - Add tessellation shader constants assignment Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com --- src/mesa/drivers/dri/i965/brw_context.c | 12 1 file changed, 12 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965

[Mesa-dev] [PATCH] glsl/glcpp: fix SIGSEGV when checking error condition for macro redefinition

2015-07-23 Thread Samuel Iglesias Gonsalvez
://bugs.freedesktop.org/show_bug.cgi?id=91290 Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com Cc: Anuj Phogat anuj.pho...@gmail.com Cc: Carl Worth cwo...@cworth.org --- src/glsl/glcpp/glcpp-parse.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/glsl/glcpp/glcpp-parse.y b/src

[Mesa-dev] [PATCH] nir: Fix output swizzle in get_mul_for_src

2015-06-11 Thread Samuel Iglesias Gonsalvez
When we compute output swizzle, avoid reusing it as the source of the computation because, otherwise, it could calculate it wrongly. Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com --- src/glsl/nir/nir_opt_peephole_ffma.c | 5 - 1 file changed, 4 insertions(+), 1 deletion

[Mesa-dev] [PATCH] mesa/main: validate name syntax for array variables only

2015-05-18 Thread Samuel Iglesias Gonsalvez
but just to array variables. Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com Reviewed-by: Tapani Pälli tapani.pa...@intel.com --- As this patch is already reviewed, my plan is to push it tomorrow, just in case someone wants to say something about it. src/mesa/main/program_resource.c

[Mesa-dev] [PATCH v2] glsl: fix assignment of multiple scalar and vecs to matrices.

2015-04-07 Thread Samuel Iglesias Gonsalvez
. This patch fixes the following dEQP test: dEQP-GLES3.functional.shaders.conversions.matrix_combine.float_bvec4_ivec2_bool_to_mat4x2_vertex dEQP-GLES3.functional.shaders.conversions.matrix_combine.float_bvec4_ivec2_bool_to_mat4x2_fragment Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com

[Mesa-dev] [PATCH] configure: ax_check_python_mako_module.m4 sets output variable

2015-03-02 Thread Samuel Iglesias Gonsalvez
This output variables gives more flexibility for future changes in autoconf to detect if it is needed to auto-generate files and check for the auto-generation dependencies. It is still returning error when Python is not installed. Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com

[Mesa-dev] [RFC] configure.ac: Don't check for python mako module if python is not installed

2015-02-27 Thread Samuel Iglesias Gonsalvez
anyway because Python is not present when trying to autogenerate the files from mako templates. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89328 Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com --- configure.ac | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff

[Mesa-dev] [RFC 0/1] configure.ac: Don't check for python mako module if python is not installed

2015-02-27 Thread Samuel Iglesias Gonsalvez
) if test -n $PYTHON2 -a $foo_mako_found = no; then AC_MSG_ERROR([Python mako module v$PYTHON_MAKO_MODULE not found]) fi Which one do you prefer? Is there a better solution for this? Thanks, Sam [0] https://bugs.freedesktop.org/show_bug.cgi?id=89328 Samuel Iglesias Gonsalvez (1

[Mesa-dev] [PATCH v2 08/10] glsl: A shader cannot redefine or overload built-in functions in GLSL ES 3.00

2015-02-19 Thread Samuel Iglesias Gonsalvez
.functional.shaders.functions.invalid.overload_builtin_function_fragment dEQP-GLES3.functional.shaders.functions.invalid.redefine_builtin_function_vertex dEQP-GLES3.functional.shaders.functions.invalid.redefine_builtin_function_fragment No piglit regressions. Signed-off-by: Samuel Iglesias Gonsalvez

[Mesa-dev] [PATCH 1/2] configure: change required Python Mako version to 0.3.4

2015-01-13 Thread Samuel Iglesias Gonsalvez
Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com Reviewed-by: Dave Airlie airl...@redhat.com --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d4cf4b8..3c614ea 100644 --- a/configure.ac +++ b/configure.ac @@ -76,7

[Mesa-dev] [PATCH 2/2] configure: add check for GNU indent

2015-01-13 Thread Samuel Iglesias Gonsalvez
/show_bug.cgi?id=88335 Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com Tested-by: Vinson Lee v...@freedesktop.org --- configure.ac | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 3c614ea..c72fe92 100644 --- a/configure.ac +++ b

[Mesa-dev] [PATCH] mesa/format_pack: Add _mesa_pack_int_rgba_row()

2015-01-09 Thread Samuel Iglesias Gonsalvez
This will be used to unify code in pack.c. v2: - Modify pack_int_*() function generator to use c.datatype() and f.datatype() v3: - Only autogenerate pack_int_*() functions for non-normalized integer formats. Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com --- src/mesa/main

[Mesa-dev] [PATCH] glsl: fix duplicated layout qualifier detection for GS

2014-07-02 Thread Samuel Iglesias Gonsalvez
This patch fixes the duplicated layout qualifier detection for geometry shader's layout qualifiers. Also it makes the detection code more legible by defining allowed_duplicates_mask variable. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80778 Signed-off-by: Samuel Iglesias Gonsalvez

[Mesa-dev] [PATCH] glsl: fix link error with const initializers for global variable

2014-06-11 Thread Samuel Iglesias Gonsalvez
that the none-initializer shader was modified and tells the linker that it can link it with a new shader. Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com --- src/glsl/ir.cpp | 1 + src/glsl/ir.h | 1 + src/glsl/linker.cpp | 39 ++- 3

[Mesa-dev] [PATCH] i965: fix size assert for gen7 in brw_init_compaction_tables()

2014-05-08 Thread Samuel Iglesias Gonsalvez
It should compare with it's own size. Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com --- src/mesa/drivers/dri/i965/brw_eu_compact.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_eu_compact.c b/src/mesa/drivers/dri/i965

[Mesa-dev] [PATCH] mesa: fix check for dummy renderbuffer in _mesa_FramebufferRenderbufferEXT()

2014-04-03 Thread Samuel Iglesias Gonsalvez
...@gmail.com Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com --- src/mesa/main/fbobject.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 6c4f1b5..7669a0c 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa

[Mesa-dev] [PATCH] mesa: fix check for dummy renderbuffer in _mesa_FramebufferRenderbufferEXT()

2014-04-01 Thread Samuel Iglesias Gonsalvez
renderbuffertarget, otherwise an INVALID_OPERATION error is generated. This patch changes the previous returned GL_INVALID_VALUE to GL_INVALID_OPERATION. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76894 Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com --- src/mesa

[Mesa-dev] [PATCH] i965: increase the antialiased line width by 0.25

2014-03-27 Thread Samuel Iglesias Gonsalvez
aliased to 0. This patch is based on Eric Anholt's work on bug 28832. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28832 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60797 Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com --- src/mesa/drivers/dri/i965/gen6_sf_state.c

[Mesa-dev] [PATCH] i965: disable blorp's linear filtering on SNB

2014-03-27 Thread Samuel Iglesias Gonsalvez
://bugs.freedesktop.org/show_bug.cgi?id=68365 Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com --- src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 9 + 1 file changed, 9 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965