Skip to content

vk_sampler_test: enable shaderDrawParameters for the translated vs_ids (VUID-08740 on ps_ssharp) - #4067

Open
TreXito wants to merge 1 commit into
ItsNotRexed:mainfrom
TreXito:test/sampler-draw-parameters
Open

TreXito wants to merge 1 commit into
ItsNotRexed:mainfrom
TreXito:test/sampler-draw-parameters

Conversation

@TreXito

@TreXito TreXito commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

vk_sampler_test draws ps_ssharp with the translated vs_ids.spv. That vertex shader reads BaseVertex / BaseInstance for the zero-based v0 / v3 (#436), so it declares the DrawParameters capability. vk_harness and vk_texture_test enable VkPhysicalDeviceVulkan11Features::shaderDrawParameters for it. vk_sampler_test never did, so every ps_ssharp S# case creates a shader module that breaks VUID-VkShaderModuleCreateInfo-pCode-08740:

validation: vkCreateShaderModule(): SPIR-V Capability DrawParameters was declared, but one of the following requirements is required (VkPhysicalDeviceVulkan11Features::shaderDrawParameters OR VK_KHR_shader_draw_parameters [when using Vulkan 1.0]).

Found while proving TEST-877 (#4005, #4025) under the validation layer. The fix queries the feature together with the Vulkan 1.2 ones and enables it when the device has it, the same as vk_harness. One file, +8/-1.

The other 16 tests that report this VUID in a validation run go through vk_texture_test, where f12.pNext = &m8 unlinks the Vulkan 1.1 features on maintenance8 drivers. #3347 fixes that, and this PR doesn't touch it.

Tested on RTX 3060 Ti, driver 580.173.02, Linux, Khronos validation layer 1.4.357. Base main aa2988c against this branch (4eb8d08). Every ps_ssharp case from check.SAMPLER_CASES (8) was drawn with the suite's own vs_ids.spv / ps_ssharp.spv:

vk_sampler_test, 8 cases exit != 0 VUID-...-pCode-08740
main, no layer 0 0
main, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation 0 16
this branch, no layer 0 0
this branch, with the layer 0 0
  • The output pixels (<out.raw>) of all 8 cases are byte-identical across main without the layer and the other three runs.
  • python -I scripts/run_gpu_tests.py on this branch: 164/210 passed, 46 skipped, the same as main. ps_ssharp: PASS, 8 S#/T# cases, 4096 pixels each exact.
  • vk_sampler_test.cpp passes g++ -std=c++20 -fsyntax-only against Vulkan-Headers.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

vs_ids.spv reads BaseVertex / BaseInstance for the zero-based v0 / v3 and so
declares the DrawParameters capability. vk_harness and vk_texture_test enable
VkPhysicalDeviceVulkan11Features::shaderDrawParameters for it; vk_sampler_test
did not, so every ps_ssharp case created a module that breaks
VUID-VkShaderModuleCreateInfo-pCode-08740 (reported by VK_LAYER_KHRONOS_validation).

Query the feature with the Vulkan 1.2 ones and enable it when the device has it,
as vk_harness does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested 4eb8d084 on Windows 11, RTX 5070 Ti (Vulkan 1.4.357).

  • Built vk_sampler_test and the runner's vk_harness/vk_compute_test/vk_store_test from this branch.
  • python -I scripts/run_gpu_tests.py --build ... --filter sshar -> 1/1 passed; translator 2 shaders, 2 translated, 2 pass spirv-val.
  • ps_ssharp -> 8 S#/T# cases, 4096 pixels each exact.

The vertex shader now creates its module with shaderDrawParameters enabled, so the vs_ids module that declares DrawParameters no longer fails VUID-08740; the eight sampler/format cases still produce exact pixels. No game files; no blocker.

@MKmajster

Copy link
Copy Markdown

Reproduced on Windows: NVIDIA GeForce RTX 3070, driver 617.42, Windows 11 24H2, MSVC 19.44, VK_LAYER_KHRONOS_validation 1.4.350 (forced with VK_INSTANCE_LAYERS, as in the description). The 8 check.SAMPLER_CASES were drawn with the suite's translated vs_ids.spv / ps_ssharp.spv:

vk_sampler_test, 8 cases exit != 0 VUID-VkShaderModuleCreateInfo-pCode-08740
main aa2988c, with the layer 0 16
this branch 4eb8d08, with the layer 0 0

The same numbers as on Linux/580.173. So the missing shaderDrawParameters is a test-side issue on both drivers, and this branch removes it.

AI-assisted (Claude).

@JRamos1993

Copy link
Copy Markdown
Contributor

Tested 4eb8d08 merged onto main 03b09a0 on an RTX 5090 (driver 616.92), Windows 11, MSVC 19.44, Vulkan SDK 1.4.363, RelWithDebInfo:

  • Full ctest: 155/155.
  • Warnings: none new in the files this PR changes.

AI-assisted (Claude Code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants