-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix(namer): escape, rather than strip, non-ASCII ident. characters #7995
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
base: trunk
Are you sure you want to change the base?
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,14 @@ | ||
// NOTE: This allows us to suppress compaction below, to force the handling of identifiers | ||
// containing Unicode. | ||
@group(0) @binding(0) | ||
var<storage> asdf: f32; | ||
|
||
fn compute() -> f32 { | ||
let θ2 = asdf + 9001.0; | ||
return θ2; | ||
} | ||
|
||
@compute @workgroup_size(1, 1) | ||
fn main() { | ||
compute(); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#version 310 es | ||
|
||
precision highp float; | ||
precision highp int; | ||
|
||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; | ||
|
||
layout(std430) readonly buffer type_block_0Compute { float _group_0_binding_0_cs; }; | ||
|
||
|
||
float compute() { | ||
float _e1 = _group_0_binding_0_cs; | ||
float u03b8_2_ = (_e1 + 9001.0); | ||
return u03b8_2_; | ||
} | ||
|
||
void main() { | ||
float _e0 = compute(); | ||
return; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,11 @@ precision highp int; | |
|
||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; | ||
|
||
struct _atomic_compare_exchange_resultSint4_ { | ||
struct _atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e { | ||
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. It's slightly unfortunate to use so many characters for an internally-generated type name. Maybe there could be a rule like "any number of consecutive 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. Maybe something like 3a4c931? 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. Yes, that looks great to me. |
||
int old_value; | ||
bool exchanged; | ||
}; | ||
struct _atomic_compare_exchange_resultUint4_ { | ||
struct _atomic_compare_exchange_result_u003c_Uint_u002c_4_u003e { | ||
uint old_value; | ||
bool exchanged; | ||
}; | ||
|
@@ -50,7 +50,7 @@ void main() { | |
int new = floatBitsToInt((intBitsToFloat(_e14) + 1.0)); | ||
uint _e20 = i; | ||
int _e22 = old; | ||
_atomic_compare_exchange_resultSint4_ _e23; _e23.old_value = atomicCompSwap(_group_0_binding_0_cs[_e20], _e22, new); | ||
_atomic_compare_exchange_result_u003c_Sint_u002c_4_u003e _e23; _e23.old_value = atomicCompSwap(_group_0_binding_0_cs[_e20], _e22, new); | ||
_e23.exchanged = (_e23.old_value == _e22); | ||
old = _e23.old_value; | ||
exchanged = _e23.exchanged; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
ByteAddressBuffer asdf : register(t0); | ||
|
||
float compute() | ||
{ | ||
float _e1 = asfloat(asdf.Load(0)); | ||
float u03b8_2_ = (_e1 + 9001.0); | ||
return u03b8_2_; | ||
} | ||
|
||
[numthreads(1, 1, 1)] | ||
void main() | ||
{ | ||
const float _e0 = compute(); | ||
return; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
( | ||
vertex:[ | ||
], | ||
fragment:[ | ||
], | ||
compute:[ | ||
( | ||
entry_point:"main", | ||
target_profile:"cs_5_1", | ||
), | ||
], | ||
) |
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.
Not important, since you've covered it with snapshot tests, but one thing I've noticed about naga/wgpu is that we don't have a lot of unit tests, and this behavior seems like a good candidate for unit testing. (But as I said, not important, I don't think it's worth going back and changing/adding the tests, this is more a reminder to be thinking about unit tests in general.)
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.
Agreed on the scope; I also think it would be nice to use several snapshot-ish unit tests in follow-up work, just to make it easier to reason about some changes.