aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCourtney Goeltzenleuchter <courtney@LunarG.com>2015-03-05 18:09:39 -0700
committerChia-I Wu <olv@lunarg.com>2015-04-16 17:33:24 +0800
commited667a540d22881cbf4c2e02a21083a19f64f183 (patch)
tree81802a973fa4ab937e2f610d6626df741a56eb13
parent39e2cb26e9d82c8b8d8e5c94681493ac0f37a551 (diff)
downloadusermoji-ed667a540d22881cbf4c2e02a21083a19f64f183.tar.xz
xgl: Impossible to expose multi-function queues
Bug: 13363 header version: r29597 (0.51.0) included review feedback.
-rw-r--r--demos/cube.c28
-rw-r--r--demos/tri.c28
-rw-r--r--icd/nulldrv/nulldrv.c2
-rw-r--r--include/xgl.h20
-rw-r--r--layers/draw_state.c6
-rw-r--r--layers/draw_state.cpp6
-rw-r--r--layers/draw_state.h2
-rw-r--r--layers/glave_snapshot.c4
-rw-r--r--layers/mem_tracker.cpp4
-rw-r--r--xgl.py2
10 files changed, 67 insertions, 35 deletions
diff --git a/demos/cube.c b/demos/cube.c
index 6553962e..601d1deb 100644
--- a/demos/cube.c
+++ b/demos/cube.c
@@ -204,6 +204,8 @@ struct demo {
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;
@@ -892,7 +894,7 @@ static void demo_prepare_textures(struct demo *demo)
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
};
@@ -1517,7 +1519,7 @@ static void demo_prepare(struct demo *demo)
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;
@@ -1687,6 +1689,8 @@ static void demo_init_xgl(struct demo *demo)
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) {
@@ -1711,7 +1715,25 @@ static void demo_init_xgl(struct demo *demo)
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);
}
diff --git a/demos/tri.c b/demos/tri.c
index d0fa4380..d42719f7 100644
--- a/demos/tri.c
+++ b/demos/tri.c
@@ -38,6 +38,8 @@ struct demo {
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;
@@ -539,7 +541,7 @@ static void demo_prepare_textures(struct demo *demo)
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
};
@@ -1071,7 +1073,7 @@ static void demo_prepare(struct demo *demo)
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;
@@ -1208,6 +1210,8 @@ static void demo_init_xgl(struct demo *demo)
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) {
@@ -1232,7 +1236,25 @@ static void demo_init_xgl(struct demo *demo)
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);
}
diff --git a/icd/nulldrv/nulldrv.c b/icd/nulldrv/nulldrv.c
index e9db89c5..dd5061ee 100644
--- a/icd/nulldrv/nulldrv.c
+++ b/icd/nulldrv/nulldrv.c
@@ -1198,7 +1198,7 @@ ICD_EXPORT XGL_RESULT XGLAPI xglDestroyDevice(
ICD_EXPORT XGL_RESULT XGLAPI xglGetDeviceQueue(
XGL_DEVICE device,
- XGL_QUEUE_TYPE queueType,
+ uint32_t queueNodeIndex,
uint32_t queueIndex,
XGL_QUEUE* pQueue)
{
diff --git a/include/xgl.h b/include/xgl.h
index ec71157e..6ec7ed54 100644
--- a/include/xgl.h
+++ b/include/xgl.h
@@ -33,7 +33,7 @@
#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"
@@ -108,18 +108,6 @@ XGL_DEFINE_SUBCLASS_HANDLE(XGL_RENDER_PASS, XGL_OBJECT)
// 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,
@@ -2071,7 +2059,7 @@ typedef struct _XGL_CMD_BUFFER_CREATE_INFO
{
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;
@@ -2231,7 +2219,7 @@ typedef XGL_RESULT (XGLAPI *xglCreateDeviceType)(XGL_PHYSICAL_GPU gpu, const XGL
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);
@@ -2394,7 +2382,7 @@ XGL_RESULT XGLAPI xglEnumerateLayers(
XGL_RESULT XGLAPI xglGetDeviceQueue(
XGL_DEVICE device,
- XGL_QUEUE_TYPE queueType,
+ uint32_t queueNodeIndex,
uint32_t queueIndex,
XGL_QUEUE* pQueue);
diff --git a/layers/draw_state.c b/layers/draw_state.c
index 07cb1b57..b79a015c 100644
--- a/layers/draw_state.c
+++ b/layers/draw_state.c
@@ -1116,11 +1116,11 @@ static void resetCB(const XGL_CMD_BUFFER cb)
// 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;
}
@@ -2022,7 +2022,7 @@ XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateCommandBuffer(XGL_DEVICE device, con
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);
diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp
index 9dbabae9..97e31fe5 100644
--- a/layers/draw_state.cpp
+++ b/layers/draw_state.cpp
@@ -1032,11 +1032,11 @@ static void resetCB(const XGL_CMD_BUFFER cb)
}
// 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;
}
}
@@ -1873,7 +1873,7 @@ XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateCommandBuffer(XGL_DEVICE device, con
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);
diff --git a/layers/draw_state.h b/layers/draw_state.h
index f5230f81..cb71b34f 100644
--- a/layers/draw_state.h
+++ b/layers/draw_state.h
@@ -222,7 +222,7 @@ typedef enum _CB_STATE
// 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
diff --git a/layers/glave_snapshot.c b/layers/glave_snapshot.c
index b652706e..2f645a5d 100644
--- a/layers/glave_snapshot.c
+++ b/layers/glave_snapshot.c
@@ -587,12 +587,12 @@ XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglEnumerateLayers(XGL_PHYSICAL_GPU gpu, size
}
}
-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;
}
diff --git a/layers/mem_tracker.cpp b/layers/mem_tracker.cpp
index 914b510b..9b75d503 100644
--- a/layers/mem_tracker.cpp
+++ b/layers/mem_tracker.cpp
@@ -859,9 +859,9 @@ XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglEnumerateLayers(XGL_PHYSICAL_GPU gpu, size
}
}
-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;
}
diff --git a/xgl.py b/xgl.py
index c29cb8bf..c183fa6f 100644
--- a/xgl.py
+++ b/xgl.py
@@ -263,7 +263,7 @@ core = Extension(
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")]),