Commit 026ceefe by Alexis Hetu Committed by Alexis Hétu

Support device groups with a single physical device

Device groups can be used to: - only render on certain physical devices, using a device mask - only allocate memory on certain physical devices, using a device mask - distribute rendering across different physical devices, using different render areas for each physical device SwiftShader only supports a single physical device, so most of these settings can simply be ignored. Bug b/117974925 Change-Id: Ic61e1551e3a54671f8780cb7bec5c67aaa37ec09 Tests: dEQP-VK.device_group.* Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/30790 Presubmit-Ready: Alexis Hétu <sugoi@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarAlexis Hétu <sugoi@google.com>
parent 4ac42dbf
......@@ -1140,7 +1140,7 @@ void CommandBuffer::executeCommands(uint32_t commandBufferCount, const VkCommand
void CommandBuffer::setDeviceMask(uint32_t deviceMask)
{
UNIMPLEMENTED("setDeviceMask");
// SwiftShader only has one device, so we ignore the device mask
}
void CommandBuffer::dispatchBase(uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ,
......
......@@ -554,6 +554,10 @@ VKAPI_ATTR VkResult VKAPI_CALL vkAllocateMemory(VkDevice device, const VkMemoryA
// "If the pNext chain includes a VkMemoryDedicatedAllocateInfo structure, then that structure
// includes a handle of the sole buffer or image resource that the memory *can* be bound to."
break;
case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO:
// This extension controls on which physical devices the memory gets allocated.
// SwiftShader only has a single physical device, so this extension does nothing in this case.
break;
default:
UNIMPLEMENTED("allocationInfo->sType");
break;
......@@ -1788,9 +1792,22 @@ VKAPI_ATTR void VKAPI_CALL vkCmdBeginRenderPass(VkCommandBuffer commandBuffer, c
TRACE("(VkCommandBuffer commandBuffer = %p, const VkRenderPassBeginInfo* pRenderPassBegin = %p, VkSubpassContents contents = %d)",
commandBuffer, pRenderPassBegin, contents);
if(pRenderPassBegin->pNext)
const VkBaseInStructure* renderPassBeginInfo = reinterpret_cast<const VkBaseInStructure*>(pRenderPassBegin->pNext);
while(renderPassBeginInfo)
{
UNIMPLEMENTED("pRenderPassBegin->pNext");
switch(renderPassBeginInfo->sType)
{
case VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO:
// This extension controls which render area is used on which physical device,
// in order to distribute rendering between multiple physical devices.
// SwiftShader only has a single physical device, so this extension does nothing in this case.
break;
default:
UNIMPLEMENTED("renderPassBeginInfo->sType");
break;
}
renderPassBeginInfo = renderPassBeginInfo->pNext;
}
vk::Cast(commandBuffer)->beginRenderPass(pRenderPassBegin->renderPass, pRenderPassBegin->framebuffer,
......@@ -1875,8 +1892,9 @@ VKAPI_ATTR void VKAPI_CALL vkGetDeviceGroupPeerMemoryFeatures(VkDevice device, u
VKAPI_ATTR void VKAPI_CALL vkCmdSetDeviceMask(VkCommandBuffer commandBuffer, uint32_t deviceMask)
{
TRACE("()");
UNIMPLEMENTED("vkCmdSetDeviceMask");
TRACE("(VkCommandBuffer commandBuffer = %p, uint32_t deviceMask = %d", commandBuffer, deviceMask);
vk::Cast(commandBuffer)->setDeviceMask(deviceMask);
}
VKAPI_ATTR void VKAPI_CALL vkCmdDispatchBase(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment