Skip to content
Snippets Groups Projects

vkd3d-shader/hlsl: Write the SFI0 section and "REQUIRES_ROVS" flag when ROVs are used.

Merged Elizabeth Figura requested to merge zfigura/vkd3d:mr2 into master
1 unresolved thread

Spotted by Henri Verbeet.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
5898 5913
5914 static void write_sm4_sfi0(struct hlsl_ctx *ctx, struct dxbc_writer *dxbc)
5915 {
5916 struct extern_resource *extern_resources;
5917 unsigned int extern_resources_count;
5918 uint64_t *flags;
5919
5920 flags = vkd3d_calloc(1, sizeof(*flags));
5921
5922 extern_resources = sm4_get_extern_resources(ctx, &extern_resources_count);
5923 for (unsigned int i = 0; i < extern_resources_count; ++i)
5924 {
5925 if (extern_resources[i].data_type->e.resource.rasteriser_ordered)
5926 *flags |= VKD3D_SM4_REQUIRES_ROVS;
5927 }
5928 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.

    In principle I'd be inclined to agree, but this approach seems appropriate this close to the release. Ultimately the tpf writer should get this from the vsir_program, of course.

  • Henri Verbeet approved this merge request

    approved this merge request

  • Giovanni Mascellani approved this merge request

    approved this merge request

  • Author Developer

    Yes, both of those were my thought process as well.

  • Alexandre Julliard approved this merge request

    approved this merge request

  • Henri Verbeet mentioned in merge request !1035 (merged)

    mentioned in merge request !1035 (merged)

  • Please register or sign in to reply
    Loading