Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/tpf.c:
+static void write_sm4_sfi0(struct hlsl_ctx *ctx, struct dxbc_writer *dxbc) +{
- struct extern_resource *extern_resources;
- unsigned int extern_resources_count;
- uint64_t *flags;
- flags = vkd3d_calloc(1, sizeof(*flags));
- extern_resources = sm4_get_extern_resources(ctx, &extern_resources_count);
- for (unsigned int i = 0; i < extern_resources_count; ++i)
- {
if (extern_resources[i].data_type->e.resource.rasteriser_ordered)
*flags |= VKD3D_SM4_REQUIRES_ROVS;
- }
- sm4_free_extern_resources(extern_resources, extern_resources_count);
I'd rather accumulate flags while compiling the shader rather than doing another pass at the end. Not a terribly strong opinion, though.