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:
Ben Clayton 2020-05-29 16:08:53 +01:00
parent cac1d2e850
commit ca884587a4
1043 changed files with 1207 additions and 1201 deletions

View file

@ -1,43 +0,0 @@
// Copyright 2020 Google LLC
Texture2D textureColor : register(t1);
SamplerState samplerColor : register(s1);
cbuffer UBO : register(b0)
{
float blurScale;
float blurStrength;
};
[[vk::constant_id(0)]] const int blurdirection = 0;
float4 main([[vk::location(0)]] float2 inUV : TEXCOORD0) : SV_TARGET
{
float weight[5];
weight[0] = 0.227027;
weight[1] = 0.1945946;
weight[2] = 0.1216216;
weight[3] = 0.054054;
weight[4] = 0.016216;
float2 textureSize;
textureColor.GetDimensions(textureSize.x, textureSize.y);
float2 tex_offset = 1.0 / textureSize * blurScale; // gets size of single texel
float3 result = textureColor.Sample(samplerColor, inUV).rgb * weight[0]; // current fragment's contribution
for(int i = 1; i < 5; ++i)
{
if (blurdirection == 1)
{
// H
result += textureColor.Sample(samplerColor, inUV + float2(tex_offset.x * i, 0.0)).rgb * weight[i] * blurStrength;
result += textureColor.Sample(samplerColor, inUV - float2(tex_offset.x * i, 0.0)).rgb * weight[i] * blurStrength;
}
else
{
// V
result += textureColor.Sample(samplerColor, inUV + float2(0.0, tex_offset.y * i)).rgb * weight[i] * blurStrength;
result += textureColor.Sample(samplerColor, inUV - float2(0.0, tex_offset.y * i)).rgb * weight[i] * blurStrength;
}
}
return float4(result, 1.0);
}