diff options
author | Jason Ekstrand <[email protected]> | 2015-10-27 11:45:15 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-10-27 13:41:08 -0700 |
commit | 800a9706f01e0e32240b416290b98af3dd5f0702 (patch) | |
tree | 86b252cf87095f5354b221298d28df178c652abf /src/glsl | |
parent | 37b6afb3d96a7bc68129a312c77dfaf94121a70f (diff) |
nir: Add a vulkan_resource_index intrinsic
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/nir/nir_intrinsics.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/glsl/nir/nir_intrinsics.h b/src/glsl/nir/nir_intrinsics.h index 68a18b9c11a..9ef8f5bc6eb 100644 --- a/src/glsl/nir/nir_intrinsics.h +++ b/src/glsl/nir/nir_intrinsics.h @@ -157,6 +157,25 @@ INTRINSIC(image_samples, 0, ARR(), true, 1, 1, 0, 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, 3, + NIR_INTRINSIC_CAN_ELIMINATE | NIR_INTRINSIC_CAN_REORDER) + +/* * SSBO atomic intrinsics * * All of the SSBO atomic memory operations read a value from memory, |