2021-11-16 15:15:36 +00:00
|
|
|
#version 310 es
|
|
|
|
|
2021-12-09 18:54:35 +00:00
|
|
|
struct Uniforms {
|
|
|
|
uint dstTextureFlipY;
|
|
|
|
uint isFloat16;
|
|
|
|
uint isRGB10A2Unorm;
|
|
|
|
uint channelCount;
|
|
|
|
};
|
2021-11-16 15:15:36 +00:00
|
|
|
|
2022-02-04 23:09:23 +00:00
|
|
|
layout(binding = 2, std430) buffer OutputBuf_1 {
|
2021-11-16 15:15:36 +00:00
|
|
|
uint result[];
|
|
|
|
} tint_symbol;
|
2022-01-25 20:06:05 +00:00
|
|
|
layout(binding = 3) uniform Uniforms_1 {
|
2021-11-16 15:15:36 +00:00
|
|
|
uint dstTextureFlipY;
|
|
|
|
uint isFloat16;
|
|
|
|
uint isRGB10A2Unorm;
|
|
|
|
uint channelCount;
|
|
|
|
} uniforms;
|
|
|
|
|
|
|
|
uint ConvertToFp16FloatValue(float fp32) {
|
|
|
|
return 1u;
|
|
|
|
}
|
|
|
|
|
2022-01-24 17:17:22 +00:00
|
|
|
uniform highp sampler2D src_1;
|
|
|
|
uniform highp sampler2D dst_1;
|
2022-01-28 22:36:58 +00:00
|
|
|
void tint_symbol_1(uvec3 GlobalInvocationID) {
|
2022-01-24 17:17:22 +00:00
|
|
|
ivec2 size = textureSize(src_1, 0);
|
2021-11-16 15:15:36 +00:00
|
|
|
ivec2 dstTexCoord = ivec2(GlobalInvocationID.xy);
|
|
|
|
ivec2 srcTexCoord = dstTexCoord;
|
|
|
|
if ((uniforms.dstTextureFlipY == 1u)) {
|
|
|
|
srcTexCoord.y = ((size.y - dstTexCoord.y) - 1);
|
|
|
|
}
|
2022-01-24 17:17:22 +00:00
|
|
|
vec4 srcColor = texelFetch(src_1, srcTexCoord, 0);
|
|
|
|
vec4 dstColor = texelFetch(dst_1, dstTexCoord, 0);
|
2021-11-16 15:15:36 +00:00
|
|
|
bool success = true;
|
|
|
|
uvec4 srcColorBits = uvec4(0u, 0u, 0u, 0u);
|
|
|
|
uvec4 dstColorBits = uvec4(dstColor);
|
|
|
|
{
|
|
|
|
for(uint i = 0u; (i < uniforms.channelCount); i = (i + 1u)) {
|
|
|
|
srcColorBits[i] = ConvertToFp16FloatValue(srcColor[i]);
|
|
|
|
bool tint_tmp = success;
|
|
|
|
if (tint_tmp) {
|
|
|
|
tint_tmp = (srcColorBits[i] == dstColorBits[i]);
|
|
|
|
}
|
|
|
|
success = (tint_tmp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
uint outputIndex = ((GlobalInvocationID.y * uint(size.x)) + GlobalInvocationID.x);
|
|
|
|
if (success) {
|
|
|
|
tint_symbol.result[outputIndex] = uint(1);
|
|
|
|
} else {
|
|
|
|
tint_symbol.result[outputIndex] = uint(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
|
|
|
void main() {
|
2022-01-28 22:36:58 +00:00
|
|
|
tint_symbol_1(gl_GlobalInvocationID);
|
|
|
|
return;
|
2021-11-16 15:15:36 +00:00
|
|
|
}
|