Files
Vulkan-CTS-bin/vulkan/amber/ldexp/ldexp_float16_t_int8_t.glsl
2026-05-06 23:44:13 +02:00

30 lines
714 B
GLSL

#version 460
#extension GL_EXT_shader_explicit_arithmetic_types : enable
layout (local_size_x=64, local_size_y=1, local_size_z=1) in;
layout (set=0, binding=0, std430) readonly buffer SignificandBlock {
float16_t significands[];
};
layout (set=0, binding=1, std430) readonly buffer ExponentsBlock {
int8_t exponents[];
};
layout (set=0, binding=2, std430) buffer ResultsBlock {
float16_t results[];
};
layout (push_constant, std430) uniform PushConstantBlock {
uint count;
};
void main()
{
const uint idx = gl_LocalInvocationIndex;
if (idx < count) {
const float16_t s = significands[idx];
const int8_t e = exponents[idx];
const float16_t r = ldexp(s, e);
results[idx] = r;
}
}