summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJose Maria Casanova Crespo <[email protected]>2018-07-09 02:01:01 +0200
committerJose Maria Casanova Crespo <[email protected]>2018-07-10 00:14:50 +0200
commitcd0afab99b25eb77755779c4f8c9b8dbed345417 (patch)
treeb47e44a6c1cac91210844f31e88f3a3c71ebcb13 /src
parent11c904d0d30c3b6507be7e3bece4677a40abbd63 (diff)
i965/fs: Enable store_ssbo for 8-bit types.
v2: Update comment according to this patch. (Jason Ekstrand) Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/intel/compiler/brw_fs_nir.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp
index 4155b2ed996..62ec0df8994 100644
--- a/src/intel/compiler/brw_fs_nir.cpp
+++ b/src/intel/compiler/brw_fs_nir.cpp
@@ -4284,7 +4284,6 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
write_src = shuffle_for_32bit_write(bld, write_src, 0,
num_components);
} else if (type_size < 4) {
- assert(type_size == 2);
/* For 16-bit types we pack two consecutive values into a 32-bit
* word and use an untyped write message. For single values or not
* 32-bit-aligned we need to use byte-scattered writes because
@@ -4308,12 +4307,15 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
* being aligned to 32-bit.
*/
num_components = 1;
- } else if (num_components > 2 && (num_components % 2)) {
- /* If there is an odd number of consecutive components we left
- * the not paired component for a following emit of length == 1
- * with byte_scattered_write.
+ } else if (num_components * type_size > 4 &&
+ (num_components * type_size % 4)) {
+ /* If the pending components size is not a multiple of 4 bytes
+ * we left the not aligned components for following emits of
+ * length == 1 with byte_scattered_write.
*/
- num_components --;
+ num_components -= (num_components * type_size % 4) / type_size;
+ } else if (num_components * type_size < 4) {
+ num_components = 1;
}
/* For num_components == 1 we are also shuffling the component
* because byte scattered writes of 16-bit need values to be dword
@@ -4337,7 +4339,6 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
}
if (type_size < 4 && num_components == 1) {
- assert(type_size == 2);
/* Untyped Surface messages have a fixed 32-bit size, so we need
* to rely on byte scattered in order to write 16-bit elements.
* The byte_scattered_write message needs that every written 16-bit