2aa76823b5
floatBitsToUint was missing from our intrinsic list entirely, and u?intBitsToFloat were misspelled. These intrinsics aren't implemented in SPIR-V or Metal either, but that will be handled in followup CLs. Change-Id: Iaf9b9d5a2e46e25d41eef71903fad8bd1c177d4e Bug: skia:11071 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342757 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com> Auto-Submit: John Stiles <johnstiles@google.com>
17 lines
426 B
Metal
17 lines
426 B
Metal
#include <metal_stdlib>
|
|
#include <simd/simd.h>
|
|
using namespace metal;
|
|
struct Inputs {
|
|
uint a;
|
|
};
|
|
struct Outputs {
|
|
float4 sk_FragColor [[color(0)]];
|
|
};
|
|
|
|
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
|
|
Outputs _outputStruct;
|
|
thread Outputs* _out = &_outputStruct;
|
|
_out->sk_FragColor.x = uintBitsToFloat(_in.a);
|
|
return *_out;
|
|
}
|