XGL_PHYSICAL_GPU gpu;
XGL_DEVICE device;
XGL_QUEUE queue;
+ uint32_t graphics_queue_node_index;
+ XGL_PHYSICAL_GPU_QUEUE_PROPERTIES *queue_props;
int width, height;
XGL_FORMAT format;
XGL_CMD_BUFFER_CREATE_INFO cmd_buf_create_info = {
.sType = XGL_STRUCTURE_TYPE_CMD_BUFFER_CREATE_INFO,
.pNext = NULL,
- .queueType = XGL_QUEUE_TYPE_GRAPHICS,
+ .queueNodeIndex = demo->graphics_queue_node_index,
.flags = 0
};
const XGL_CMD_BUFFER_CREATE_INFO cmd = {
.sType = XGL_STRUCTURE_TYPE_CMD_BUFFER_CREATE_INFO,
.pNext = NULL,
- .queueType = XGL_QUEUE_TYPE_GRAPHICS,
+ .queueNodeIndex = demo->graphics_queue_node_index,
.flags = 0,
};
XGL_RESULT err;
XGL_RESULT err;
uint32_t gpu_count;
uint32_t i;
+ size_t data_size;
+ uint32_t queue_count;
err = xglCreateInstance(&app, NULL, &demo->inst);
if (err == XGL_ERROR_INCOMPATIBLE_DRIVER) {
err = xglCreateDevice(demo->gpu, &device, &demo->device);
assert(!err);
- err = xglGetDeviceQueue(demo->device, XGL_QUEUE_TYPE_GRAPHICS,
+ err = xglGetGpuInfo(demo->gpu, XGL_INFO_TYPE_PHYSICAL_GPU_QUEUE_PROPERTIES,
+ &data_size, NULL);
+ assert(!err);
+
+ demo->queue_props = (XGL_PHYSICAL_GPU_QUEUE_PROPERTIES *) malloc(data_size);
+ err = xglGetGpuInfo(demo->gpu, XGL_INFO_TYPE_PHYSICAL_GPU_QUEUE_PROPERTIES,
+ &data_size, demo->queue_props);
+ assert(!err);
+ queue_count = data_size / sizeof(XGL_PHYSICAL_GPU_QUEUE_PROPERTIES);
+ assert(queue_count >= 1);
+
+ for (i = 0; i < queue_count; i++) {
+ if (demo->queue_props[i].queueFlags & XGL_QUEUE_GRAPHICS_BIT)
+ break;
+ }
+ assert(i < queue_count);
+ demo->graphics_queue_node_index = i;
+
+ err = xglGetDeviceQueue(demo->device, demo->graphics_queue_node_index,
0, &demo->queue);
assert(!err);
}
XGL_PHYSICAL_GPU gpu;
XGL_DEVICE device;
XGL_QUEUE queue;
+ XGL_PHYSICAL_GPU_QUEUE_PROPERTIES *queue_props;
+ uint32_t graphics_queue_node_index;
int width, height;
XGL_FORMAT format;
XGL_CMD_BUFFER_CREATE_INFO cmd_buf_create_info = {
.sType = XGL_STRUCTURE_TYPE_CMD_BUFFER_CREATE_INFO,
.pNext = NULL,
- .queueType = XGL_QUEUE_TYPE_GRAPHICS,
+ .queueNodeIndex = demo->graphics_queue_node_index,
.flags = 0
};
const XGL_CMD_BUFFER_CREATE_INFO cmd = {
.sType = XGL_STRUCTURE_TYPE_CMD_BUFFER_CREATE_INFO,
.pNext = NULL,
- .queueType = XGL_QUEUE_TYPE_GRAPHICS,
+ .queueNodeIndex = demo->graphics_queue_node_index,
.flags = 0,
};
XGL_RESULT err;
XGL_RESULT err;
uint32_t gpu_count;
uint32_t i;
+ size_t data_size;
+ uint32_t queue_count;
err = xglCreateInstance(&app, NULL, &demo->inst);
if (err == XGL_ERROR_INCOMPATIBLE_DRIVER) {
err = xglCreateDevice(demo->gpu, &device, &demo->device);
assert(!err);
- err = xglGetDeviceQueue(demo->device, XGL_QUEUE_TYPE_GRAPHICS,
+ err = xglGetGpuInfo(demo->gpu, XGL_INFO_TYPE_PHYSICAL_GPU_QUEUE_PROPERTIES,
+ &data_size, NULL);
+ assert(!err);
+
+ demo->queue_props = (XGL_PHYSICAL_GPU_QUEUE_PROPERTIES *) malloc(data_size);
+ err = xglGetGpuInfo(demo->gpu, XGL_INFO_TYPE_PHYSICAL_GPU_QUEUE_PROPERTIES,
+ &data_size, demo->queue_props);
+ assert(!err);
+ queue_count = data_size / sizeof(XGL_PHYSICAL_GPU_QUEUE_PROPERTIES);
+ assert(queue_count >= 1);
+
+ for (i = 0; i < queue_count; i++) {
+ if (demo->queue_props[i].queueFlags & XGL_QUEUE_GRAPHICS_BIT)
+ break;
+ }
+ assert(i < queue_count);
+ demo->graphics_queue_node_index = i;
+
+ err = xglGetDeviceQueue(demo->device, demo->graphics_queue_node_index,
0, &demo->queue);
assert(!err);
}
ICD_EXPORT XGL_RESULT XGLAPI xglGetDeviceQueue(
XGL_DEVICE device,
- XGL_QUEUE_TYPE queueType,
+ uint32_t queueNodeIndex,
uint32_t queueIndex,
XGL_QUEUE* pQueue)
{
#include "xglPlatform.h"
// XGL API version supported by this file
-#define XGL_API_VERSION XGL_MAKE_VERSION(0, 50, 1)
+#define XGL_API_VERSION XGL_MAKE_VERSION(0, 51, 0)
#ifdef __cplusplus
extern "C"
// Enumerations
-typedef enum _XGL_QUEUE_TYPE
-{
- XGL_QUEUE_TYPE_GRAPHICS = 0x1,
- XGL_QUEUE_TYPE_COMPUTE = 0x2,
- XGL_QUEUE_TYPE_DMA = 0x3,
-
- XGL_QUEUE_TYPE_BEGIN_RANGE = XGL_QUEUE_TYPE_GRAPHICS,
- XGL_QUEUE_TYPE_END_RANGE = XGL_QUEUE_TYPE_DMA,
- XGL_NUM_QUEUE_TYPE = (XGL_QUEUE_TYPE_END_RANGE - XGL_QUEUE_TYPE_BEGIN_RANGE + 1),
- XGL_MAX_ENUM(_XGL_QUEUE_TYPE)
-} XGL_QUEUE_TYPE;
-
typedef enum _XGL_MEMORY_PRIORITY
{
XGL_MEMORY_PRIORITY_UNUSED = 0x0,
{
XGL_STRUCTURE_TYPE sType; // Must be XGL_STRUCTURE_TYPE_CMD_BUFFER_CREATE_INFO
const void* pNext; // Pointer to next structure
- XGL_QUEUE_TYPE queueType;
+ uint32_t queueNodeIndex;
XGL_FLAGS flags;
} XGL_CMD_BUFFER_CREATE_INFO;
typedef XGL_RESULT (XGLAPI *xglDestroyDeviceType)(XGL_DEVICE device);
typedef XGL_RESULT (XGLAPI *xglGetExtensionSupportType)(XGL_PHYSICAL_GPU gpu, const char* pExtName);
typedef XGL_RESULT (XGLAPI *xglEnumerateLayersType)(XGL_PHYSICAL_GPU gpu, size_t maxLayerCount, size_t maxStringSize, size_t* pOutLayerCount, char* const* pOutLayers, void* pReserved);
-typedef XGL_RESULT (XGLAPI *xglGetDeviceQueueType)(XGL_DEVICE device, XGL_QUEUE_TYPE queueType, uint32_t queueIndex, XGL_QUEUE* pQueue);
+typedef XGL_RESULT (XGLAPI *xglGetDeviceQueueType)(XGL_DEVICE device, uint32_t queueNodeIndex, uint32_t queueIndex, XGL_QUEUE* pQueue);
typedef XGL_RESULT (XGLAPI *xglQueueSubmitType)(XGL_QUEUE queue, uint32_t cmdBufferCount, const XGL_CMD_BUFFER* pCmdBuffers, uint32_t memRefCount, const XGL_MEMORY_REF* pMemRefs, XGL_FENCE fence);
typedef XGL_RESULT (XGLAPI *xglQueueSetGlobalMemReferencesType)(XGL_QUEUE queue, uint32_t memRefCount, const XGL_MEMORY_REF* pMemRefs);
typedef XGL_RESULT (XGLAPI *xglQueueWaitIdleType)(XGL_QUEUE queue);
XGL_RESULT XGLAPI xglGetDeviceQueue(
XGL_DEVICE device,
- XGL_QUEUE_TYPE queueType,
+ uint32_t queueNodeIndex,
uint32_t queueIndex,
XGL_QUEUE* pQueue);
// Reset CB state
GLOBAL_CB_NODE* pSaveNext = pCB->pNextGlobalCBNode;
XGL_FLAGS saveFlags = pCB->flags;
- XGL_QUEUE_TYPE saveQT = pCB->queueType;
+ uint32_t saveQueueNodeIndex = pCB->queueNodeIndex;
memset(pCB, 0, sizeof(GLOBAL_CB_NODE));
pCB->cmdBuffer = cb;
pCB->flags = saveFlags;
- pCB->queueType = saveQT;
+ pCB->queueNodeIndex = saveQueueNodeIndex;
pCB->pNextGlobalCBNode = pSaveNext;
pCB->lastVtxBinding = MAX_BINDING;
}
g_pCmdBufferHead = pCB;
pCB->cmdBuffer = *pCmdBuffer;
pCB->flags = pCreateInfo->flags;
- pCB->queueType = pCreateInfo->queueType;
+ pCB->queueNodeIndex = pCreateInfo->queueNodeIndex;
pCB->lastVtxBinding = MAX_BINDING;
loader_platform_thread_unlock_mutex(&globalLock);
updateCBTracking(*pCmdBuffer);
}
// Reset CB state
XGL_FLAGS saveFlags = pCB->flags;
- XGL_QUEUE_TYPE saveQT = pCB->queueType;
+ uint32_t saveQueueNodeIndex = pCB->queueNodeIndex;
memset(pCB, 0, sizeof(GLOBAL_CB_NODE));
pCB->cmdBuffer = cb;
pCB->flags = saveFlags;
- pCB->queueType = saveQT;
+ pCB->queueNodeIndex = saveQueueNodeIndex;
pCB->lastVtxBinding = MAX_BINDING;
}
}
memset(pCB, 0, sizeof(GLOBAL_CB_NODE));
pCB->cmdBuffer = *pCmdBuffer;
pCB->flags = pCreateInfo->flags;
- pCB->queueType = pCreateInfo->queueType;
+ pCB->queueNodeIndex = pCreateInfo->queueNodeIndex;
pCB->lastVtxBinding = MAX_BINDING;
cmdBufferMap[*pCmdBuffer] = pCB;
loader_platform_thread_unlock_mutex(&globalLock);
// Cmd Buffer Wrapper Struct
typedef struct _GLOBAL_CB_NODE {
XGL_CMD_BUFFER cmdBuffer;
- XGL_QUEUE_TYPE queueType;
+ uint32_t queueNodeIndex;
XGL_FLAGS flags;
XGL_FENCE fence; // fence tracking this cmd buffer
uint64_t numCmds; // number of cmds in this CB
}
}
-XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetDeviceQueue(XGL_DEVICE device, XGL_QUEUE_TYPE queueType, uint32_t queueIndex, XGL_QUEUE* pQueue)
+XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetDeviceQueue(XGL_DEVICE device, uint32_t queueNodeIndex, uint32_t queueIndex, XGL_QUEUE* pQueue)
{
loader_platform_thread_lock_mutex(&objLock);
ll_increment_use_count((void*)device, XGL_OBJECT_TYPE_DEVICE);
loader_platform_thread_unlock_mutex(&objLock);
- XGL_RESULT result = nextTable.GetDeviceQueue(device, queueType, queueIndex, pQueue);
+ XGL_RESULT result = nextTable.GetDeviceQueue(device, queueNodeIndex, queueIndex, pQueue);
return result;
}
}
}
-XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetDeviceQueue(XGL_DEVICE device, XGL_QUEUE_TYPE queueType, uint32_t queueIndex, XGL_QUEUE* pQueue)
+XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetDeviceQueue(XGL_DEVICE device, uint32_t queueNodeIndex, uint32_t queueIndex, XGL_QUEUE* pQueue)
{
- XGL_RESULT result = nextTable.GetDeviceQueue(device, queueType, queueIndex, pQueue);
+ XGL_RESULT result = nextTable.GetDeviceQueue(device, queueNodeIndex, queueIndex, pQueue);
addQueueInfo(*pQueue);
return result;
}
Proto("XGL_RESULT", "GetDeviceQueue",
[Param("XGL_DEVICE", "device"),
- Param("XGL_QUEUE_TYPE", "queueType"),
+ Param("uint32_t", "queueNodeIndex"),
Param("uint32_t", "queueIndex"),
Param("XGL_QUEUE*", "pQueue")]),