Skip to content

Latest commit

 

History

History
167 lines (126 loc) · 4.07 KB

SPV_GOOGLE_hlsl_functionality1.asciidoc

File metadata and controls

167 lines (126 loc) · 4.07 KB

SPV_GOOGLE_hlsl_functionality1

Name Strings

SPV_GOOGLE_hlsl_functionality1

Contact

See Issues list in the Khronos SPIRV-Registry repository: https://github.com/KhronosGroup/SPIRV-Registry

Contributors

  • Hai Nguyen, Google

  • David Neto, Google

  • John Kessenich, Google

  • Lei Zhang, Google

Status

  • Complete

Version

Last Modified Date

2018-09-12

Initial

5

Dependencies

This extension is written against the SPIR-V Specification, Version 1.2 Revision 4, Unified.

This extension requires SPIR-V 1.0.

This extension also subsumes the SPV_GOOGLE_decorate_string extension.

Overview

This extension provides two new decorations to extend HLSL functionality: HlslCounterBuffer and HlslSemantic.

The decoration HlslCounterBuffer is used with OpDecorateId to link a counter buffer to a UAV resource that has an associated counter.

The decoration HlslSemantic is used with OpDecorateStringGOOGLE and OpMemberDeocrateStringGOOGLE to decorate an input or output variable id with a string representing semantic as defined in the HLSL source. The decoration HlslSemantic can also be used with future string decorations that may get added to SPIR-V.

Extension Name

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

OpExtension "SPV_GOOGLE_hlsl_functionality1"

New Capabilities

None.

New Decorations

HlslCounterBufferGOOGLE
HlslSemanticGOOGLE

New Builtins

None.

New Instructions

None.

Token Number Assignments

HlslCounterBufferGOOGLE

5634

HlslSemanticGOOGLE

5635

Modifications to the SPIR-V Specification, Version 1.0

(Modify Section 3.20, Decoration)
Decoration Enabling Capabilities Extra Operands

5634

HlslCounterBufferGOOGLE
An <id> of the counter buffer associated with the target buffer.

<id>
Counter Buffer ID

5635

HlslSemanticGOOGLE
A string describing the intended use of a value. Use this to express user-defined and system semantic values for shaders originally written in HLSL. The semantic string is case insensitive.

Literal String
Semantic

(Modify Section 3.32 "Instructions")

In the OpDecorateId instruction’s Capability box, remove the statement "Missing before version 1.2", to allow this instruction to be used with this extension. Also, in the description of the OpDecorateId instruction, change "All such <id> Extra Operands must be constant instructions." to "All such <id> Extra Operands must be constant instructions or the result <id> of OpVariable instructions."

Validation Rules

An OpExtension must be added to the SPIR-V for validation layers to check legal use of this extension:

OpExtension "SPV_GOOGLE_hlsl_functionality1"

HLSLCounterBuffer can only be applied to a variable in the Uniform storage class. The parameter should also be a variable in the Uniform storage class.

HLSLSemantic can only be applied to a variable or a member of a struct type. If applied to a variable, it must be in the Input or Output storage class.

Issues

None yet.

Revision History

Rev Date Author Changes

1

2018-02-04

Hai Nguyen

Initial draft

2

2018-02-16

Hai Nguyen

Added GOOGLE suffix, validation rules, and token numbers

3

2018-03-16

Lei Zhang

Clarified version and extension requirements

4

2018-04-13

Lei Zhang

Subsumed the SPV_GOOGLE_decorate_string extension

5

2018-09-12

Lei Zhang

Allowed OpDecorateId to take result <id> of OpVariable