[qfcc] Support subpassInput for image_coord

Easiest to special case it since tex_coord uses the same dim_widths
array.
This commit is contained in:
Bill Currie 2025-01-17 22:18:49 +09:00
parent 1a019ad818
commit 42f1f39329
2 changed files with 7 additions and 1 deletions

View file

@ -294,6 +294,9 @@ const expr_t *
constructor_expr (const expr_t *e, const expr_t *params) constructor_expr (const expr_t *e, const expr_t *params)
{ {
auto type = e->typ.type; auto type = e->typ.type;
if (is_void (type)) {
return error (e, "cannot construct the void");
}
if (is_algebra (type)) { if (is_algebra (type)) {
return error (e, "algebra not implemented"); return error (e, "algebra not implemented");
} }

View file

@ -80,13 +80,16 @@ image_property (const type_t *type, const attribute_t *property)
return new_type_expr (image->sample_type); return new_type_expr (image->sample_type);
} else if (strcmp (property->name, "image_coord") == 0) { } else if (strcmp (property->name, "image_coord") == 0) {
int width = dim_widths[image->dim]; int width = dim_widths[image->dim];
if (image->dim == glid_subpassdata) {
width = 2;
}
if (!width) { if (!width) {
return new_type_expr (&type_void); return new_type_expr (&type_void);
} }
if (image->dim < glid_3d) { if (image->dim < glid_3d) {
width += image->arrayed; width += image->arrayed;
} }
return new_type_expr (vector_type (&type_float, width)); return new_type_expr (vector_type (&type_int, width));
} else if (strcmp (property->name, "size_type") == 0) { } else if (strcmp (property->name, "size_type") == 0) {
int width = size_widths[image->dim]; int width = size_widths[image->dim];
if (!width) { if (!width) {