Implement OpQuantizeToF16

This commit is contained in:
baldurk
2020-04-23 19:14:08 +01:00
parent 925b177bad
commit 3470079472
@@ -26,6 +26,7 @@
#include <math.h>
#include <time.h>
#include "common/formatting.h"
#include "maths/half_convert.h"
#include "os/os_specific.h"
#include "spirv_op_helpers.h"
@@ -916,6 +917,18 @@ void ThreadState::StepNext(ShaderDebugState *state, const rdcarray<ThreadState>
SetDst(conv.result, var);
break;
}
case Op::QuantizeToF16:
{
OpQuantizeToF16 quant(it);
ShaderVariable var = GetSrc(quant.value);
for(uint8_t c = 0; c < var.columns; c++)
var.value.fv[c] = ConvertFromHalf(ConvertToHalf(var.value.fv[c]));
SetDst(quant.result, var);
break;
}
case Op::FConvert:
{
OpFConvert cast(it);