spirv: Don't warn about FPFastMathMode if not OpenCL

This decoration can now be used in Vulkan with
VK_KHR_shader_float_controls2.

Acked-by: Iván Briano <ivan.briano@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30191>
This commit is contained in:
Caio Oliveira 2024-07-15 10:10:09 -07:00 committed by Marge Bot
parent b3842f9f41
commit d202f24698
2 changed files with 13 additions and 4 deletions

View file

@ -1423,7 +1423,6 @@ struct_member_decoration_cb(struct vtn_builder *b,
case SpvDecorationSaturatedConversion:
case SpvDecorationFuncParamAttr:
case SpvDecorationFPRoundingMode:
case SpvDecorationFPFastMathMode:
case SpvDecorationAlignment:
if (b->shader->info.stage != MESA_SHADER_KERNEL) {
vtn_warn("Decoration only allowed for CL-style kernels: %s",
@ -1431,6 +1430,10 @@ struct_member_decoration_cb(struct vtn_builder *b,
}
break;
case SpvDecorationFPFastMathMode:
/* See handle_fp_fast_math(). */
break;
case SpvDecorationUserSemantic:
case SpvDecorationUserTypeGOOGLE:
/* User semantic decorations can safely be ignored by the driver. */
@ -1619,12 +1622,15 @@ type_decoration_cb(struct vtn_builder *b,
case SpvDecorationSaturatedConversion:
case SpvDecorationFuncParamAttr:
case SpvDecorationFPRoundingMode:
case SpvDecorationFPFastMathMode:
case SpvDecorationAlignment:
vtn_warn("Decoration only allowed for CL-style kernels: %s",
spirv_decoration_to_string(dec->decoration));
break;
case SpvDecorationFPFastMathMode:
/* See handle_fp_fast_math(). */
break;
case SpvDecorationUserTypeGOOGLE:
/* User semantic decorations can safely be ignored by the driver. */
break;

View file

@ -1439,7 +1439,6 @@ apply_var_decoration(struct vtn_builder *b,
case SpvDecorationSaturatedConversion:
case SpvDecorationFuncParamAttr:
case SpvDecorationFPRoundingMode:
case SpvDecorationFPFastMathMode:
case SpvDecorationAlignment:
if (b->shader->info.stage != MESA_SHADER_KERNEL) {
vtn_warn("Decoration only allowed for CL-style kernels: %s",
@ -1447,6 +1446,10 @@ apply_var_decoration(struct vtn_builder *b,
}
break;
case SpvDecorationFPFastMathMode:
/* See handle_fp_fast_math(). */
break;
case SpvDecorationUserSemantic:
case SpvDecorationUserTypeGOOGLE:
/* User semantic decorations can safely be ignored by the driver. */
@ -1489,7 +1492,7 @@ apply_var_decoration(struct vtn_builder *b,
vtn_fail_if(b->shader->info.stage != MESA_SHADER_COMPUTE,
"NodeMaxPayloadsAMDX decoration only allowed in compute shaders");
break;
case SpvDecorationNodeSharesPayloadLimitsWithAMDX:
vtn_fail_if(b->shader->info.stage != MESA_SHADER_COMPUTE,
"NodeMaxPayloadsAMDX decoration only allowed in compute shaders");