[Mesa-dev] [PATCH] glsl: non-last member unsized array on SSBO must fail compilation on GLSL ES 3.1

2017-02-10 Thread Jose Maria Casanova Crespo
Fixes: dEQP-GLES31.functional.debug.negative_coverage.log.shader.compile_compute_shader dEQP-GLES31.functional.debug.negative_coverage.callbacks.shader.compile_compute_shader dEQP-GLES31.functional.debug.negative_coverage.get_error.shader.compile_compute_shader Cc: "17.0" Signed-off-

[Mesa-dev] [PATCH] glsl: link error if unsized array not-last in ssbo

2017-02-15 Thread Jose Maria Casanova Crespo
5b2675093e863a52b610f112884ae12d42513770 The original patch was correct for GLES that should produce a compile-time error but the linker error is still necessary in desktop GL. Signed-off-by: Jose Maria Casanova Crespo --- src/compiler/glsl/link_uniform_blocks.cpp | 8 +++- 1 file changed, 7

[Mesa-dev] [PATCH v3] i965/fs: Add remove_extra_rounding_modes optimization

2017-09-11 Thread Jose Maria Casanova Crespo
diate with the rounding mode (Curro) v3: Reset optimization for every block. (Jason Ekstrand) Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Alejandro Piñeiro --- src/intel/compiler/brw_eu_defines.h | 3 ++- src/intel/compiler/brw_fs.cpp

[Mesa-dev] [PATCH v4 00/44] anv: SPV_KHR_16bit_storage/VK_KHR_16bit_storage for gen8+

2017-11-29 Thread Jose Maria Casanova Crespo
Jose Maria Casanova Crespo (24): nir: Add rounding modes enum nir: Handle fp16 rounding modes at nir_type_conversion_op spirv: Enable FPRoundingMode decorator to nir operations i965: Support for 16-bit base types in helper functions i965: Add support for control register i965/fs: Add

[Mesa-dev] [PATCH v4 03/44] nir: Add support for 16-bit types (half float, int16 and uint16)

2017-11-29 Thread Jose Maria Casanova Crespo
From: Eduardo Lima Mitev v2: Renamed glsl_half_float_type() to glsl_float16_t_type(). (Jason Ekstrand) Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Eduardo Lima Reviewed-by: Jason Ekstrand --- src/compiler/nir/nir.c | 6 ++ src/compiler/nir/nir.h

[Mesa-dev] [PATCH v4 05/44] nir: Populate conversion opcodes to 16-bit types

2017-11-29 Thread Jose Maria Casanova Crespo
From: Eduardo Lima Mitev This will include the following NIR ALU opcodes: * nir_op_i2i16 * nir_op_i2f16 * nir_op_u2u16 * nir_op_u2f16 * nir_op_f2i16 * nir_op_f2u16 * nir_op_f2f16 v2: Remove "from" 16-bit in commit subject (Topi Pohjolainen) Reviewed-by: Jason Ekstrand --- src/compiler/

[Mesa-dev] [PATCH v4 06/44] nir: Handle fp16 rounding modes at nir_type_conversion_op

2017-11-29 Thread Jose Maria Casanova Crespo
nir_type_conversion enables new operations to handle rounding modes to convert to fp16 values. Two new opcodes are enabled nir_op_f2f16_rtne and nir_op_f2f16_rtz. The undefined behaviour doesn't has any effect and uses the original nir_op_f2f16 operation. v2: Indentation fixed (Jason Ekstrand) v

[Mesa-dev] [PATCH v4 02/44] mesa/st: Handle 16-bit types at st_glsl_storage_type_size()

2017-11-29 Thread Jose Maria Casanova Crespo
From: Eduardo Lima Mitev This is basically to avoid "not handle in switch" warnings. v2: Let the new types hit the assertion instead. (Marek Olšák and Jason Ekstrand) Reviewed-by: Marek Olšák Reviewed-by: Nicolai Hähnle Reviewed-by: Jason Ekstrand --- src/mesa/state_tracker/st_glsl_type

[Mesa-dev] [PATCH v4 04/44] nir: Add rounding modes enum

2017-11-29 Thread Jose Maria Casanova Crespo
v2: Added comments describing each of the rounding modes. (Jason Ekstrand) Reviewed-by: Jason Ekstrand --- src/compiler/nir/nir.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index d50e81b46d..883f371d1f 100644 --- a/src/comp

[Mesa-dev] [PATCH v4 01/44] glsl: Add 16-bit types

2017-11-29 Thread Jose Maria Casanova Crespo
ement. (Jason Ekstrand) v3: Use GL_FLOAT16_NV instead of GL_HALF_FLOAT for consistency (Ilia Mirkin) v4: Add missing 16-bit base types support in glsl_to_nir (Eduardo Lima). Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Eduardo Lima Signed-off-by: Alejandro Piñeiro Review

[Mesa-dev] [PATCH v4 10/44] i965/vec4: Handle 16-bit types at type_size_xvec4

2017-11-29 Thread Jose Maria Casanova Crespo
From: Alejandro Piñeiro These types have similar vec4 sizes as their 32-bit counterparts. The vec4 backend doesn't support 16-bit types and probably never will, but this method is called by the scalar backend at fs_visitor::nir_setup_outputs(), so we still need to provide valid vec4 sizes for 16

[Mesa-dev] [PATCH v4 14/44] i965: Add support for control register

2017-11-29 Thread Jose Maria Casanova Crespo
Control register cr0 in i965 can be used to change the rounding modes in 32-bit to 16-bit floating-point conversions. From intel Skylake PRM, vol 07, section "Register and Tegister Regions", subsection "Control Register" (page 754): "Subregister cr0.0:ud contains normal operation control fields

