Skip to content

Add ignore builtin function - #1587

Merged
dneto0 merged 1 commit into
gpuweb:mainfrom
dneto0:ignore-builtin
Apr 6, 2021
Merged

dneto0 merged 1 commit into
gpuweb:mainfrom
dneto0:ignore-builtin

Conversation

@dneto0

@dneto0 dneto0 commented Mar 31, 2021

Copy link
Copy Markdown
Contributor

Fixes #1499 (but uses 'ignore' rather than 'unused')

Fixes gpuweb#1499 (but uses 'ignore' rather than 'unused')
@dneto0
dneto0 requested review from alan-baker, kvark and litherum March 31, 2021 20:32
@dneto0

dneto0 commented Mar 31, 2021

Copy link
Copy Markdown
Contributor Author

Maybe the most dodgy part of this is the name of the section "Value-steering".
Suggestions welcome, but I won't accept "miscellaneous" as that's a cop-out. :-)

@dneto0 dneto0 added this to the MVP milestone Mar 31, 2021
Comment thread wgsl/index.bs
</xmp>
</div>

## Value-steering functions ## {#value-steering-functions}

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.

I think we can figure out a larger class of functions that are related to communicating our intent to the compiler, but we can do it later (when the set of this functions is larger than 1).

@dneto0 dneto0 added the wgsl WebGPU Shading Language Issues label Apr 1, 2021
@kdashg

kdashg commented Apr 5, 2021

Copy link
Copy Markdown
Contributor

It's more of a markUsed in languages I'm familiar with. Specifically, though you'd only need to use this in order to satisfy unused-var warnings, there is no warning (that I'm aware of) if you end up using it anyway.

fn foo(a: i32) {
  ignore(a);
  return a;
}

Also consider noOp(T)

@alan-baker

Copy link
Copy Markdown
Contributor

Alternative potential name: sink.

@dneto0

dneto0 commented Apr 6, 2021

Copy link
Copy Markdown
Contributor Author

Discussed in 2021-04-06 meeting

No very strong feelings on the name, but agreed to 'ignore'.

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.

WGSL: add fn void(sink:T) -> void builtin function

4 participants