Skip to content

Instantly share code, notes, and snippets.

@Reedbeta
Reedbeta / indexable-temps.hlsl
Created July 8, 2014 21:24
Indexable temporaries tests in HLSL
// This works (compiled with: fxc /T ps_5_0 /E main foo.hlsl)
float main (in uint x:X) : SV_Target0
{
float a[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, };
// Put some things in the array
a[x] = 47.0;
a[x&7] = 42.0;
a[(x+1)%12] = 3.14159;