Skip to content
Snippets Groups Projects

vkd3d-shader/ir: Expand index range write masks to cover all element masks.

Merged Conor McCarthy requested to merge cmccarthy/vkd3d:indexrange into master
3 unresolved threads

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
  • Conor McCarthy added 1 commit

    added 1 commit

    • 77e0a00a - vkd3d-shader/ir: Expand index range write masks to cover all element masks.

    Compare with previous version

  • Looks like it can only occur in hull shaders, so a shader runner test is not possible, but I can add a d3d12 test.

    Please do. (In principle there's no reason we couldn't add hull shader support to the shader runner, but it probably makes sense to wait with that until we have a need for that from the HLSL compiler side.)

  • Conor McCarthy added 3 commits

    added 3 commits

    • 739eec7d - tests: Test punned array access in patch constant functions.
    • 33053a68 - vkd3d-shader/ir: Trim non-arrayable sysvals from the last element of an index range.
    • b6f8233f - vkd3d-shader/tpf: Validate sysvals in index range declarations.

    Compare with previous version

    • Author Developer

      This turns out to be quite messy and results from FXC weirdness. I ran into a new problem with the test: dcl_indexrange exceeds its required bounds and sweeps up SV_Position into the array. The patch for this may be too hacky for upstream, since it's not known to occur in the wild. In the test I tried to avoid it by using SV_Position only in the DS and PS, but it failed to render. I changed struct data to struct ds_data and declared a new struct data containing POSITION instead, and had ds_main output a ds_data, and ps_main receive one. I don't know why that would be a problem so maybe I misunderstand how this should work.

    • Author Developer

      I need to pass custom POSITION input elements to vs_main. That should fix it to work without SV_Position.

    • Please register or sign in to reply
  • Author Developer

    FXC is unpredicable and broken on the hull shader. For example, if I substitute output.inside += f[tess_factor.x] for output.f = f[tess_factor.x] it emits an error for dynamic indexing of SV_Position, but this doesn't happen for output.edges[0] += f[tess_factor.x].

  • Conor McCarthy added 4 commits

    added 4 commits

    • b295726c - vkd3d-shader/ir: Expand index range write masks to cover all element masks.
    • adfb0a35 - tests: Test punned array access in patch constant functions.
    • 76d142ee - vkd3d-shader: Make the control point count the outer dimension of I/O arrays.
    • d15a03b3 - vkd3d-shader/tpf: Validate sysvals in index range declarations.

    Compare with previous version

  • Conor McCarthy added 74 commits

    added 74 commits

    • d15a03b3...68b898fc - 70 commits from branch wine:master
    • 4f64eb7e - vkd3d-shader/ir: Expand index range write masks to cover all element masks.
    • a00937ba - tests: Test punned array access in patch constant functions.
    • a0318ccf - vkd3d-shader: Make the control point count the outer dimension of I/O arrays.
    • 846564c3 - vkd3d-shader/tpf: Validate sysvals in index range declarations.

    Compare with previous version

  • Conor McCarthy mentioned in merge request !564

    mentioned in merge request !564

  • Henri Verbeet approved this merge request

    approved this merge request

  • Alexandre Julliard added 19 commits

    added 19 commits

    • 846564c3...16962ac6 - 15 commits from branch wine:master
    • 418e8d81 - vkd3d-shader/ir: Expand index range write masks to cover all element masks.
    • b8561d6f - tests: Test punned array access in patch constant functions.
    • 4c30b238 - vkd3d-shader: Make the control point count the outer dimension of I/O arrays.
    • c4009347 - vkd3d-shader/tpf: Validate sysvals in index range declarations.

    Compare with previous version

  • Alexandre Julliard approved this merge request

    approved this merge request

    • Test test_hull_shader_punned_array() currently emits this validation error:

      VUID-RuntimeSpirv-OpEntryPoint-08743(ERROR / SPEC): msgNum: -1986897773 - Validation Error: [ VUID-RuntimeSpirv-OpEntryPoint-08743 ] Object 0: handle = 0x270000000027, type = VK_OBJECT_TYPE_SHADER_MODULE; Object 1: handle = 0x280000000028, type = VK_OBJECT_TYPE_SHADER_MODULE; | MessageID = 0x89925893 | vkCreateGraphicsPipelines(): pCreateInfos[0] (SPIR-V Interface) VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT declared input at Location 2 Component 3 but it is not an Output declared in VK_SHADER_STAGE_VERTEX_BIT. The Vulkan spec states: Any user-defined variables shared between the OpEntryPoint of two shader stages, and declared with Input as its Storage Class for the subsequent shader stage, must have all Location slots and Component words declared in the preceding shader stage's OpEntryPoint with Output as the Storage Class (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-RuntimeSpirv-OpEntryPoint-08743)

      It might or might not be related to this MR, I haven't debugged yet.

    • Author Developer

      I see no validation failure on my machine, but I do see the issue. The VS declares o2.xyz and the HS accesses it as part of a punned array of four rows of .xyzw. There's no way to tell the requirement in the VS, and we can't handle the array access in the HS without declaring row 2 as .xyzw.

    • Please register or sign in to reply
Please register or sign in to reply
Loading