[Mesa-dev] [PATCH v4 18/44] i965/fs: Add byte scattered write message and fs support

2017-11-29 Thread Jose Maria Casanova Crespo
. - Assert align1 for scattered messages and assume Gen8+. - Inline brw_set_dp_byte_scattered_write. Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Alejandro Piñeiro --- src/intel/compiler/brw_eu.h| 7 + src/intel/compiler/brw_eu_defines.h| 17

[Mesa-dev] [PATCH v4 12/44] i965/fs: Remove BRW_REGISTER_TYPE_HF assert at get_exec_type

2017-11-29 Thread Jose Maria Casanova Crespo
From: Alejandro Piñeiro Note that we don't remove the assert at i965/vec4. At this point half float support is only for the scalar backend. Reviewed-by: Jason Ekstrand --- src/intel/compiler/brw_ir_fs.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/intel/compiler/brw_ir_fs.h b/src/

[Mesa-dev] [PATCH v4 15/44] i965/fs: Define new shader opcode to set rounding modes

2017-11-29 Thread Jose Maria Casanova Crespo
code style. Signed-off-by: Alejandro Piñeiro Signed-off-by: Jose Maria Casanova Crespo Reviewed-by: Francisco Jerez Reviewed-by: Jason Ekstrand --- src/intel/compiler/brw_eu.h | 4 src/intel/compiler/brw_eu_defines.h | 16 src/intel/compiler/brw_e

[Mesa-dev] [PATCH v4 16/44] i965/fs: Enable rounding mode on f2f16 ops

2017-11-29 Thread Jose Maria Casanova Crespo
ir_op (Jason Ekstrand) Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Alejandro Piñeiro Reviewed-by: Jason Ekstrand --- src/intel/compiler/brw_fs_nir.cpp | 18 ++ 1 file changed, 18 insertions(+) diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/com

[Mesa-dev] [PATCH v4 11/44] i965: Support for 16-bit base types in helper functions

2017-11-29 Thread Jose Maria Casanova Crespo
v2: Fixed calculation of scalar size for 16-bit types. (Jason Ekstrand) Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Eduardo Lima Reviewed-by: Jason Ekstrand --- src/intel/compiler/brw_fs.cpp | 4 src/intel/compiler/brw_nir.c | 16 src/intel

[Mesa-dev] [PATCH v4 09/44] spirv/nir: Add support for SPV_KHR_16bit_storage

2017-11-29 Thread Jose Maria Casanova Crespo
From: Eduardo Lima Mitev v2: Minor changes after rebase against recent master (Alejandro Pinheiro) Reviewed-by: Jason Ekstrand --- src/compiler/spirv/nir_spirv.h| 1 + src/compiler/spirv/spirv_to_nir.c | 7 +++ 2 files changed, 8 insertions(+) diff --git a/src/compiler/spirv/nir_s

[Mesa-dev] [PATCH v4 07/44] spirv/nir: Handle 16-bit types

2017-11-29 Thread Jose Maria Casanova Crespo
From: Eduardo Lima Mitev v2: Added more missing implementations of 16-bit types. (Jason Ekstrand) v3: Store values in values[0].u16[i] (Jason Ekstrand) Include switches based on bitsize for 16-bit types (Chema Casanova) Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Eduardo

[Mesa-dev] [PATCH v4 13/44] i965/fs: Handle 32-bit to 16-bit conversions

2017-11-29 Thread Jose Maria Casanova Crespo
types. v3 (Topi Pohjolainen) - Code style fix (Jason Ekstrand) - Now nir_op_f2f16 was renamed to nir_op_f2f16_undef because conversion to f16 with undefined rounding is explicit Signed-off-by: Eduardo Lima Signed-off-by: Alejandro Piñeiro Signed-off-by: Jose Maria Casanova Crespo

[Mesa-dev] [PATCH v4 08/44] spirv: Enable FPRoundingMode decorator to nir operations

2017-11-29 Thread Jose Maria Casanova Crespo
SpvOpFConvert now manages the FPRoundingMode decorator for the returning values enabling the nir_rounding_mode in the conversion operation to fp16 values. v2: Fixed breaking of specialization constants. (Jason Ekstrand) v3: Avoid nir_rounding_mode * casting. (Jason Ekstrand) Reviewed-by: Jason E

[Mesa-dev] [PATCH v4 17/44] i965/fs: Add remove_extra_rounding_modes optimization

2017-11-29 Thread Jose Maria Casanova Crespo
diate with the rounding mode (Curro) v3: Reset optimization for every block. (Jason Ekstrand) Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Alejandro Piñeiro Reviewed-by: Jason Ekstrand --- src/intel/compiler/brw_eu_defines.h | 1 + src/intel/compiler/brw_fs.cpp

[Mesa-dev] [PATCH v4 19/44] i965/fs: Use byte_scattered_write on 16-bit store_ssbo

2017-11-29 Thread Jose Maria Casanova Crespo
/type_slots on store_ssbo. (Jose Maria Casanova) - Take into account that get_nir_src returns now WORD types for 16-bit sources instead of DWORD. Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Alejandro Piñeiro --- src/intel/compiler/brw_fs_nir.cpp | 51

[Mesa-dev] [PATCH v4 20/44] i965/fs: Add byte scattered read message and fs support

2017-11-29 Thread Jose Maria Casanova Crespo
v2: Fix alignment style (Topi Pohjolainen) (Jason Ekstrand) - Enable bit_size parameter to scattered messages to enable different bitsizes byte/word/dword. - Remove use of brw_send_indirect_scattered_message in favor of brw_send_indirect_surface_message. - Move scattered

[Mesa-dev] [PATCH v4 21/44] i965/fs: Use byte scattered read for 16-bit load_ssbo

