clc: support fp16 spec constants

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34053>
This commit is contained in:
Karol Herbst
2025-03-13 17:43:43 +01:00
committed by Marge Bot
parent f8305828f4
commit ca01635075
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -175,6 +175,7 @@ struct clc_kernel_info {
enum clc_spec_constant_type {
CLC_SPEC_CONSTANT_UNKNOWN,
CLC_SPEC_CONSTANT_BOOL,
CLC_SPEC_CONSTANT_HALF,
CLC_SPEC_CONSTANT_FLOAT,
CLC_SPEC_CONSTANT_DOUBLE,
CLC_SPEC_CONSTANT_INT8,
+2 -1
View File
@@ -527,7 +527,7 @@ public:
literalType = CLC_SPEC_CONSTANT_DOUBLE;
break;
case 16:
/* Can't be used for a spec constant */
literalType = CLC_SPEC_CONSTANT_HALF;
break;
default:
unreachable("Unexpected float bit size");
@@ -1373,6 +1373,7 @@ clc_spirv_specialize(const struct clc_binary *in_spirv,
case CLC_SPEC_CONSTANT_INT8:
words.push_back((uint32_t)(int32_t)consts->specializations[i].value.i8);
break;
case CLC_SPEC_CONSTANT_HALF:
case CLC_SPEC_CONSTANT_UINT16:
words.push_back((uint32_t)consts->specializations[i].value.u16);
break;