[wgsl] Begin drafting textureSample builtins (v2)#1204
Merged
dj2 merged 5 commits intogpuweb:mainfrom Nov 11, 2020
Merged
Conversation
The function variant attempt to cover the union of the supported features of: SPIR-V 1.0, HLSL 5.1, MSL 1.0.
kvark
reviewed
Nov 5, 2020
* Rename `texture_sampled_` -> `texture_` based on 7f4c2fd. * Change the `texture_xxx_<type>` -> to `texture_xxx_<f32>`, and sampler return types to `vec4<f32>`. * Remove the `offset` overload for 1D textures. * Remove bias and gradient overloads for depth textures. * Add more info to the `level` parameter of `textureSampleLevel`. * Improve the description of the return value for `textureSampleGrad`
Contributor
Change `textureSampleLevel`'s `level` to `u32` for depth textures.
Contributor
dneto0
reviewed
Nov 10, 2020
wgsl/index.bs
Outdated
| <!-- TODO(ben-clayton): Remove alignment padding after review --> | ||
|
|
||
| ```rust | ||
| textureSample(texture : texture_1d<f32>, sampler : sampler, coords : f32 ) -> vec4<f32> |
Contributor
There was a problem hiding this comment.
nitpick: The parameter name 'sampler' is a reserved word.
Contributor
Author
There was a problem hiding this comment.
Ack. HLSL's docs use s, which is rather short. I couldn't think of a nice middle ground. Suggestions welcome.
Contributor
There was a problem hiding this comment.
"mysampler" is probably bad.
"s" is not terrible! I just looked and the Metal manual also uses "s", both in enumerating the builtins, and also in the code sample.
"the_sampler"
"sampler_arg"
Frankly, I'd go with "s".
Contributor
Author
There was a problem hiding this comment.
Done. Also renamed texture to t to match style and reduce the amount of horizontal scrolling required.
Also removed parameter padding as requested by @dj2 .
Contributor
|
Discussed at the 2020-11-10 meeting. |
kdashg
approved these changes
Nov 10, 2020
kvark
approved these changes
Nov 10, 2020
* Rename `sampler` parameters to `s`, as `sampler` is a reserved keyword. * Rename `texture` parameters to `t` to keep consistent, and reduce line length. * Remove parameter alignment padding, and TODO.
Contributor
dj2
approved these changes
Nov 11, 2020
ben-clayton
pushed a commit
to ben-clayton/gpuweb
that referenced
this pull request
Sep 6, 2022
This PR adds stub unimplemented tests for the `exp builtin. Issue: gpuweb#1204
ben-clayton
pushed a commit
to ben-clayton/gpuweb
that referenced
this pull request
Sep 6, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The function variant attempt to cover the union of the supported features of: SPIR-V 1.0, HLSL 5.1, MSL 1.0.
An HTML rendered version can be found at: https://ben-clayton.github.io/gpuweb/wgsl#texture-sample-functions (force-refresh of cache may be necessary)
Issue: #573