Bad Shader 1
Bad Shader 1
#define GLSL 1
#define float2 vec2
#define float3 vec3
#define float4 vec4
#define int2 ivec2
#define int3 ivec3
#define int4 ivec4
#define uint2 uvec2
#define uint3 uvec3
#define uint4 uvec4
#define float2x2 mat2
#define float3x3 mat3
#define float4x4 mat4
#define mul(x, y) ((x) * (y))
#define nointerpolation flat
#define frac fract
#define lerp mix
#define CONSTANT const
#define GLOBAL
#define FOR_UNROLL for
#define FOR_LOOP for
#define IF_BRANCH if
#define IF_FLATTEN if
#define VECTOR_EQ(a, b) ((a) == (b))
#define VECTOR_NEQ(a, b) ((a) != (b))
#define VECTOR_COMP_EQ(a, b) equal((a), (b))
#define VECTOR_COMP_NEQ(a, b) notEqual((a), (b))
#define SAMPLE_TEXTURE(name, coords) texture(name, coords)
#define SAMPLE_TEXTURE_OFFSET(name, coords, offset) textureOffset(name, coords,
offset)
#define SAMPLE_TEXTURE_LEVEL(name, coords, level) textureLod(name, coords, level)
#define SAMPLE_TEXTURE_LEVEL_OFFSET(name, coords, level, offset)
textureLodOffset(name, coords, level, offset)
#define LOAD_TEXTURE(name, coords, mip) texelFetch(name, coords, mip)
#define LOAD_TEXTURE_MS(name, coords, sample) texelFetch(name, coords, int(sample))
#define LOAD_TEXTURE_OFFSET(name, coords, mip, offset) texelFetchOffset(name,
coords, mip, offset)
#define LOAD_TEXTURE_BUFFER(name, index) texelFetch(name, index)
#define BEGIN_ARRAY(type, size) type[size](
#define END_ARRAY )
float saturate(float value) { return clamp(value, 0.0, 1.0); }
float2 saturate(float2 value) { return clamp(value, float2(0.0, 0.0), float2(1.0,
1.0)); }
float3 saturate(float3 value) { return clamp(value, float3(0.0, 0.0, 0.0),
float3(1.0, 1.0, 1.0)); }
float4 saturate(float4 value) { return clamp(value, float4(0.0, 0.0, 0.0, 0.0),
float4(1.0, 1.0, 1.0, 1.0)); }
#define MULTISAMPLING 0
CONSTANT uint RESOLUTION_SCALE = 3u;
CONSTANT uint2 VRAM_SIZE = uint2(1024, 512) * RESOLUTION_SCALE;
CONSTANT float2 RCP_VRAM_SIZE = float2(1.0, 1.0) / float2(VRAM_SIZE);
CONSTANT uint MULTISAMPLES = 1u;
CONSTANT bool PER_SAMPLE_SHADING = false;
uint RGBA8ToRGBA5551(float4 v)
{
uint r = uint(roundEven(v.r * 31.0));
uint g = uint(roundEven(v.g * 31.0));
uint b = uint(roundEven(v.b * 31.0));
uint a = (v.a != 0.0) ? 1u : 0u;
return (r) | (g << 5) | (b << 10) | (a << 15);
}
float4 RGBA5551ToRGBA8(uint v)
{
uint r = (v & 31u);
uint g = ((v >> 5) & 31u);
uint b = ((v >> 10) & 31u);
uint a = ((v >> 15) & 1u);
void main()
{
float3 color = float3(0.0, 0.0, 0.0);
uint2 base_coords = u_base_coords + uint2(v_pos.xy) * uint2(FACTOR, FACTOR);
for (uint offset_x = 0u; offset_x < FACTOR; offset_x++)
{
for (uint offset_y = 0u; offset_y < FACTOR; offset_y++)
color += LOAD_TEXTURE(samp0, int2(base_coords + uint2(offset_x, offset_y)),
0).rgb;
}
color /= float(FACTOR * FACTOR);
o_col0 = float4(color, 1.0);
}
Compile Fragment shader failed
Compile failed.
ERROR: 0:104: '<' : Wrong operand types. No operation '<' exists that takes a left-
hand operand of type 'uint' and a right operand of type 'const int' (and there is
no acceptable conversion)
ERROR: 0:106: '<' : Wrong operand types. No operation '<' exists that takes a left-
hand operand of type 'uint' and a right operand of type 'const int' (and there is
no acceptable conversion)
2 compilation errors. No code generated.