From: Jason Ekstrand Date: Fri, 15 Apr 2016 00:14:28 +0000 (-0700) Subject: Merge remote-tracking branch 'public/master' into vulkan X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5567ae0547d5f31e51e5f32e78065894e594fd1a;p=mesa.git Merge remote-tracking branch 'public/master' into vulkan --- 5567ae0547d5f31e51e5f32e78065894e594fd1a diff --cc src/compiler/nir/nir_intrinsics.h index fa162f9d126,05507dc6579..3cb4f95394c --- a/src/compiler/nir/nir_intrinsics.h +++ b/src/compiler/nir/nir_intrinsics.h @@@ -170,31 -170,11 +170,31 @@@ INTRINSIC(image_atomic_or, 3, ARR(4, 1 INTRINSIC(image_atomic_xor, 3, ARR(4, 1, 1), true, 1, 1, 0, xx, xx, xx, 0) INTRINSIC(image_atomic_exchange, 3, ARR(4, 1, 1), true, 1, 1, 0, xx, xx, xx, 0) INTRINSIC(image_atomic_comp_swap, 4, ARR(4, 1, 1, 1), true, 1, 1, 0, xx, xx, xx, 0) - INTRINSIC(image_size, 0, ARR(), true, 4, 1, 0, xx, xx, xx, + INTRINSIC(image_size, 0, ARR(0), true, 4, 1, 0, xx, xx, xx, NIR_INTRINSIC_CAN_ELIMINATE | NIR_INTRINSIC_CAN_REORDER) - INTRINSIC(image_samples, 0, ARR(), true, 1, 1, 0, xx, xx, xx, + INTRINSIC(image_samples, 0, ARR(0), true, 1, 1, 0, xx, xx, xx, NIR_INTRINSIC_CAN_ELIMINATE | NIR_INTRINSIC_CAN_REORDER) +/* + * Vulkan descriptor set intrinsic + * + * The Vulkan API uses a different binding model from GL. In the Vulkan + * API, all external resources are represented by a tripple: + * + * (descriptor set, binding, array index) + * + * where the array index is the only thing allowed to be indirect. The + * vulkan_surface_index intrinsic takes the descriptor set and binding as + * its first two indices and the array index as its source. The third + * index is a nir_variable_mode in case that's useful to the backend. + * + * The intended usage is that the shader will call vulkan_surface_index to + * get an index and then pass that as the buffer index ubo/ssbo calls. + */ +INTRINSIC(vulkan_resource_index, 1, ARR(1), true, 1, 0, 2, + DESC_SET, BINDING, xx, + NIR_INTRINSIC_CAN_ELIMINATE | NIR_INTRINSIC_CAN_REORDER) + /* * variable atomic intrinsics *