mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 04:40:09 +01:00
spirv: Add no-op support for VK_GOOGLE_hlsl_functionality1
This extension adds two new decorations which carry meaning only for HLSL shaders. They are expected to be handled by higher level layers and can be ignored by implementations. However, it does save the client a bit of work if the implementation safely ignores them instead of the client having to strip them out of the SPIR-V in order for it to be valid. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
parent
5f0322d5c3
commit
891886da2f
2 changed files with 12 additions and 0 deletions
|
|
@ -787,6 +787,10 @@ struct_member_decoration_cb(struct vtn_builder *b,
|
||||||
spirv_decoration_to_string(dec->decoration));
|
spirv_decoration_to_string(dec->decoration));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SpvDecorationHlslSemanticGOOGLE:
|
||||||
|
/* HLSL semantic decorations can safely be ignored by the driver. */
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
vtn_fail("Unhandled decoration");
|
vtn_fail("Unhandled decoration");
|
||||||
}
|
}
|
||||||
|
|
@ -874,6 +878,7 @@ type_decoration_cb(struct vtn_builder *b,
|
||||||
case SpvDecorationOffset:
|
case SpvDecorationOffset:
|
||||||
case SpvDecorationXfbBuffer:
|
case SpvDecorationXfbBuffer:
|
||||||
case SpvDecorationXfbStride:
|
case SpvDecorationXfbStride:
|
||||||
|
case SpvDecorationHlslSemanticGOOGLE:
|
||||||
vtn_warn("Decoration only allowed for struct members: %s",
|
vtn_warn("Decoration only allowed for struct members: %s",
|
||||||
spirv_decoration_to_string(dec->decoration));
|
spirv_decoration_to_string(dec->decoration));
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -1375,6 +1375,10 @@ apply_var_decoration(struct vtn_builder *b,
|
||||||
spirv_decoration_to_string(dec->decoration));
|
spirv_decoration_to_string(dec->decoration));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SpvDecorationHlslSemanticGOOGLE:
|
||||||
|
/* HLSL semantic decorations can safely be ignored by the driver. */
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
vtn_fail("Unhandled decoration");
|
vtn_fail("Unhandled decoration");
|
||||||
}
|
}
|
||||||
|
|
@ -1425,6 +1429,9 @@ var_decoration_cb(struct vtn_builder *b, struct vtn_value *val, int member,
|
||||||
case SpvDecorationCoherent:
|
case SpvDecorationCoherent:
|
||||||
vtn_var->access |= ACCESS_COHERENT;
|
vtn_var->access |= ACCESS_COHERENT;
|
||||||
break;
|
break;
|
||||||
|
case SpvDecorationHlslCounterBufferGOOGLE:
|
||||||
|
/* HLSL semantic decorations can safely be ignored by the driver. */
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue