mirror of
https://github.com/storytold/wgpu.git
synced 2026-12-01 18:43:52 +01:00
* [hlsl-out] flatten the entry point inputs Previously, the logic was re-ordering the inputs according to the binding. This breaks if one of the inputs is a struct. With this change, the struct fields are also flattened into the fake entry point struct. We also construct the original arguments at the beginning of the function. * hlsl-out: completely separate the flattened IO structs from the original IR structs Previously, we had heuristics to detect if a particular struct needs the fields to be re-ordered. We'd re-order interface structs without layout, and the detection was very fragile and easily wrong. The new logic is spawning separate struct types if we need any re-ordering to happen. It's solid, there are no heuristics.
42 lines
722 B
HLSL
42 lines
722 B
HLSL
|
|
[numthreads(1, 1, 1)]
|
|
void main(uint3 global_id : SV_DispatchThreadID)
|
|
{
|
|
int pos = (int)0;
|
|
|
|
DeviceMemoryBarrierWithGroupSync();
|
|
GroupMemoryBarrierWithGroupSync();
|
|
switch(1) {
|
|
default: {
|
|
pos = 1;
|
|
}
|
|
}
|
|
int _expr4 = pos;
|
|
switch(_expr4) {
|
|
case 1: {
|
|
pos = 0;
|
|
break;
|
|
break;
|
|
}
|
|
case 2: {
|
|
pos = 1;
|
|
return;
|
|
break;
|
|
}
|
|
case 3: {
|
|
/* fallthrough */
|
|
{
|
|
pos = 2;
|
|
}
|
|
}
|
|
case 4: {
|
|
return;
|
|
break;
|
|
}
|
|
default: {
|
|
pos = 3;
|
|
return;
|
|
}
|
|
}
|
|
}
|