Graphics
Intel® graphics drivers and software, compatibility, troubleshooting, performance, and optimization
20843 Discussions

Vulkan driver instancing bug

Marcell_K_
Beginner
1,231 Views

System Setup Information:
-----------------------------------------

System Used: -
CPU SKU: i5 6600K
GPU SKU: HD 530
Processor Line: (Y-Series, U-Series, etc.)
System BIOS Version:
CMOS settings:
Graphics Driver Version: 20.19.15.4473
GOP/VBIOS Version:
Operating System: Windows
OS Version: 10
API: Vulkan 

        apiVersion     = 0x400000  (1.0.0)

        driverVersion  = 65538 (0x10002)
Occurs on non-Intel GPUs?: No (tested on NV)

Steps to Reproduce:
-------------------------------
1.  Create RenderPass & CommandBuffer, set up 2 triangles side - by - side
2.  Use a shader program which outputs gl_InstanceIndex as colour for debugging
3.  Issue vkCmdDraw* against command buffer in pass with firstInstance = 0 on 1st triangle
4.  Issue vkCmdDraw* against command buffer in pass with firstInstance = 1 on 2nd triangle
5.  Observe results (gl_InstanceIndex == 0 for both)
6.  Change code where the two draws are switched
7.  Observe results (gl_InstanceIndex == 1 for both)

Expected Results:
-------------------------------

vkCmdDraw* should use firstInstance given as parameter for the first instance index

Actual Results:
-------------------------------

vkCmdDraw* uses firstInstance set previously and ignores firstInstance argument starting from second draw

Additional Information:
-------------------------------

When viewed in RenderDoc, the second draw appears normally (with correct gl_InstanceIndex), so this parameter might get recorded in the command buffer or the renderpass.

0 Kudos
5 Replies
Michael_C_Intel2
Employee
1,231 Views

Hi Marcell,

I am talking with the Vulkan driver team about your issue I will update you when we learn anything.

-Michael 

 

0 Kudos
Michael_C_Intel2
Employee
1,231 Views

Hi Marcell,

Can you share the code your using to create this issue. Or sample that will reproduce the issue? This will help our investigation. Also which vkCmdDraw* command is it? 

Thanks,

-Michael 

0 Kudos
Marcell_K_
Beginner
1,231 Views

Sure, here you go:

https://github.com/martty/Vulkan/commit/f61c8014123eb474b970a46db2d72ea40434e07e

I modified Sascha Willems's triangle example to show the bug.

I tried both vkCmdDraw and vkCmdDrawIndexed and got the same result. It might work with the indirect ones, those I did not try.

Best regards,

Marcell

0 Kudos
Michael_C_Intel2
Employee
1,231 Views

Thanks! I have passed this along to the team. They reproduced the issue yesterday and are looking for the root cause now.

0 Kudos
Michael_C_Intel2
Employee
1,231 Views

Hi Marcell,

We have found a fix for your issue. I do not have an ETA when it we will have a public driver with the fix yet. It should make it into the first 15.45 driver (current drivers are 15.40). 

-Michael 

0 Kudos
Reply