mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-19 14:01:08 +01:00
There is no literal suffix in HLSL for the integer type. We can, however, wrap integer literals in a constructor style cast. This avoids ambiguity when passing literals to overloaded functions, which we'll make use of in the subsequent patch in this PR.
18 lines
307 B
HLSL
18 lines
307 B
HLSL
cbuffer binding : register(b0) { float binding; }
|
|
|
|
int five()
|
|
{
|
|
return int(5);
|
|
}
|
|
|
|
[numthreads(1, 1, 1)]
|
|
void main(uint3 id : SV_DispatchThreadID)
|
|
{
|
|
float phony = binding;
|
|
float phony_1 = binding;
|
|
const int _e6 = five();
|
|
const int _e7 = five();
|
|
float phony_2 = binding;
|
|
return;
|
|
}
|