-
Notifications
You must be signed in to change notification settings - Fork 931
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
WGSL constant values should not be concretized #6232
Comments
…reviewers Demote some tests to backlog (filed as gfx-rs/wgpu#6232): - webgpu:shader,validation,const_assert,const_assert:constant_expression_assert:* - webgpu:shader,validation,const_assert,const_assert:constant_expression_logical_and_assert:* - webgpu:shader,validation,const_assert,const_assert:constant_expression_logical_or_assert:* Differential Revision: https://phabricator.services.mozilla.com/D221272
cc @sagudev |
…hain-reviewers,webgpu-reviewers,nical,ErichDonGubler Demote some tests to backlog (filed as gfx-rs/wgpu#6232): - webgpu:shader,validation,const_assert,const_assert:constant_expression_assert:* - webgpu:shader,validation,const_assert,const_assert:constant_expression_logical_and_assert:* - webgpu:shader,validation,const_assert,const_assert:constant_expression_logical_or_assert:* Differential Revision: https://phabricator.services.mozilla.com/D221272
const one = 1.0;
const_assert one == 1.0; and for: const_assert 1 == 1.0; Now if we have: fn f() -> i32 {
const one = 1;
if (one == 1.0) {
return 42;
} else {
return 35;
}
} it compiles to: fn f() -> i32 {
if false {
return 42i;
} else {
return 35i;
}
} so I think something is wrong with evaler (specifically how it handles abstract types - I think it's #4400). |
The problem is that abstractint is to eagerly converted to i32, then in |
…hain-reviewers,webgpu-reviewers,nical,ErichDonGubler Demote some tests to backlog (filed as gfx-rs/wgpu#6232): - webgpu:shader,validation,const_assert,const_assert:constant_expression_assert:* - webgpu:shader,validation,const_assert,const_assert:constant_expression_logical_and_assert:* - webgpu:shader,validation,const_assert,const_assert:constant_expression_logical_or_assert:* Differential Revision: https://phabricator.services.mozilla.com/D221272
WGSL says constants can have abstract types. I don't think Naga implements that. |
Indeed, we try to concertize value: wgpu/naga/src/front/wgsl/lower/mod.rs Line 1118 in 9b36a3e
|
…hain-reviewers,webgpu-reviewers,nical,ErichDonGubler Demote some tests to backlog (filed as gfx-rs/wgpu#6232): - webgpu:shader,validation,const_assert,const_assert:constant_expression_assert:* - webgpu:shader,validation,const_assert,const_assert:constant_expression_logical_and_assert:* - webgpu:shader,validation,const_assert,const_assert:constant_expression_logical_or_assert:* Differential Revision: https://phabricator.services.mozilla.com/D221272
…hain-reviewers,webgpu-reviewers,nical,ErichDonGubler Demote some tests to backlog (filed as gfx-rs/wgpu#6232): - webgpu:shader,validation,const_assert,const_assert:constant_expression_assert:* - webgpu:shader,validation,const_assert,const_assert:constant_expression_logical_and_assert:* - webgpu:shader,validation,const_assert,const_assert:constant_expression_logical_or_assert:* Differential Revision: https://phabricator.services.mozilla.com/D221272
…hain-reviewers,webgpu-reviewers,nical,ErichDonGubler Demote some tests to backlog (filed as gfx-rs/wgpu#6232): - webgpu:shader,validation,const_assert,const_assert:constant_expression_assert:* - webgpu:shader,validation,const_assert,const_assert:constant_expression_logical_and_assert:* - webgpu:shader,validation,const_assert,const_assert:constant_expression_logical_or_assert:* Differential Revision: https://phabricator.services.mozilla.com/D221272
…hain-reviewers,webgpu-reviewers,nical,ErichDonGubler Demote some tests to backlog (filed as gfx-rs/wgpu#6232): - webgpu:shader,validation,const_assert,const_assert:constant_expression_assert:* - webgpu:shader,validation,const_assert,const_assert:constant_expression_logical_and_assert:* - webgpu:shader,validation,const_assert,const_assert:constant_expression_logical_or_assert:* Differential Revision: https://phabricator.services.mozilla.com/D221272 UltraBlame original commit: 80007d515fb2b3930c29519a6b4a53dcc904b733
…hain-reviewers,webgpu-reviewers,nical,ErichDonGubler Demote some tests to backlog (filed as gfx-rs/wgpu#6232): - webgpu:shader,validation,const_assert,const_assert:constant_expression_assert:* - webgpu:shader,validation,const_assert,const_assert:constant_expression_logical_and_assert:* - webgpu:shader,validation,const_assert,const_assert:constant_expression_logical_or_assert:* Differential Revision: https://phabricator.services.mozilla.com/D221272 UltraBlame original commit: 2119546af72280f5daaf86044154fb670a10db70
…hain-reviewers,webgpu-reviewers,nical,ErichDonGubler Demote some tests to backlog (filed as gfx-rs/wgpu#6232): - webgpu:shader,validation,const_assert,const_assert:constant_expression_assert:* - webgpu:shader,validation,const_assert,const_assert:constant_expression_logical_and_assert:* - webgpu:shader,validation,const_assert,const_assert:constant_expression_logical_or_assert:* Differential Revision: https://phabricator.services.mozilla.com/D221272 UltraBlame original commit: 80007d515fb2b3930c29519a6b4a53dcc904b733
…hain-reviewers,webgpu-reviewers,nical,ErichDonGubler Demote some tests to backlog (filed as gfx-rs/wgpu#6232): - webgpu:shader,validation,const_assert,const_assert:constant_expression_assert:* - webgpu:shader,validation,const_assert,const_assert:constant_expression_logical_and_assert:* - webgpu:shader,validation,const_assert,const_assert:constant_expression_logical_or_assert:* Differential Revision: https://phabricator.services.mozilla.com/D221272 UltraBlame original commit: 2119546af72280f5daaf86044154fb670a10db70
…hain-reviewers,webgpu-reviewers,nical,ErichDonGubler Demote some tests to backlog (filed as gfx-rs/wgpu#6232): - webgpu:shader,validation,const_assert,const_assert:constant_expression_assert:* - webgpu:shader,validation,const_assert,const_assert:constant_expression_logical_and_assert:* - webgpu:shader,validation,const_assert,const_assert:constant_expression_logical_or_assert:* Differential Revision: https://phabricator.services.mozilla.com/D221272 UltraBlame original commit: 80007d515fb2b3930c29519a6b4a53dcc904b733
…hain-reviewers,webgpu-reviewers,nical,ErichDonGubler Demote some tests to backlog (filed as gfx-rs/wgpu#6232): - webgpu:shader,validation,const_assert,const_assert:constant_expression_assert:* - webgpu:shader,validation,const_assert,const_assert:constant_expression_logical_and_assert:* - webgpu:shader,validation,const_assert,const_assert:constant_expression_logical_or_assert:* Differential Revision: https://phabricator.services.mozilla.com/D221272
const_assert
doesn't evaluate conditions properly
I think this ought to pass validation, but it fails:
When I run this on 50b7128, I get:
This seems to cause WebGPU CTS failures:
The text was updated successfully, but these errors were encountered: