Skip to content
Snippets Groups Projects

tests/vkd3d-shader-api: Refactorings to allow dxcompiler and Vulkan use in the shader API tests.

Merged Conor McCarthy requested to merge cmccarthy/vkd3d:ssbo_uavs_1 into master

Storage buffer UAVs are currently not tested, and vkd3d does not use them. Testing can be accomplished using the BUFFER_UAV flag in the API tests, but we need to make dxcompiler and Vulkan helpers available there first.

Edited by Conor McCarthy

Merge request reports

Merge request pipeline #32944 skipped

Merge request pipeline skipped for fcb09be6

Merged by Henri VerbeetHenri Verbeet 6 months ago (Oct 8, 2024 8:10pm UTC)

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 2 commits

    added 2 commits

    • 43d702af - vkd3d-shader/spirv: Apply descriptor indexing to SSBO UAV raw/structured loads.
    • c0536a54 - vkd3d-shader/spirv: Apply descriptor indexing to SSBO UAV raw/structured stores.

    Compare with previous version

    • Storage buffer UAVs are not tested. It can be done in the Vulkan runner, but is probably not worth it.

      It could also be tested outside the shader runner, for example as a vkd3d_shader_api.c test. I imagine it would help to move some code from shader_runner_vulkan.c to something like utils.h and d3d12_test_utils.h for sharing, but in any case, evidently having tests for this functionality is useful.

    • Perhaps tests should wait until after vkd3d is patched to use SSBOs, because then the d3d12 tests will use them, and the other pathway will need tests instead.

    • Please register or sign in to reply
    • Perhaps tests should wait until after vkd3d is patched to use SSBOs, because then the d3d12 tests will use them, and the other pathway will need tests instead.

      Presumably you'd just run the same tests twice; once with BUFFER_UAV_STORAGE_TEXEL_BUFFER and once with BUFFER_UAV_STORAGE_BUFFER.

    • Currently only the GL and Vulkan shader runners can use these, right? The other runners and the d3d12 tests know nothing of vkd3d.

    • Please register or sign in to reply
    • Being rather ignorant of this topic: what are storage buffers UAVs used for? It doesn't seem that either vkd3d or Wine are using them. Why do we support them? From the perspective of a vkd3d user, which advantages and disadvantages have over textures?

    • I don't know the history, but apparently it was decided during development that the shader API would support both storage buffers and storage texel buffers. Probably the reason vkd3d uses storage texel buffers is because D3D12 supports 32-bit alignment of buffer offsets, and minStorageBufferOffsetAlignment is greater than 4 on some hardware. We use storage texel buffers and EXT_texel_buffer_alignment to support 32-bit alignments. RADV has a minStorageBufferOffsetAlignment of 4 for Navi cards, and a comment in vkd3d-proton says Nvidia supports 4 but advertises only 16. We need to use storage buffers for SM 6.2 because Vulkan storage texel buffers don't support 16-bit access. Offsets are a problem on Intel and maybe others, but vkd3d-proton stores offsets in a special buffer to work around that.

      Storage buffers may be a little more performant because Vulkan buffer views are not required.

    • Please register or sign in to reply
  • Conor McCarthy added 52 commits

    added 52 commits

    • c0536a54...ccb6150a - 48 commits from branch wine:master
    • 6e1db76d - tests/d3d12: Test format R8G8B8A8_UNORM in test_typed_buffer_uav().
    • 3d0967df - tests/shader-runner: Move dxc compilation helpers to dxc_compile.h.
    • f37936f6 - tests/shader-runner: Move Vulkan helper functions to vulkan_utils.h.
    • 77ebc7ee - tests/vkd3d-shader-api: Add tests for the BUFFER_UAV compiler option.

    Compare with previous version

  • Conor McCarthy changed title from vkd3d-shader/spirv: Fix SSBO UAV support part 1. to tests/vkd3d-shader-api: Add tests for the BUFFER_UAV compiler option.

    changed title from vkd3d-shader/spirv: Fix SSBO UAV support part 1. to tests/vkd3d-shader-api: Add tests for the BUFFER_UAV compiler option.

  • Conor McCarthy changed the description

    changed the description

  • Giovanni Mascellani
  • Giovanni Mascellani
  • Giovanni Mascellani
  • Giovanni Mascellani
  • Giovanni Mascellani
  • Conor McCarthy added 6 commits

    added 6 commits

    • ebe0743b - tests/shader-runner: Introduce struct vulkan_test_context for the Vulkan runner.
    • fc47d6dd - tests/shader-runner: Move struct vulkan_test_context to vulkan_utils.h.
    • cd672c61 - tests/shader-runner: Move Vulkan helper functions to vulkan_utils.h.
    • cb9a9fd6 - tests/shader-runner: Introduce a create_vulkan_pipeline_layout() helper function.
    • 37a642fd - tests/shader-runner: Introduce a create_vulkan_shader_stage() helper function.
    • 98bbe8c0 - tests/vkd3d-shader-api: Add tests for the BUFFER_UAV compiler option.

    Compare with previous version

  • Giovanni Mascellani
    Giovanni Mascellani @giomasce started a thread on an outdated change in commit 3d0967df
  • 1
    2
  • Giovanni Mascellani
    Giovanni Mascellani @giomasce started a thread on an outdated change in commit 3d0967df
  • 9 * version 2.1 of the License, or (at your option) any later version.
    10 *
    11 * This library is distributed in the hope that it will be useful,
    12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
    13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    14 * Lesser General Public License for more details.
    15 *
    16 * You should have received a copy of the GNU Lesser General Public
    17 * License along with this library; if not, write to the Free Software
    18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
    19 */
    20
    21 #ifndef __VKD3D_DXC_COMPILE_H
    22 #define __VKD3D_DXC_COMPILE_H
    23
    24 #include "vkd3d_d3dcommon.h"
    • Could you add this here?

      #define COBJMACROS
      #include "vkd3d_test.h"

      That makes the header compile in isolation, which I think is in general a desirable property and is useful for me in particular because it makes the error messages in my code editor more sensible.

    • Sorry, I was unclear. I'd need the two new lines to be on top:

      #define COBJMACROS
      #include "vkd3d_test.h"
      #include "vkd3d_d3dcommon.h"
      #include "vkd3d_d3dcompiler.h"
      #include "dxcompiler.h"

      Otherwise vkd3d_d3dcommon.h tries to (recursively) include windows.h and fails (while vkd3d_test.h prevents that by including vkd3d_windows.h before, and it also defines trace()).

    • Conor McCarthy changed this line in version 6 of the diff

      changed this line in version 6 of the diff

    • Done, and I also made the test buffers smaller so the offset needs an alignment of 4.

    • Please register or sign in to reply
  • Giovanni Mascellani approved this merge request

    approved this merge request

  • Conor McCarthy added 7 commits

    added 7 commits

    • a6a7a2c0 - tests/shader-runner: Move dxc compilation helpers to dxc_compile.h.
    • d35e8315 - tests/shader-runner: Introduce struct vulkan_test_context for the Vulkan runner.
    • 4b062a3e - tests/shader-runner: Move struct vulkan_test_context to vulkan_utils.h.
    • 9a1e5a97 - tests/shader-runner: Move Vulkan helper functions to vulkan_utils.h.
    • 1ae2b236 - tests/shader-runner: Introduce a create_vulkan_pipeline_layout() helper function.
    • c4966a3c - tests/shader-runner: Introduce a create_vulkan_shader_stage() helper function.
    • 62a19136 - tests/vkd3d-shader-api: Add tests for the BUFFER_UAV compiler option.

    Compare with previous version

  • Conor McCarthy added 7 commits

    added 7 commits

    • d8538a52 - tests/shader-runner: Move dxc compilation helpers to dxc_compile.h.
    • 405f95aa - tests/shader-runner: Introduce struct vulkan_test_context for the Vulkan runner.
    • 67f4cd3a - tests/shader-runner: Move struct vulkan_test_context to vulkan_utils.h.
    • ebd8ce82 - tests/shader-runner: Move Vulkan helper functions to vulkan_utils.h.
    • f4fb0565 - tests/shader-runner: Introduce a create_vulkan_pipeline_layout() helper function.
    • 722cfd43 - tests/shader-runner: Introduce a create_vulkan_shader_stage() helper function.
    • 69101b03 - tests/vkd3d-shader-api: Add tests for the BUFFER_UAV compiler option.

    Compare with previous version

  • minStorageBufferOffsetAlignment should be checked in any case, so I need to add a skip condition if it's too large.

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