-
Notifications
You must be signed in to change notification settings - Fork 722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPIR-V] HLSL version of GL_EXT_spirv_intrinsics #3919
Comments
We have to implement each of
|
@jiaolu We can implement each of the above function / attribute / type one by one. I prefer separate PRs if it is possible. We would appreciate your contributions. I will also try to send some PRs and add you for code review. |
I did not find self-assign butten, can you assign the issue to me, thanks |
Related to the issue: microsoft#3919 Add these attributes vk::ext_capability vk::ext_extension vk::ext_instruction
Oops. I made a mistake that does affect the implementation of this spec, but my explanation
is wrong in terms of the existing DXC's behavior for argument passing. Let me update it as:
|
Related to the issue: microsoft#3919 Add these attributes vk::ext_capability vk::ext_extension vk::ext_instruction
Related to the issue: microsoft#3919 Add these attributes vk::ext_capability vk::ext_extension vk::ext_instruction
[SPIRV] Add support of the GL_EXT_spirv_intrinsics Related to the issue: #3919 Add these attributes vk::ext_capability vk::ext_extension vk::ext_instruction vk::ext_reference vk::ext_literal Note this commit allows the redeclaration of a HLSL intrinsic function using a function declaration with `vk::ext_instruction`. Co-authored-by: Jaebaek Seo <jaebaek@google.com>
related to issue:microsoft#3919 Add support to these two attributes: [[vk::ext_decorate(decoration, … int literal)]] [[vk::ext_decorate_string(decoration, … string literals)]]
related to issue:#3919 Add support to these two attributes: [[vk::ext_decorate(decoration, … int literal)]] [[vk::ext_decorate_string(decoration, … string literals)]]
Hi, it may be necessary to add a mechanism to set The exact use case I was hoping to achieve using SPV intrinsics is |
@jaebaek , a new PR with vk::ext_type_def not sure how to implement vk::ext_type with vk as namespace. I tried belowing code and did not work ====================================================================== ====================================================================== |
[[vk::ext_storage_class(uint storage_class)]] this is part of PRs for the microsoft#3919
Add support * vk::ext_execution_mode * [[vk::ext_storage_class(uint storage_class)]] This is part of PRs for the #3919
this is related microsoft#3919
Support [[vk::ext_type_def]] and vk::ext_type. This is related #3919 Co-authored-by: Jaebaek Seo <jaebaek@google.com>
As a part of HLSL version of GL_EXT_spirv_intrinsics, this commit adds vk::ext_decorate_id attribute. Related to microsoft#3919
As a part of HLSL version of GL_EXT_spirv_intrinsics, this commit adds vk::ext_result_id<T> type. We must use it for a variable definition or a function parameter. It means we do not consider it as a physical storage. Instead, it will be a result id of the instruction. Related to microsoft#3919
As a part of HLSL version of GL_EXT_spirv_intrinsics, this commit adds vk::ext_result_id<T> type. We must use it for a variable definition or a function parameter. It means we do not consider it as a physical storage. Instead, it will be a result id of the instruction. Related to #3919
As a part of HLSL version of GL_EXT_spirv_intrinsics, this commit adds `vk::ext_execution_mode_id(..)` intrinsic function. In addition, it allows users to enable capabilites and extensions via `vk::ext_execution_mode[_id](..)` using `[[vk::ext_capability(..)]]` and `[[vk::ext_extension(..)]]`. Related to #3919
As a part of HLSL version of GL_EXT_spirv_intrinsics, this commit adds vk::ext_decorate_id attribute. Related to #3919
Now we finished the initial implementation of this feature and added a wiki page. Let me close this issue. Please open separate issues for the maintenance. |
Similar to KhronosGroup/glslang#2625, we allow HLSL shader developers to test arbitrary SPIR-V code (I want to call it "inlined SPIR-V").
New intrinsics, types and attributes
OpExecutionMode
.OpExecutionMode
, we have to usevk::ext_extension(string)
andvk::ext_capability(uint)
attributes (see below).Invocations
,LocalSize
, .. have extra parameters. Since extra parameters ofOpExecutionMode
are literals, DXC will emit these extra parameters as literals as well.OpExtension
instruction.vk::ext_execution_mode(...)
,vk::ext_execution_mode_id(...)
, a function declared withvk::ext_instruction(...)
, or a function declared with[[vk::ext_type_def(...)]]
. We can use multiple[[vk::ext_extension(string extension_name)]]
for a single function.OpCapability
instruction.vk::ext_execution_mode(...)
,vk::ext_execution_mode_id(...)
, a function declared withvk::ext_instruction(...)
, or a function declared with[[vk::ext_type_def(...)]]
. We can use multiple[[vk::ext_extension(string extension_name)]]
for a single function.Example:
OpExecutionModeId
.OpExecutionModeId
, we have to usevk::ext_extension(string)
andvk::ext_capability(uint)
attributes.LocalSizeId
have extra id parameters. Since they must be result ids of instructions, DXC will generateOpConstantXXX
instructions for them.return_type mock_function(parameters, …, [[vk::ext_reference]] parameter, … , [[vk::ext_literal]] parameter …);
vk::ext_extension(string)
andvk::ext_capability(uint)
attributes.[[vk::ext_reference]]
attribute, we use the pointer as the operand of SPIR-V instruction instead of loading it and using the value as the operand.[[vk::ext_literal]]
, we use it in a literal form as the operand of SPIR-V instruction instead of a result id of a SPIR-V instruction.vk::ext_result_id<T>
(we will explainvk::ext_result_id<T>
below), we use the SPIR-V result id as the operand.OpStore
to store the result of the SPIR-V instruction in the l-value e.g., variable.vk::ext_result_id<T>
type, we do not generate anOpStore
, but set the variable withvk::ext_result_id<T>
type as the result id of the SPIR-V instruction. In addition, the result type of the SPIR-V instruction will be T that is the template argument of vk::ext_result_id<T>.[[vk::ext_instruction(...)]]
attribute.Example:
void createTypeXYZ(parameters, …, [[vk::ext_reference]] parameter, … , [[vk::ext_literal]] parameter …);
Example:
Example:
Decoration
operand, and further parameters asExtra Operands
. If it is used for a member of a struct/class type, OpMemberDecorate will be generated to decorate the member. Otherwise, OpDecorate will be generated to decorate the variable.The text was updated successfully, but these errors were encountered: