Skip to content

Fix mapping to SPIR-V for texture buffers - #1110

Merged
dj2 merged 2 commits into
gpuweb:mainfrom
dneto0:texture-buffer-spirv
Sep 26, 2020
Merged

dj2 merged 2 commits into
gpuweb:mainfrom
dneto0:texture-buffer-spirv

Conversation

@dneto0

@dneto0 dneto0 commented Sep 25, 2020

Copy link
Copy Markdown
Contributor

For Shader SPIR-V, the variable must be decorated. The read/write
property is not part of the image type itself (like it is for Kernel
SPIR-V).

@dneto0
dneto0 requested a review from kvark September 25, 2020 14:48
@dneto0 dneto0 added the wgsl WebGPU Shading Language Issues label Sep 25, 2020
@dneto0 dneto0 added this to the MVP milestone Sep 25, 2020
Comment thread wgsl/index.bs Outdated
%1 = OpTypeImage %void 3D 0 0 0 2 image_storage_type
</pre>

When mapping to SPIR-V, a write-only storage texture variable must also have a `NonWritable` decoration.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should say NonReadable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Done

Comment thread wgsl/index.bs
</pre>
* type(image_storage_type) is one of `f32`, `i32`, or `u32`, depending on the storage type.

When mapping to SPIR-V, a read-only storage texture variable must also have a `NonWritable` decoration.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be worth showing an example of that?

%2 = OpVariable %1 Function
OpDecorate %2 NonWritable

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

For Shader SPIR-V, the variable must be decorated. The read/write
property is not part of the image type itself (like it is for Kernel
SPIR-V).
@dneto0
dneto0 force-pushed the texture-buffer-spirv branch from e887ad5 to 4e75e17 Compare September 25, 2020 20:21
@dneto0

dneto0 commented Sep 25, 2020

Copy link
Copy Markdown
Contributor Author

I also rebased against main.

@dj2
dj2 merged commit 9a76713 into gpuweb:main Sep 26, 2020
ben-clayton pushed a commit to ben-clayton/gpuweb that referenced this pull request Sep 6, 2022
Array.sort() defaults to sorting elements by converting them to
strings and sorting them alphabetically. To sort numerically, we need
to define the comparator function manually.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wgsl WebGPU Shading Language Issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants