Skip to content
Snippets Groups Projects

vkd3d-shader/spirv: Do not declare resources as multisampled if the sample count is 1.

Merged Elizabeth Figura requested to merge zfigura/vkd3d:pr6 into master

It is illegal to match a SPIR-V multisampled resource to a Vulkan resource which is not multisampled. Vulkan considers a resource to be multisampled if its sample count is greater than 1 (and SPIR-V does not care about the sample count).

This fixes validation errors in the case where the sample count does actually match the resource. In order to provide correct behaviour when there is a mismatch, or when the sample count is missing, we will need yet another additional interface. In the absence of that it seems best to provide a best guess.

This fixes a validation error with the not-yet-committed merge request 135, when the d3d11 runner is run through Wine with the Vulkan backend.

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
  • Unfortunate. How does this interact with the target environment? I.e., does this patch do the right thing when VKD3D_SHADER_SPIRV_ENVIRONMENT_OPENGL_4_5 is specified?

  • Unfortunate. How does this interact with the target environment? I.e., does this patch do the right thing when VKD3D_SHADER_SPIRV_ENVIRONMENT_OPENGL_4_5 is specified?

    The GL spec (and the ARB_gl_spirv spec), as far as I can find, is annoyingly vague about how GLSL sampler types correspond to GL texture bindings, and doesn't seem to specify at all how SPIR-V image types correspond to GL texture bindings (or, for that matter, how GLSL sampler types correspond to SPIR-V image types).

    I can only assume that sampler2D <-> SPIRV MS = 0 <-> GL_TEXTURE_2D, and sampler2DMS <-> SPIRV MS = 1 <-> GL_TEXTURE_2D_MULTISAMPLE. That seems like the only reasonable mapping, and it'd be consistent with how GLSL maps to GL when SPIR-V isn't involved. In that case this patch should do the right thing.

  • Henri Verbeet approved this merge request

    approved this merge request

  • added 16 commits

    • 6cf0bb09...dfe923ea - 15 commits from branch wine:master
    • d8ef0c69 - vkd3d-shader/spirv: Do not declare resources as multisampled if the sample count is 1.

    Compare with previous version

  • Alexandre Julliard approved this merge request

    approved this merge request

Please register or sign in to reply
Loading