4ef51331b2
GL_NV_gpu_shader5 doesn't support "hf", so to avoid lots of complicated workarounds, just value-cast the half literals.
25 lines
603 B
Plaintext
25 lines
603 B
Plaintext
#include <metal_stdlib>
|
|
#include <simd/simd.h>
|
|
|
|
using namespace metal;
|
|
|
|
struct SSBO0
|
|
{
|
|
short4 inputs[1];
|
|
};
|
|
|
|
struct SSBO1
|
|
{
|
|
int4 outputs[1];
|
|
};
|
|
|
|
kernel void main0(device SSBO0& _25 [[buffer(0)]], device SSBO1& _39 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
|
{
|
|
uint ident = gl_GlobalInvocationID.x;
|
|
half2 a = as_type<half2>(_25.inputs[ident].xy);
|
|
_39.outputs[ident].x = int(as_type<uint>(a + half2(half(1.0))));
|
|
_39.outputs[ident].y = as_type<int>(_25.inputs[ident].zw);
|
|
_39.outputs[ident].z = int(as_type<uint>(ushort2(_25.inputs[ident].xy)));
|
|
}
|
|
|