-
Notifications
You must be signed in to change notification settings - Fork 70
Set entry point names during pipeline creation #577
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| #!amber | ||
| # Copyright 2019 The Amber Authors. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| SHADER compute my_shader SPIRV-ASM | ||
| OpCapability Shader | ||
| OpExtension "SPV_KHR_storage_buffer_storage_class" | ||
| OpMemoryModel Logical GLSL450 | ||
| OpEntryPoint GLCompute %18 "foo" | ||
| OpSource OpenCL_C 120 | ||
| OpDecorate %11 SpecId 0 | ||
| OpDecorate %12 SpecId 1 | ||
| OpDecorate %13 SpecId 2 | ||
| OpDecorate %_runtimearr_uint ArrayStride 4 | ||
| OpMemberDecorate %_struct_3 0 Offset 0 | ||
| OpDecorate %_struct_3 Block | ||
| OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize | ||
| OpDecorate %16 DescriptorSet 0 | ||
| OpDecorate %16 Binding 0 | ||
| OpDecorate %17 DescriptorSet 0 | ||
| OpDecorate %17 Binding 1 | ||
| %uint = OpTypeInt 32 0 | ||
| %_runtimearr_uint = OpTypeRuntimeArray %uint | ||
| %_struct_3 = OpTypeStruct %_runtimearr_uint | ||
| %_ptr_StorageBuffer__struct_3 = OpTypePointer StorageBuffer %_struct_3 | ||
| %void = OpTypeVoid | ||
| %6 = OpTypeFunction %void | ||
| %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint | ||
| %v3uint = OpTypeVector %uint 3 | ||
| %_ptr_Private_v3uint = OpTypePointer Private %v3uint | ||
| %uint_0 = OpConstant %uint 0 | ||
| %11 = OpSpecConstant %uint 1 | ||
| %12 = OpSpecConstant %uint 1 | ||
| %13 = OpSpecConstant %uint 1 | ||
| %gl_WorkGroupSize = OpSpecConstantComposite %v3uint %11 %12 %13 | ||
| %15 = OpVariable %_ptr_Private_v3uint Private %gl_WorkGroupSize | ||
| %16 = OpVariable %_ptr_StorageBuffer__struct_3 StorageBuffer | ||
| %17 = OpVariable %_ptr_StorageBuffer__struct_3 StorageBuffer | ||
| %18 = OpFunction %void None %6 | ||
| %19 = OpLabel | ||
| %20 = OpAccessChain %_ptr_StorageBuffer_uint %16 %uint_0 %uint_0 | ||
| %21 = OpAccessChain %_ptr_StorageBuffer_uint %17 %uint_0 %uint_0 | ||
| %22 = OpLoad %uint %20 | ||
| OpStore %21 %22 | ||
| OpReturn | ||
| OpFunctionEnd | ||
|
|
||
| END | ||
|
|
||
| BUFFER in_buf DATA_TYPE uint32 DATA | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For future note, this could have been a single line: BUFFER in_buf DATA_TYPE uint32 DATA 9 END |
||
| 9 | ||
| END | ||
| BUFFER out_buf DATA_TYPE uint32 SIZE 1 FILL 0 | ||
|
|
||
| PIPELINE compute my_pipeline | ||
| ATTACH my_shader ENTRY_POINT foo | ||
| BIND BUFFER in_buf AS storage DESCRIPTOR_SET 0 BINDING 0 | ||
| BIND BUFFER out_buf AS storage DESCRIPTOR_SET 0 BINDING 1 | ||
| END | ||
|
|
||
| RUN my_pipeline 1 1 1 | ||
|
|
||
| EXPECT out_buf EQ_BUFFER in_buf | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Awesome, nice to see EQ_BUFFER being useful for tests. @hevrard
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Glad to see this too! 👍 |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is empty, it would be better to just return an error here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is valid to not set an entry name if you plan to use the default name.