2017-11-29 Thread Jose Maria Casanova Crespo
Used to enable 16-bit reads at do_untyped_vector_read, that is used on the following intrinsics: * nir_intrinsic_load_shared * nir_intrinsic_load_ssbo v2: Removed use of stride = 2 on 16-bit sources (Jason Ekstrand) v3: - Add bitsize to scattered read operation (Jason Ekstrand) - Remov

[Mesa-dev] [PATCH v4 24/44] anv: Enable SPV_KHR_16bit_storage on gen 8+

2017-11-29 Thread Jose Maria Casanova Crespo
From: Eduardo Lima Mitev v2: minor changes after rebase against recent master (Alejandro) --- src/intel/vulkan/anv_pipeline.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index 907b24a758..c58bd2f9a1 100644 --- a/src/intel/

[Mesa-dev] [PATCH v4 23/44] i965/fs: Enables 16-bit load_ubo with sampler

2017-11-29 Thread Jose Maria Casanova Crespo
load_ubo is using 32-bit loads as uniforms surfaces have a 32-bit surface format defined. So when reading 16-bit components with the sampler we need to unshuffle two 16-bit components from each 32-bit component. Using the sampler avoids the use of the byte_scattered_read message that needs one mes

[Mesa-dev] [PATCH v4 22/44] i965/fs: Helpers for un/shuffle 16-bit pairs in 32-bit components

2017-11-29 Thread Jose Maria Casanova Crespo
This helpers are used to load/store 16-bit types from/to 32-bit components. The functions shuffle_32bit_load_result_to_16bit_data and shuffle_16bit_data_for_32bit_write are implemented in a similar way than the analogous functions for handling 64-bit types. --- src/intel/compiler/brw_fs.h |

[Mesa-dev] [PATCH v4 25/44] anv: Enable VK_KHR_16bit_storage for SSBO and UBO

2017-11-29 Thread Jose Maria Casanova Crespo
storageBuffer16BitAccess and uniformAndStorageBuffer16BitAccess. - Only expose VK_KHR_16bit_storage on Gen8+ Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Alejandro Piñeiro --- src/intel/vulkan/anv_device.c | 13 + src/intel/vulkan/anv_extensions.py | 1 + 2 files changed, 14

[Mesa-dev] [PATCH v4 26/44] i965/fs: Optimize 16-bit SSBO stores by packing two into a 32-bit reg

2017-11-29 Thread Jose Maria Casanova Crespo
issues with writemask yz with 16-bit writes. (Jason Ektrand) Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Eduardo Lima --- src/intel/compiler/brw_fs_nir.cpp | 61 +-- 1 file changed, 46 insertions(+), 15 deletions(-) diff --git a/src/intel/compiler

[Mesa-dev] [PATCH v4 29/44] compiler: Mark when input/ouput attribute at VS uses 16-bit

2017-11-29 Thread Jose Maria Casanova Crespo
New shader attribute to mark when a location has 16-bit value. This patch includes support on mesa glsl and nir. v2: Remove use of is_half_slot as is a duplicate of is_16bit (Topi Pohjolainen) Renamed half_inputs_read to inputs_read_16bit (Jason Ekstrand) --- src/compiler/glsl_types.h

[Mesa-dev] [PATCH v4 34/44] i965/fs: Support 16-bit types at load_input and store_output

2017-11-29 Thread Jose Maria Casanova Crespo
Enables the support of 16-bit types on load_input and store_outputs intrinsics intra-stages. The approach was based on re-using the 32-bit URB read and writes between stages, shuffling pairs of 16-bit values into 32-bit values at load_store intrinsic and un-shuffling the values at load_inputs. v2

[Mesa-dev] [PATCH v4 31/44] anv/pipeline: Use 32-bit surface formats for 16-bit formats

2017-11-29 Thread Jose Maria Casanova Crespo
(example: use *R32* for *R16G16*). v2: Always use UINT surface format variants. (Topi Pohjolainen) Renamed half_inputs_read to inputs_read_16bit (Jason Ekstrand) Reword commit log (Jason Ekstrand) Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Alejandro Piñeiro --- src/intel

[Mesa-dev] [PATCH v4 27/44] i965/fs: Predicate byte scattered writes if needed

2017-11-29 Thread Jose Maria Casanova Crespo
From: Alejandro Piñeiro While on Untyped Surface messages the bits of the execution mask are ANDed with the corresponding bits of the Pixel/Sample Mask, that is not the case for byte scattered writes. That is needed to avoid ssbo stores writing on helper invocations. So when that can affect, we l

[Mesa-dev] [PATCH v4 35/44] i965/fs: Enable Render Target Write for 16-bit outputs

2017-11-29 Thread Jose Maria Casanova Crespo
ld be packed (Jason Ekstrand) Remove not necessary alignment operation for 16-bit to 32-bit conversion (Chema Casanova) Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Eduardo Lima --- src/intel/compiler/brw_fs_nir.cpp | 48 +++ 1 file cha

[Mesa-dev] [PATCH v4 32/44] anv/cmd_buffer: Add a padding to the vertex buffer

2017-11-29 Thread Jose Maria Casanova Crespo
half_inputs_read to inputs_read_16bit. Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Alejandro Piñeiro --- src/intel/vulkan/anv_device.c | 10 ++ src/intel/vulkan/genX_cmd_buffer.c | 20 ++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a

[Mesa-dev] [PATCH v4 28/44] i965/fs: Use untyped_surface_read for 16-bit load_ssbo

2017-11-29 Thread Jose Maria Casanova Crespo
SSBO loads were using byte_scattered read messages as they allow reading 16-bit size components. byte_scattered messages can only operate one component at a time so we needed to emit as many messages as components. But for vec2 and vec4 of 16-bit, being multiple of 32-bit we can use the untyped_su

