FrozenFirebat
FrozenFirebat

Reputation: 13

vulkan - compute queuefamily - vkGetDeviceQueue - access violation

let me preface this with I've only tested this on my card (AMD r9 380).

vkGetPhysicalDeviceQueueFamilyProperties() finds 3 QueueFamilies. One containing all the normal bits (graphics, compute, transfer), one missing graphics, and one missing compute and graphics. I've taken it as the one missing Graphics is the Compute queue family, and the one missing compute and graphics is the Transfer queue family.

vkGetDeviceQueue(instance, computeFamily, 0, &pComputeQueue); instance being VkInstance, computeFamily being a uint32_t index value, 0 being the index of the queue requested, and pComputeQueue is a VkQueue. Attempting to run this function with this parameters generates Vulkan01.exe: 0xC0000005: Access violation writing location 0x0000000000000000.

vkGetDeviceQueue() returns just fine for Graphics, Presentation (which returns the same as graphics on my implementation, as expected), and transfer.

So the question is: Why would I get an error trying to return a handle to one of my listed Queue Families? Is it likely just my card? (some of the Sascha Williams examples won't run on my computer either, so I theorize that perhaps my card is just too old for some features?)

Upvotes: 0

Views: 805

Answers (1)

Nicol Bolas
Nicol Bolas

Reputation: 474406

Why would I get an error trying to return a handle to one of my listed Queue Families?

Because they're not "your" queue families. They're the device's queue families.

They only become "your" queue families if you ask for them at device creation time. Your VkDeviceCreateInfo structure must have a VkDeviceQueueCreateInfo that has a queueFamilyIndex referencing the compute queue family, requesting (at least) one queue from that family.

Upvotes: 1

Related Questions