-
Notifications
You must be signed in to change notification settings - Fork 956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New shader_primitive_index::draw
and shader_primitive_index::draw_indexed
tests fail on Linux Vulkan back end
#2751
Comments
shader_primitive_index::draw
and shader_primitive_index::draw_indexed
tests broken by #2716shader_primitive_index::draw
and shader_primitive_index::draw_indexed
tests fail on Linux Vulkan back end
To be fair, they added the tests Any validation errors? What gpu? |
The GPU is "AMD RADV POLARIS12", according to wgpu-info. |
No Vulkan validation errors. |
I've asked some colleagues to run the tests on their Windows machines with Radeon Pro WX3100 and Radeon Pro WX3200 GPUs. For them the tests succeed. Not sure if those GPUs have exactly the same chipset, though... I guess it is more likely that the problem is with the Linux driver. And it's even more likely the problem is with my changes 😝 Unfortunately I'm not experienced with (the internals of) Vulkan or spir-v, so I don't really know where to start looking here... My current understanding is that the |
I'm still trying to understand the context here, but I think your change was correct: Vulkan §15.7 Builtin Variables says:
Since WGSL can't provide geometry or mesh shaders, a WGSL fragment shader's But the
|
In case anyone's curious, I looked at the SPIR-V generated for the test's SPIR-V disassembly; SPIR-V ; Version: 1.0 ; Generator: Khronos; 28 ; Bound: 28 ; Schema: 0 OpCapability Shader OpCapability Geometry %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %fs_main "fs_main" %index %15 OpExecutionMode %fs_main OriginUpperLeft OpSource GLSL 450 OpName %index "index" OpName %fs_main "fs_main" OpDecorate %index BuiltIn PrimitiveId OpDecorate %15 Location 0 %void = OpTypeVoid %float = OpTypeFloat 32 %float_0 = OpConstant %float 0 %float_1 = OpConstant %float 1 %uint = OpTypeInt 32 0 %uint_2 = OpConstant %uint 2 %uint_0 = OpConstant %uint 0 %v2float = OpTypeVector %float 2 %v4float = OpTypeVector %float 4 %_ptr_Input_uint = OpTypePointer Input %uint %index = OpVariable %_ptr_Input_uint Input %_ptr_Output_v4float = OpTypePointer Output %v4float %15 = OpVariable %_ptr_Output_v4float Output %18 = OpTypeFunction %void %bool = OpTypeBool %fs_main = OpFunction %void None %18 %11 = OpLabel %14 = OpLoad %uint %index OpBranch %19 %19 = OpLabel %20 = OpUMod %uint %14 %uint_2 %22 = OpIEqual %bool %20 %uint_0 OpSelectionMerge %23 None OpBranchConditional %22 %24 %25 %24 = OpLabel %26 = OpCompositeConstruct %v4float %float_1 %float_0 %float_0 %float_1 OpStore %15 %26 OpReturn %25 = OpLabel %27 = OpCompositeConstruct %v4float %float_0 %float_0 %float_1 %float_1 OpStore %15 %27 OpReturn %23 = OpLabel OpReturn OpFunctionEnd |
So my machine actually just colors both the NE and SW corners red. There's no blue. (NW and SE are white, as expected.) I wonder if this isn't a difference in rasterization. |
To avoid rasterization problems, I tried enlarging the texture to 4x4 and shifting the triangles to ensure that there was a pixel in each quadrant that was fully covered. With Vulkan "AMD RADV POLARIS12", everything is red. I suspect this means that the primitive ID is always being passed as zero. With Vulkan "llvmpipe (LLVM 14.0.0, 256 bits)", the unmodified test passes. |
For the record, these drivers are from |
On Fedora, mesa-vulkan-drivers 22.0.3 AMD RADV POLARIS12 just colors both the NE and SW corners red. There's no blue. (NW and SE are white, as expected.) I suspect this means that the primitive ID is always being passed as zero. This is probably not just due to a difference in rasterization: I tried enlarging the texture to 4x4 and shifting the triangles to ensure that there was a pixel in each quadrant that was fully covered. With Vulkan "llvmpipe (LLVM 14.0.0, 256 bits)", the unmodified test passes. This is probably limited to Linux, but `wgpu_tests::common::TestParameters` doesn't have a slot for that. Fixes gfx-rs#2751.
On Fedora, mesa-vulkan-drivers 22.0.3 AMD RADV POLARIS12 just colors both the NE and SW corners red. There's no blue. (NW and SE are white, as expected.) I suspect this means that the primitive ID is always being passed as zero. This is probably not just due to a difference in rasterization: I tried enlarging the texture to 4x4 and shifting the triangles to ensure that there was a pixel in each quadrant that was fully covered. With Vulkan "llvmpipe (LLVM 14.0.0, 256 bits)", the unmodified test passes. This is probably limited to Linux, but `wgpu_tests::common::TestParameters` doesn't have a slot for that. Fixes gfx-rs#2751.
On Fedora, mesa-vulkan-drivers 22.0.3 AMD RADV POLARIS12 just colors both the NE and SW corners red. There's no blue. (NW and SE are white, as expected.) I suspect this means that the primitive ID is always being passed as zero. This is probably not just due to a difference in rasterization: I tried enlarging the texture to 4x4 and shifting the triangles to ensure that there was a pixel in each quadrant that was fully covered. With Vulkan "llvmpipe (LLVM 14.0.0, 256 bits)", the unmodified test passes. This is probably limited to Linux, but `wgpu_tests::common::TestParameters` doesn't have a slot for that. Fixes gfx-rs#2751.
On Fedora, mesa-vulkan-drivers 22.0.3 AMD RADV POLARIS12 just colors both the NE and SW corners red. There's no blue. (NW and SE are white, as expected.) I suspect this means that the primitive ID is always being passed as zero. This is probably not just due to a difference in rasterization: I tried enlarging the texture to 4x4 and shifting the triangles to ensure that there was a pixel in each quadrant that was fully covered. With Vulkan "llvmpipe (LLVM 14.0.0, 256 bits)", the unmodified test passes. This is probably limited to Linux, but `wgpu_tests::common::TestParameters` doesn't have a slot for that. Fixes #2751.
For what it;s worth I still get this test failure on "Intel(R) UHD Graphics (TGL GT2)", Arch Linux. vulkan-intel 22.1.2-1 |
@victorvde My test exception was for AMD only, so it would not have affected Intel. See the PR for how I added it. Maybe the bug is in all the Mesa Vulkan drivers, though. |
This removes an expected failure on AMD RADV. I guess gfx-rs#2751 was our bug all along.
This removes an expected failure on AMD RADV. I guess gfx-rs#2751 was our bug all along.
This removes an expected failure on AMD RADV. I guess gfx-rs#2751 was our bug all along.
This removes an expected failure on AMD RADV. I guess gfx-rs#2751 was our bug all along.
This removes an expected failure on AMD RADV. I guess gfx-rs#2751 was our bug all along.
This removes an expected failure on AMD RADV. I guess gfx-rs#2751 was our bug all along.
This removes an expected failure on AMD RADV. I guess #2751 was our bug all along.
#2716 seems to break the following tests on Linux on a Vulkan back end:
The text was updated successfully, but these errors were encountered: