On 11/11/21 05:06, Giovanni Mascellani wrote:
+unsigned int hlsl_offset_from_deref_safe(struct hlsl_ctx *ctx, const struct hlsl_deref *deref) +{
- unsigned int offset;
- if (hlsl_offset_from_deref(deref, &offset))
return offset;
- hlsl_fixme(ctx, deref->offset.node->loc, "Dereference with non-constant offset of type %s.",
hlsl_node_type_to_string(deref->offset.node->type));
- return 0; }
I don't hate this, but ultimately we're going to need to handle non-constant offsets in the callers anyway. I'd just pass the buck all the way down to sm4_register_from_deref() and write_sm1_{load,store}().