Skip to content

Commit

Permalink
[SYCL][Bindless][Doc] Introduce SPIR-V spec for enabling bindless ima…
Browse files Browse the repository at this point in the history
…ges on Intel devices (#12927)

Create a new extension to enable SPIR-V to support handle conversion to
image and sampler types for the bindless images extension.
  • Loading branch information
DBDuncan authored Apr 4, 2024
1 parent e320aa4 commit dc9c91e
Showing 1 changed file with 169 additions and 0 deletions.
169 changes: 169 additions & 0 deletions sycl/doc/design/spirv-extensions/SPV_INTEL_bindless_images.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
:capability_token: 6528
:handle_to_image_token: 6529
:handle_to_sampler_token: 6530

SPV_INTEL_bindless_images
=========================

== Name Strings

SPV_INTEL_bindless_images

== Contact

To report problems with this extension, please open a new issue at:

<https://github.com/intel/llvm/issues>

== Contributors

- Duncan Brawley, Codeplay
- Przemek Malon, Codeplay
- Peter Žužek, Codeplay
- Chedy Najjar, Codeplay
- Sean Stirling, Codeplay
- Isaac Ault, Codeplay
- Victor Lomuller, Codeplay

== Notice

Copyright © Codeplay Software Limited. All rights reserved.

== Status

In Development

== Version

[width="40%",cols="25,25"]
|========================================
| Last Modified Date | 2024-03-25
| Revision | 6
|========================================

== Dependencies

This extension is written against the SPIR-V Specification,
Version 1.6 Revision 1.

This extension requires SPIR-V 1.0.

== Overview

This extension adds support for bindless images.
This is done by adding support for SPIR-V to convert unsigned integer handles to
images/samplers.

Bindless images are a feature that provides flexibility on how images are
accessed and used, such as removing limitations on how many images can be
accessed as well as potentially improving performance.
This is an improvement on the legacy bound images model which is a holdover from
binding slots in hardware which used to be limited in number.

== Extension Name

To use this extension within a SPIR-V module, the following *OpExtension* must
be present in the module:

----
OpExtension "SPV_INTEL_bindless_images"
----

== New Capabilities

This extension introduces a new capability:

----
BindlessImagesINTEL
----

== New Instructions

Instructions added under *BindlessImagesINTEL* capability.

----
OpConvertHandleToImageINTEL
OpConvertHandleToSamplerINTEL
----

== Token Number Assignments

--
[width="40%"]
[cols="70%,30%"]
[grid="rows"]
|====
|BindlessImagesINTEL |{capability_token}
|OpConvertHandleToImageINTEL |{handle_to_image_token}
|OpConvertHandleToSamplerINTEL |{handle_to_sampler_token}
|====
--

== Modifications to the SPIR-V Specification, Version 1.6, Revision 2

Modify Section 3.49.10, Image Instructions, adding to the end of the list of
instructions:

[cols="2*1,3*2"]
|======
5+|[[OpConvertHandleToImageINTEL]]*OpConvertHandleToImageINTEL* +
+
Converts an unsigned integer pointed by _Operand_ to image type.

Unsigned integer is either a 32 or 64 bit unsigned integer.
Depending on if the addressing model is set to *Physical32* or *Physical64*.

_Result type_ must be an `OpTypeImage`.

| 4 | {handle_to_image_token} | '<id> Result Type' | 'Result <id>' |
'<id> Operand'
|======

[cols="2*1,3*2"]
|======
5+|[[OpConvertHandleToSamplerINTEL]]*OpConvertHandleToSamplerINTEL* +
+
Converts an unsigned integer pointed by _Operand_ to sampler type.

Unsigned integer is either a 32 or 64 bit unsigned integer.
Depending on if the addressing model is set to *Physical32* or *Physical64*.

_Result type_ must be an `OpTypeSampler`.

| 4 | {handle_to_sampler_token} | '<id> Result Type' | 'Result <id>' |
'<id> Operand'
|======

Modify Section 3.31, Capability, adding row to the capability table:

[width="40%"]
[options="header"]
|====
2+^| Capability ^| Implicitly Declares
| {capability_token} | BindlessImagesINTEL |
|====


== Issues

None Yet.

== Revision History

[cols="5,15,15,70"]
[grid="rows"]
[options="header"]
|========================================
|Rev|Date|Author|Changes
|1|2023-03-23|Duncan Brawley|*Initial public release*
|2|2023-03-30|Duncan Brawley| Updated token assignments
|3|2023-05-29|Duncan Brawley| Updated token assignments and fix capitalization
|4|2023-06-13|Duncan Brawley| Remove need for OpHandleAddressingModeINTEL
instruction
|5|2024-02-23|Duncan Brawley| Remove OpConvertHandleToSampledImageINTEL
instruction and clarify return types
|6|2024-03-25|Duncan Brawley| Wording/formatting improvements, clarify sections
edited, make capability addition explicit and
substitute instruction numbers
|========================================

0 comments on commit dc9c91e

Please sign in to comment.