Move shaders into glsl and hlsl directories
Move `data/shaders` to `data/shaders/glsl` Move `data/hlsl` to `data/shaders/hlsl` Fix up shader paths in the cpp files to point to the new glsl location. `data/shaders/hlsl/compile.py` still overwrites the glsl .spv files (for now). Issue: #723
This commit is contained in:
parent
cac1d2e850
commit
ca884587a4
1043 changed files with 1207 additions and 1201 deletions
28
data/shaders/hlsl/computeheadless/headless.comp
Normal file
28
data/shaders/hlsl/computeheadless/headless.comp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright 2020 Google LLC
|
||||
|
||||
RWStructuredBuffer<uint> values : register(u0);
|
||||
[[vk::constant_id(0)]] const uint BUFFER_ELEMENTS = 32;
|
||||
|
||||
uint fibonacci(uint n) {
|
||||
if(n <= 1){
|
||||
return n;
|
||||
}
|
||||
uint curr = 1;
|
||||
uint prev = 1;
|
||||
for(uint i = 2; i < n; ++i) {
|
||||
uint temp = curr;
|
||||
curr += prev;
|
||||
prev = temp;
|
||||
}
|
||||
return curr;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main(uint3 GlobalInvocationID : SV_DispatchThreadID)
|
||||
{
|
||||
uint index = GlobalInvocationID.x;
|
||||
if (index >= BUFFER_ELEMENTS)
|
||||
return;
|
||||
values[index] = fibonacci(values[index]);
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue