Skip to content
Snippets Groups Projects

vkd3d-shader: Enable sm1 -> spirv compilation.

Merged Elizabeth Figura requested to merge zfigura/vkd3d:mr1 into master
2 unresolved threads
    Datta: what have we given?
    My friend, blood shaking my heart
    The awful daring of a moment's surrender
    Which an age of prudence can never retract
    By this, and this only, we have existed
    Which is not to be found in our obituaries
    Or in memories draped by the beneficient spider
    Or under seals broken by the lean solicitor
    In our empty rooms
Edited by Elizabeth Figura

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
1073 1073 vkd3d_shader_scan_sampler_declaration(context, instruction);
1074 1074 break;
1075 1075 case VKD3DSIH_DCL:
1076 if (instruction->declaration.semantic.resource_type == VKD3D_SHADER_RESOURCE_NONE)
  • Mostly for my ignorance, which kind of declarations should be blocked here?

  • Author Developer

    sm1 uses the same opcode (DCL) for semantics and textures. You may notice in assembly that they show up as e.g. "dcl_texcoord" and "dcl_2d", but the _texcoord and _2d parts are not part of the opcode number proper.

    Eventually we probably want this kind of scanning to be done in the frontend, since what we're scanning for ends up being different for every kind of bytecode we consume.

  • Please register or sign in to reply
  • Giovanni Mascellani
    Giovanni Mascellani @giomasce started a thread on commit 91e3d632
  • 1624 1624 return ret;
    1625 1625 }
    1626 1626
    1627 if (compile_info->target_type == VKD3D_SHADER_TARGET_D3D_ASM)
    1628 {
    1629 ret = vkd3d_dxbc_binary_to_text(&parser->instructions, &parser->shader_version, compile_info, out);
    1630 vkd3d_shader_parser_destroy(parser);
    1631 return ret;
    1632 }
    1627 ret = vkd3d_shader_parser_compile(parser, compile_info, out, message_context);
    • This triggers a regression: this shader is correctly dumped to ASM before this commit, but now fails with:

      /tmp/shader-binary.o:14:0: E1000: Encountered ‘else’ instruction without corresponding ‘if’ block.
      Failed to compile shader, ret -4.

      I guess the reason is that vkd3d_shader_parser_compile() now also does a scan on the shader, and the scanner doesn't recognize IFC instead of IF. I don't really know the difference between the two, but I guess this shouldn't be hard to fix. It doesn't look like that the scan is really needed for dumping to ASM anyway, so maybe it could be avoided in vkd3d_shader_parser_compile()?

      Also, I couldn't help noticing that we dump IFC as ifc, while FXC seems to dump it as plain if. And our dumper doesn't count it for indenting in the code.

    • Author Developer

      It doesn't look like that the scan is really needed for dumping to ASM anyway, so maybe it could be avoided in vkd3d_shader_parser_compile()?

      Added a patch to do this in v2.

    • Please register or sign in to reply
  • Elizabeth Figura added 17 commits

    added 17 commits

    • 91e3d632...1015cc95 - 12 commits from branch wine:master
    • 2525526c - vkd3d-shader: Do not scan the shader in vkd3d_shader_parser_compile() for assembly targets.
    • 0c4a3fea - vkd3d-shader: Do not scan DCL instructions which do not declare resources.
    • 7c784b57 - tests: Use struct vkd3d_shader_scan_signature_info to retrieve the VS input signature.
    • 2d9b0019 - tests: Avoid using "SV_Position" as a name for the vertex shader input.
    • 58b1bc15 - vkd3d-shader: Allow compiling d3d bytecode to SPIR-V.

    Compare with previous version

  • Author Developer

    Rebased.

  • Giovanni Mascellani approved this merge request

    approved this merge request

  • Elizabeth Figura added 5 commits

    added 5 commits

    • 84abf77f - vkd3d-shader: Do not scan the shader in vkd3d_shader_parser_compile() for assembly targets.
    • bd25b8bf - vkd3d-shader: Do not scan DCL instructions which do not declare resources.
    • 9c9a2f90 - tests: Use struct vkd3d_shader_scan_signature_info to retrieve the VS input signature.
    • d4e6ad49 - tests: Avoid using "SV_Position" as a name for the vertex shader input.
    • 1c6ebe74 - vkd3d-shader: Allow compiling d3d bytecode to SPIR-V.

    Compare with previous version

  • Author Developer

    I fixed the compiler warning by adding a vkd3d_unreachable(), but now builds are failing for what I think is the CI's fault?

  • Elizabeth Figura added 14 commits

    added 14 commits

    • 1c6ebe74...21491d1b - 9 commits from branch wine:master
    • 5d2495d6 - vkd3d-shader: Do not scan the shader in vkd3d_shader_parser_compile() for assembly targets.
    • 899dd5a4 - vkd3d-shader: Do not scan DCL instructions which do not declare resources.
    • c6cb3d70 - tests: Use struct vkd3d_shader_scan_signature_info to retrieve the VS input signature.
    • 8e82775a - tests: Avoid using "SV_Position" as a name for the vertex shader input.
    • 4b0b09c4 - vkd3d-shader: Allow compiling d3d bytecode to SPIR-V.

    Compare with previous version

  • Henri Verbeet approved this merge request

    approved this merge request

  • Alexandre Julliard approved this merge request

    approved this merge request

  • Please register or sign in to reply
    Loading