From 02266f9ba1990eac655ae98b5febf298cc2d33d8 Mon Sep 17 00:00:00 2001 From: Jose Maria Casanova Crespo Date: Tue, 20 Feb 2018 10:28:41 +0100 Subject: spirv/i965/anv: Relax push constant offset assertions being 32-bit aligned The introduction of 16-bit types with VK_KHR_16bit_storages implies that push constant offsets could be multiple of 2-bytes. Some assertions are updated so offsets should be just multiple of size of the base type but in some cases we can not assume it as doubles aren't aligned to 8 bytes in some cases. For 16-bit types, the push constant offset takes into account the internal offset in the 32-bit uniform bucket adding 2-bytes when we access not 32-bit aligned elements. In all 32-bit aligned cases it just becomes 0. v2: Assert offsets to be aligned to the dest type size. (Jason Ekstrand) Reviewed-by: Jason Ekstrand --- src/compiler/spirv/vtn_variables.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/compiler') diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c index 105b33a5671..7e8a090adde 100644 --- a/src/compiler/spirv/vtn_variables.c +++ b/src/compiler/spirv/vtn_variables.c @@ -753,8 +753,6 @@ _vtn_load_store_tail(struct vtn_builder *b, nir_intrinsic_op op, bool load, } if (op == nir_intrinsic_load_push_constant) { - vtn_assert(access_offset % 4 == 0); - nir_intrinsic_set_base(instr, access_offset); nir_intrinsic_set_range(instr, access_size); } -- cgit v1.2.3