// Target GLSL 4.5. #version 450 core #define ATTRIBUTE_LOCATION(x) layout(location = x) #define FRAGMENT_OUTPUT_LOCATION(x) layout(location = x) #define FRAGMENT_OUTPUT_LOCATION_INDEXED(x, y) layout(location = x, index = y) #define UBO_BINDING(packing, x) layout(packing, set = 0, binding = (x - 1)) #define SAMPLER_BINDING(x) layout(set = 1, binding = x) #define SSBO_BINDING(x) layout(set = 2, binding = x) #define TEXEL_BUFFER_BINDING(x) layout(set = 2, binding = x) #define VARYING_LOCATION(x) layout(location = x) #define FORCE_EARLY_Z layout(early_fragment_tests) in // hlsl to glsl function translation #define float2 vec2 #define float3 vec3 #define float4 vec4 #define uint2 uvec2 #define uint3 uvec3 #define uint4 uvec4 #define int2 ivec2 #define int3 ivec3 #define int4 ivec4 #define frac fract #define lerp mix // These were changed in Vulkan #define gl_VertexID gl_VertexIndex #define gl_InstanceID gl_InstanceIndex layout(std140, push_constant) uniform PCBlock { int4 position; } PC; SAMPLER_BINDING(0) uniform sampler2DArray samp0; FRAGMENT_OUTPUT_LOCATION(0) out vec4 ocol0; void main() { int2 sampleUv; int2 uv1 = int2(gl_FragCoord.xy); int4 position = PC.position; int x_block_position = (uv1.x >> 3) << 2; int y_block_position = uv1.y << 2; int offset_in_block = uv1.x & 7; int y_offset_in_block = offset_in_block >> 1; int x_offset_in_block = (offset_in_block & 1) << 1; sampleUv.x = x_block_position + x_offset_in_block; sampleUv.y = y_block_position + y_offset_in_block; float2 uv0 = float2(sampleUv); uv0 += float2(0.5, 0.5); uv0 *= float(position.w); uv0 += float2(position.xy); uv0 /= float2(640, 528); float sample_offset = float(position.w) / float(640); float3 texSample0 = texture(samp0, float3(uv0 + float2(0, 0) * sample_offset, 0.0)).rgb; float3 texSample0 = floor(float3 texSample0 * 63.0) / 63.0; float3 texSample1 = texture(samp0, float3(uv0 + float2(1, 0) * sample_offset, 0.0)).rgb; float3 texSample1 = floor(float3 texSample1 * 63.0) / 63.0; float2 texRs = float2(texSample0.r, texSample1.r); float2 texGs = float2(texSample0.g, texSample1.g); float2 texBs = float2(texSample0.b, texSample1.b); float2 gInt = floor(texGs * 255.0 / exp2(8.0 - 6.0)); float2 gUpper = floor(gInt / 8.0); float2 gLower = gInt - gUpper * 8.0; ocol0.br = floor(texRs * 255.0 / exp2(8.0 - 5.0)); ocol0.br = ocol0.br * 8.0 + gUpper; ocol0.ga = floor(texBs * 255.0 / exp2(8.0 - 5.0)); ocol0.ga = ocol0.ga + gLower * 32.0; ocol0 = ocol0 / 255.0; } Failed to parse shader Shader Info Log: Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. ERROR: 0:52: '' : syntax error ERROR: 1 compilation errors. No code generated.