[Mesa-dev] [PATCH v4 37/44] i965/fs: Include support for SEND data_format bit for Render Targets

2017-11-29 Thread Jose Maria Casanova Crespo
example: on brw_inst.h). Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Eduardo Lima Signed-off-by: Alejandro Piñeiro --- src/intel/compiler/brw_eu.h | 6 -- src/intel/compiler/brw_eu_emit.c | 25 - src/intel/compiler/brw_fs.c

[Mesa-dev] [PATCH v4 36/44] anv: Enable VK_KHR_16bit_storage for input/output

2017-11-29 Thread Jose Maria Casanova Crespo
Enables storageInputOutput16 feature of VK_KHR_16bit_storage for Gen8+. --- src/intel/vulkan/anv_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 2e5b914480..26c0ace1ca 100644 --- a/src/intel/vulkan/anv

[Mesa-dev] [PATCH v4 33/44] i965/fs: Unpack 16-bit from 32-bit components in VS load_input

2017-11-29 Thread Jose Maria Casanova Crespo
The VS load input for 16-bit values receives pairs of 16-bit values packed in 32-bit values. Because of the adjusted format used at: anv/pipeline: Use 32-bit surface formats for 16-bit formats v2: Removed use of stride = 2 on 16-bit sources (Jason Ekstrand) v3: Fix coding style and typo (Topi Po

[Mesa-dev] [PATCH v4 30/44] i965/compiler: includes 16-bit vertex input

2017-11-29 Thread Jose Maria Casanova Crespo
Includes the info about 16-bit vertex inputs coming from nir on brw VS prog data, as we already do with 64-bit vertex input. v2: Renamed half_inputs_read to inputs_read_16bit (Jason Ekstrand) --- src/intel/compiler/brw_compiler.h | 1 + src/intel/compiler/brw_vec4.cpp | 1 + 2 files changed, 2

[Mesa-dev] [PATCH v4 40/44] i965/fs: 16-bit source payloads always use 1 register

2017-11-29 Thread Jose Maria Casanova Crespo
Render Target Message's payloads for 16bit values fit in only one register. From Intel PRM vol07, page 249 "Render Target Messages" / "Message Data Payloads" "The half precision Render Target Write messages have data payloads that can pack a full SIMD16 payload into 1 register instead of

[Mesa-dev] [PATCH v4 38/44] i965/disasm: Show half-precision data_format on rt_writes

2017-11-29 Thread Jose Maria Casanova Crespo
--- src/intel/compiler/brw_disasm.c | 4 1 file changed, 4 insertions(+) diff --git a/src/intel/compiler/brw_disasm.c b/src/intel/compiler/brw_disasm.c index 1a94ed3954..c752e15331 100644 --- a/src/intel/compiler/brw_disasm.c +++ b/src/intel/compiler/brw_disasm.c @@ -1676,6 +1676,10 @@ brw_d

[Mesa-dev] [PATCH v4 43/44] i965/fs: Support push constants of 16-bit types

2017-11-29 Thread Jose Maria Casanova Crespo
We enable the use of 16-bit values in push constants modifying the assign_constant_locations function to work with 16-bit types. The API to access buffers in Vulkan use multiples of 4-byte for offsets and sizes. Current accountability of uniforms based on 4-byte slots will work for 16-bit values i

[Mesa-dev] [PATCH v4 39/44] i965/fs: Mark 16-bit outputs on FS store_output

2017-11-29 Thread Jose Maria Casanova Crespo
Maria Casanova Crespo Signed-off-by: Eduardo Lima --- src/intel/compiler/brw_fs_nir.cpp | 25 ++--- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp index fb138de76a..04d1e3bbf7 100644 --- a/src

[Mesa-dev] [PATCH v4 44/44] anv: Enable VK_KHR_16bit_storage for push_constant

2017-11-29 Thread Jose Maria Casanova Crespo
Enables storagePushConstant16 feature of VK_KHR_16bit_storage for Gen8+. --- src/intel/vulkan/anv_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 26c0ace1ca..5b6032d794 100644 --- a/src/intel/vulkan/an

[Mesa-dev] [PATCH v4 42/44] i965/fs: Enable 16-bit render target write on SKL and CHV

2017-11-29 Thread Jose Maria Casanova Crespo
messages do not support UNIT formats." where UNIT is a typo for UINT. v2: Removed use of stride = 2 on sources (Jason Ekstrand) Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Eduardo Lima --- src/intel/compiler/brw_fs_nir.cpp | 46 +++ 1 file ch

[Mesa-dev] [PATCH v4 41/44] i965/fs: Use half_precision data_format on 16-bit fb writes

2017-11-29 Thread Jose Maria Casanova Crespo
From: Alejandro Piñeiro --- src/intel/compiler/brw_fs_visitor.cpp | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/intel/compiler/brw_fs_visitor.cpp b/src/intel/compiler/brw_fs_visitor.cpp index 481d9c51e7..01e75ff7fc 100644 --- a/src/intel/compiler/brw_fs_visitor.cpp +++ b/src/int

[Mesa-dev] [PATCH v4 28/44] i965/fs: Use untyped_surface_read for 16-bit load_ssbo (v2)

2017-12-05 Thread Jose Maria Casanova Crespo
SSBO loads were using byte_scattered read messages as they allow reading 16-bit size components. byte_scattered messages can only operate one component at a time so we needed to emit as many messages as components. But for vec2 and vec4 of 16-bit, being multiple of 32-bit we can use the untyped_su

[Mesa-dev] [PATCH v4 23/44] i965/fs: Enables 16-bit load_ubo with sampler (v2)

2017-12-05 Thread Jose Maria Casanova Crespo
message that needs one message for each component and is supposed to be slower. v2: (Jason Ekstrand) - Simplify component selection and unshuffling for different bitsizes - Remove SKL optimization of reading only two 32-bit components when reading 16-bits types. Reviewed-by: Jose Maria

[Mesa-dev] [PATCH v3 00/43] anv: SPV_KHR_16bit_storage/VK_KHR_16bit_storage for gen8+

2017-10-12 Thread Jose Maria Casanova Crespo
it_storage i965/fs: Optimize 16-bit SSBO stores by packing two into a 32-bit reg anv: Enable SPV_KHR_16bit_storage on gen 8+ Jose Maria Casanova Crespo (21): nir: Add rounding modes enum nir: Handle fp16 rounding modes at nir_type_conversion_op spirv: Enable FPRoundingMode decorator to nir

[Mesa-dev] [PATCH v3 01/43] glsl: Add 16-bit types

2017-10-12 Thread Jose Maria Casanova Crespo
ement. (Jason Ekstrand) v3: Use GL_FLOAT16_NV instead of GL_HALF_FLOAT for consistency (Ilia Mirkin) v4: Add missing 16-bit base types support in glsl_to_nir (Eduardo Lima). Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Eduardo Lima Signed-off-by: Alejandro Piñeiro Review

[Mesa-dev] [PATCH v3 03/43] nir: Add support for 16-bit types (half float, int16 and uint16)

2017-10-12 Thread Jose Maria Casanova Crespo
From: Eduardo Lima Mitev v2: Renamed glsl_half_float_type() to glsl_float16_t_type(). (Jason Ekstrand) Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Eduardo Lima --- src/compiler/nir/nir.c | 6 ++ src/compiler/nir/nir.h | 9

[Mesa-dev] [PATCH v3 06/43] nir: Handle fp16 rounding modes at nir_type_conversion_op

2017-10-12 Thread Jose Maria Casanova Crespo
nir_type_conversion enables new operations to handle rounding modes to convert to fp16 values. Two new opcodes are enabled nir_op_f2f16_rtne and nir_op_f2f16_rtz. The undefined behaviour doesn't has any effect and uses the original nir_op_f2f16 operation. v2: Indentation fixed (Jason Ekstrand) --

[Mesa-dev] [PATCH v3 09/43] spirv/nir: Add support for SPV_KHR_16bit_storage

2017-10-12 Thread Jose Maria Casanova Crespo
From: Eduardo Lima Mitev v2: Minor changes after rebase against recent master (Alejandro Pinheiro) --- src/compiler/spirv/nir_spirv.h| 1 + src/compiler/spirv/spirv_to_nir.c | 7 +++ 2 files changed, 8 insertions(+) diff --git a/src/compiler/spirv/nir_spirv.h b/src/compiler/spirv/ni

[Mesa-dev] [PATCH v3 02/43] mesa/st: Handle 16-bit types at st_glsl_storage_type_size()

2017-10-12 Thread Jose Maria Casanova Crespo
From: Eduardo Lima Mitev This is basically to avoid "not handle in switch" warnings. v2: Let the new types hit the assertion instead. (Marek Olšák and Jason Ekstrand) Reviewed-by: Marek Olšák --- src/mesa/state_tracker/st_glsl_types.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git

[Mesa-dev] [PATCH v3 10/43] i965/vec4: Handle 16-bit types at type_size_xvec4

2017-10-12 Thread Jose Maria Casanova Crespo
From: Alejandro Piñeiro These types have similar vec4 sizes as their 32-bit counterparts. The vec4 backend doesn't support 16-bit types and probably never will, but this method is called by the scalar backend at fs_visitor::nir_setup_outputs(), so we still need to provide valid vec4 sizes for 16

[Mesa-dev] [PATCH v3 04/43] nir: Add rounding modes enum

2017-10-12 Thread Jose Maria Casanova Crespo
v2: Added comments describing each of the rounding modes. (Jason Ekstrand) --- src/compiler/nir/nir.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 3ab2f7dff1..fb269fcb28 100644 --- a/src/compiler/nir/nir.h +++ b/src/compi

[Mesa-dev] [PATCH v3 08/43] spirv: Enable FPRoundingMode decorator to nir operations

2017-10-12 Thread Jose Maria Casanova Crespo
SpvOpFConvert now manages the FPRoundingMode decorator for the returning values enabling the nir_rounding_mode in the conversion operation to fp16 values. v2: Fixed breaking of specialization constants. (Jason Ekstrand) --- src/compiler/spirv/vtn_alu.c | 32 1 fil

[Mesa-dev] [PATCH v3 05/43] nir: Populate conversion opcodes to/from 16-bit types

2017-10-12 Thread Jose Maria Casanova Crespo
From: Eduardo Lima Mitev This will include the following NIR ALU opcodes: * nir_op_i2i16 * nir_op_i2f16 * nir_op_u2u16 * nir_op_u2f16 * nir_op_f2i16 * nir_op_f2u16 * nir_op_f2f16 Reviewed-by: Jason Ekstrand --- src/compiler/nir/nir_opcodes_c.py | 2 +- 1 file changed, 1 insertion(+), 1

[Mesa-dev] [PATCH v3 07/43] spirv/nir: Handle 16-bit types

2017-10-12 Thread Jose Maria Casanova Crespo
From: Eduardo Lima Mitev v2: Added more missing implementations of 16-bit types. (Jason Ekstrand) Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Eduardo Lima --- src/compiler/spirv/spirv_to_nir.c | 46 -- src/compiler/spirv/vtn_variables.c | 21

[Mesa-dev] [PATCH v3 12/43] i965/fs: Add brw_reg_type_from_bit_size utility method

2017-10-12 Thread Jose Maria Casanova Crespo
BRW_REGISTER_TYPE_F v2 (Jason Ekstrand): - Use better unreachable() messages - Add Q types Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Alejandro Piñeiro --- src/intel/compiler/brw_fs_nir.cpp | 69 --- 1 file changed, 64 insertions(+), 5 deletions(-) diff

[Mesa-dev] [PATCH v3 13/43] i965/fs: Remove BRW_REGISTER_TYPE_HF assert at get_exec_type

2017-10-12 Thread Jose Maria Casanova Crespo
From: Alejandro Piñeiro Note that we don't remove the assert at i965/vec4. At this point half float support is only for the scalar backend. --- src/intel/compiler/brw_ir_fs.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/intel/compiler/brw_ir_fs.h b/src/intel/compiler/brw_ir_fs.h ind

[Mesa-dev] [PATCH v3 17/43] i965/fs: Enable rounding mode on f2f16 ops

2017-10-12 Thread Jose Maria Casanova Crespo
From: Alejandro Piñeiro By default we don't set the rounding mode. We only set round-to-near-even or round-to-zero mode if explicitly set from nir. v2: Use a single SHADER_OPCODE_RND_MODE opcode taking an immediate with the rounding mode (Curro) Signed-off-by: Jose Maria Casanova C

[Mesa-dev] [PATCH v3 15/43] i965: Add support for control register

2017-10-12 Thread Jose Maria Casanova Crespo
Control register cr0 in i965 can be used to change the rounding modes in 32-bit to 16-bit floating-point conversions. From intel Skylake PRM, vol 07, section "Register and Tegister Regions", subsection "Control Register" (page 754): "Subregister cr0.0:ud contains normal operation control fields

[Mesa-dev] [PATCH v3 14/43] i965/fs: Handle 32-bit to 16-bit conversions

2017-10-12 Thread Jose Maria Casanova Crespo
types. Signed-off-by: Eduardo Lima Signed-off-by: Alejandro Piñeiro Signed-off-by: Jose Maria Casanova Crespo --- src/intel/compiler/brw_fs_nir.cpp | 25 + 1 file changed, 25 insertions(+) diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler

[Mesa-dev] [PATCH v3 11/43] i965: Support for 16-bit base types in helper functions

2017-10-12 Thread Jose Maria Casanova Crespo
v2: Fixed calculation of scalar size for 16-bit types. (Jason Ekstrand) Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Eduardo Lima --- src/intel/compiler/brw_fs.cpp | 4 src/intel/compiler/brw_nir.c | 16 src/intel/compiler/brw_shader.cpp | 6

[Mesa-dev] [PATCH v3 18/43] i965/fs: Add remove_extra_rounding_modes optimization

2017-10-12 Thread Jose Maria Casanova Crespo
diate with the rounding mode (Curro) v3: Reset optimization for every block. (Jason Ekstrand) Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Alejandro Piñeiro Reviewed-by: Jason Ekstrand --- src/intel/compiler/brw_eu_defines.h | 1 + src/intel/compiler/brw_fs.cpp

[Mesa-dev] [PATCH v3 22/43] i965/fs: Use byte_scattered_write on 16-bit store_ssbo

2017-10-12 Thread Jose Maria Casanova Crespo
: Removed use of stride = 2 on 16-bit sources (Jason Ekstrand) Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Alejandro Piñeiro 4) + if (type_size > 4) { length = MIN2(2, length); + } else if (type_size == 2) { +/* For 16-bit types we are us

[Mesa-dev] [PATCH v3 21/43] i965/fs: Adjust type_size/type_slots on store_ssbo

2017-10-12 Thread Jose Maria Casanova Crespo
From: Alejandro Piñeiro --- src/intel/compiler/brw_fs_nir.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp index b356836e80..e108b5517b 100644 --- a/src/intel/compiler/brw_fs_nir.cpp +++ b/src/int

[Mesa-dev] [PATCH v3 19/43] i965/fs: Support push constants of 16-bit types

2017-10-12 Thread Jose Maria Casanova Crespo
We enable the use of 16-bit values in push constants modifying the assign_constant_locations function to work with 16-bit types. The API to access buffers in Vulkan use multiples of 4-byte for offsets and sizes. Current accountability of uniforms based on 4-byte slots will work for 16-bit values i

[Mesa-dev] [PATCH v3 16/43] i965/fs: Define new shader opcode to set rounding modes

2017-10-12 Thread Jose Maria Casanova Crespo
ñeiro Signed-off-by: Jose Maria Casanova Crespo Reviewed-by: Francisco Jerez --- src/intel/compiler/brw_eu.h | 4 src/intel/compiler/brw_eu_defines.h | 16 src/intel/compiler/brw_eu_emit.c| 33 + src/intel/compiler/brw_f

[Mesa-dev] [PATCH v3 20/43] i965/fs: Add byte scattered write message and fs support

2017-10-12 Thread Jose Maria Casanova Crespo
Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Alejandro Piñeiro --- src/intel/compiler/brw_eu.h| 6 ++ src/intel/compiler/brw_eu_defines.h| 17 + src/intel/compiler/brw_eu_emit.c | 89 ++ src/intel/compiler

[Mesa-dev] [PATCH v3 25/43] compiler: Mark when input/ouput attribute at VS uses 16-bit

2017-10-12 Thread Jose Maria Casanova Crespo
New shader attribute to mark when a location has 16-bit value. This patch includes support on mesa glsl and nir. --- src/compiler/glsl_types.h | 24 src/compiler/nir/nir_gather_info.c | 23 --- src/compiler/nir_types.cpp | 6 ++ sr

[Mesa-dev] [PATCH v3 27/43] anv/pipeline: Use 32-bit surface formats for 16-bit formats

2017-10-12 Thread Jose Maria Casanova Crespo
location at the shader, we use 32-bit formats to avoid the conversion, and will fix getting the proper content later. Note that as we are using 32-bit formats, we can use formats with less components (example: use *R32* for *R16G16*). Signed-off-by: Jose Maria Casanova Crespo Signed-off-by

[Mesa-dev] [PATCH v3 26/43] i965/compiler: includes 16-bit vertex input

2017-10-12 Thread Jose Maria Casanova Crespo
Includes the info about 16-bit vertex inputs coming from nir on brw VS prog data, as we already do with 64-bit vertex input. --- src/intel/compiler/brw_compiler.h | 1 + src/intel/compiler/brw_vec4.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/intel/compiler/brw_compiler.h b/src

[Mesa-dev] [PATCH v3 24/43] i965/fs: Use byte scattered read

2017-10-12 Thread Jose Maria Casanova Crespo
Added on do_untyped_vector_read, that is used on the following intrinsics: * nir_intrinsic_load_shared * nir_intrinsic_load_ubo * nir_intrinsic_load_ssbo v2: Removed use of stride = 2 on 16-bit sources (Jason Ekstrand) --- src/intel/compiler/brw_fs_nir.cpp | 24

[Mesa-dev] [PATCH v3 23/43] i965/fs: Add byte scattered read message and fs support

2017-10-12 Thread Jose Maria Casanova Crespo
--- src/intel/compiler/brw_eu.h| 7 + src/intel/compiler/brw_eu_defines.h| 2 ++ src/intel/compiler/brw_eu_emit.c | 41 ++ src/intel/compiler/brw_fs.cpp | 10 +++ src/intel/compiler/brw_fs_copy_propaga

[Mesa-dev] [PATCH v3 29/43] i965/fs: Unpack 16-bit from 32-bit components in VS load_input

2017-10-12 Thread Jose Maria Casanova Crespo
The VS load input for 16-bit values receives pairs of 16-bit values packed in 32-bit values. Because of the adjusted format used at: anv/pipeline: Use 32-bit surface formats for 16-bit formats v2: Removed use of stride = 2 on 16-bit sources (Jason Ekstrand) --- src/intel/compiler/brw_fs_nir.cpp

[Mesa-dev] [PATCH v3 28/43] anv/cmd_buffer: Add a padding to the vertex buffer

2017-10-12 Thread Jose Maria Casanova Crespo
From: Alejandro Piñeiro As we are using 32-bit surface formats with 16-bit elements we can be on a situation where a vertex element can poke over the buffer by 2 bytes. To avoid that we add a padding when flushing the state. This is similar to what the i965 drivers prior to Haswell do, as they u

[Mesa-dev] [PATCH v3 33/43] i965/disasm: Show half-precision data_format on rt_writes

2017-10-12 Thread Jose Maria Casanova Crespo
--- src/intel/compiler/brw_disasm.c | 4 1 file changed, 4 insertions(+) diff --git a/src/intel/compiler/brw_disasm.c b/src/intel/compiler/brw_disasm.c index 2043d64b27..5708284bb9 100644 --- a/src/intel/compiler/brw_disasm.c +++ b/src/intel/compiler/brw_disasm.c @@ -1439,6 +1439,10 @@ brw_d

[Mesa-dev] [PATCH v3 34/43] i965/fs: Mark 16-bit outputs on FS store_output

2017-10-12 Thread Jose Maria Casanova Crespo
Maria Casanova Crespo Signed-off-by: Eduardo Lima --- src/intel/compiler/brw_fs_nir.cpp | 25 ++--- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp index a48cf40eae..3dbdcc0955 100644 --- a/src

[Mesa-dev] [PATCH v3 35/43] i965/fs: 16-bit source payloads always use 1 register

2017-10-12 Thread Jose Maria Casanova Crespo
Render Target Message's payloads for 16bit values fit in only one register. From Intel PRM vol07, page 249 "Render Target Messages" / "Message Data Payloads" "The half precision Render Target Write messages have data payloads that can pack a full SIMD16 payload into 1 register instead of

[Mesa-dev] [PATCH v3 36/43] i965/fs: Use half_precision data_format on 16-bit fb writes

2017-10-12 Thread Jose Maria Casanova Crespo
From: Alejandro Piñeiro --- src/intel/compiler/brw_fs_visitor.cpp | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/intel/compiler/brw_fs_visitor.cpp b/src/intel/compiler/brw_fs_visitor.cpp index 758c8bf44a..e39bafdb42 100644 --- a/src/intel/compiler/brw_fs_visitor.cpp +++ b/src/int

[Mesa-dev] [PATCH v3 32/43] i965/fs: Include support for SEND data_format bit for Render Targets

2017-10-12 Thread Jose Maria Casanova Crespo
example: on brw_inst.h). Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Eduardo Lima Signed-off-by: Alejandro Piñeiro --- src/intel/compiler/brw_eu.h | 6 -- src/intel/compiler/brw_eu_emit.c | 25 - src/intel/compiler/brw_fs.c

[Mesa-dev] [PATCH v3 31/43] i965/fs: Enable Render Target Write for 16-bit outputs

2017-10-12 Thread Jose Maria Casanova Crespo
ld be packed (Jason Ekstrand) Remove not necessary alignment operation for 16-bit to 32-bit conversion (Chema Casanova) Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Eduardo Lima --- src/intel/compiler/brw_fs_nir.cpp | 48 +++ 1 file cha

[Mesa-dev] [PATCH v3 37/43] i965/fs: Enable 16-bit render target write on SKL and CHV

2017-10-12 Thread Jose Maria Casanova Crespo
messages do not support UNIT formats." where UNIT is a typo for UINT. v2: Removed use of stride = 2 on sources (Jason Ekstrand) Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Eduardo Lima --- src/intel/compiler/brw_fs_nir.cpp | 46 +++ 1 file ch

[Mesa-dev] [PATCH v3 30/43] i965/fs: Support 16-bit types at load_input and store_output

2017-10-12 Thread Jose Maria Casanova Crespo
Enables the support of 16-bit types on load_input and store_outputs intrinsics intra-stages. The approach was based on re-using the 32-bit URB read and writes between stages, shuffling pairs of 16-bit values into 32-bit values at load_store intrinsic and un-shuffling the values at load_inputs. sh

[Mesa-dev] [PATCH v3 38/43] i965/fs: Optimize 16-bit SSBO stores by packing two into a 32-bit reg

2017-10-12 Thread Jose Maria Casanova Crespo
an expensive operation. v2: Removed use of stride = 2 on sources (Jason Ekstrand) Rework optimization using shuffle 16 write and enable writes of 16bit vec4 with only one message of 32-bits. (Chema Casanova) Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Eduardo Lima --- src

[Mesa-dev] [PATCH v3 43/43] anv: Enable VK_KHR_16bit_storage

2017-10-12 Thread Jose Maria Casanova Crespo
From: Alejandro Piñeiro It uses VK_KHR_get_physical_device_properties2 functionality to expose if the extension is supported or not. v2: update due rebase against master (Alejandro) Signed-off-by: Jose Maria Casanova Crespo Signed-off-by: Alejandro Piñeiro storageBuffer16BitAccess = pdevice

[Mesa-dev] [PATCH v3 39/43] i965/fs: Enables 16-bit load_ubo with sampler

2017-10-12 Thread Jose Maria Casanova Crespo
load_ubo is using 32-bit loads as uniforms surfaces have a 32-bit surface format defined. So when reading 16-bit components with the sampler we need to unshuffle two 16-bit components from each 32-bit component. Using the sampler avoids the use of the byte_scattered_read message that needs one mes

[Mesa-dev] [PATCH v3 41/43] i965/fs: Predicate byte scattered writes if needed

2017-10-12 Thread Jose Maria Casanova Crespo
From: Alejandro Piñeiro While on Untyped Surface messages the bits of the execution mask are ANDed with the corresponding bits of the Pixel/Sample Mask, that is not the case for byte scattered writes. That is needed to avoid ssbo stores writing on helper invocations. So when that can affect, we l

[Mesa-dev] [PATCH v3 42/43] anv: Enable SPV_KHR_16bit_storage on gen 8+

2017-10-12 Thread Jose Maria Casanova Crespo
From: Eduardo Lima Mitev v2: minor changes after rebase against recent master (Alejandro) --- src/intel/vulkan/anv_pipeline.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index b35bad1050..82ed4ecc1d 100644 --- a/src/intel/

[Mesa-dev] [PATCH v3 40/43] i965/fs: Use untyped_surface_read for 16-bit load_ssbo

2017-10-12 Thread Jose Maria Casanova Crespo
SSBO loads were using byte_scattered read messages as they allow reading 16-bit size components. byte_scattered messages can only operate one component at a time so we needed to emit as many messages as components. But for vec2 and vec4 of 16-bit, being multiple of 32-bit we can use the untyped_su

[Mesa-dev] [PATCH v3] compiler: Mark when input/ouput attribute at VS uses 16-bit (v2)

2017-10-17 Thread Jose Maria Casanova Crespo
New shader attribute to mark when a location has 16-bit value. This patch includes support on mesa glsl and nir. v2: Remove use of is_half_slot as is a duplicate of is_16bit (Topi Pohjolainen) --- src/compiler/glsl_types.h | 15 +++ src/compiler/nir/nir_gather_info.c | 21

[Mesa-dev] [PATCH v3 27/43] anv/pipeline: Use 32-bit surface formats for 16-bit formats (v2)

2017-10-24 Thread Jose Maria Casanova Crespo
location at the shader, we use 32-bit formats to avoid the conversion, and will fix getting the proper content later. Note that as we are using 32-bit formats, we can use formats with less components (example: use *R32* for *R16G16*). Signed-off-by: Jose Maria Casanova Crespo Signed-off-by

[Mesa-dev] [PATCH v2 1/2] intel/fs: New methods dst_write_pattern and src_read_pattern at fs_inst

2018-07-19 Thread Jose Maria Casanova Crespo
These new methods return for a instruction register source/destination the read/write byte pattern of the 32-byte GRF as an unsigned int. The returned pattern takes into account the exec_size of the instruction, the type bitsize, the register stride and a relative offset inside the register. The

[Mesa-dev] [PATCH v2 2/2] intel/fs: Improve liveness range calculation for partial writes

2018-07-19 Thread Jose Maria Casanova Crespo
We use the information of the registers read/write patterns to improve variable liveness analysis avoiding extending the liveness range of a variable to the beginning of the block so it always reaches the beginning of the shader. This optimization analyses inside each block if a partial write defi

[Mesa-dev] [PATCH v3 1/2] intel/fs: New methods dst_write_pattern and src_read_pattern at fs_inst

2018-07-23 Thread Jose Maria Casanova Crespo
These new methods return for a instruction register source/destination the read/write byte pattern of the 32-byte GRF as an unsigned int. The returned pattern takes into account the exec_size of the instruction, the type bitsize, the register stride and a relative offset inside the register. The

[Mesa-dev] [PATCH 1/2] intel/fs: Read multiple 8/16-bit components with byte_scattered_read

2018-07-25 Thread Jose Maria Casanova Crespo
We used the byte_scattered_read message because it allows to read from non aligned 32-bit offsets. We were reading one component for each message. Using a 32-bit bitsize read at byte_scattered_read we can read up to two 16-bit components or four 8-bit components with only one message per iteration

  1   2   >