aboutsummaryrefslogtreecommitdiff
path: root/layers/multi.cpp
diff options
context:
space:
mode:
authorJon Ashburn <jon@lunarg.com>2015-04-02 12:06:28 -0600
committerChia-I Wu <olv@lunarg.com>2015-04-16 17:33:29 +0800
commit3d98fec8d8c5b9a1e9b45c32ba50ca4ab651754c (patch)
tree1d07d0cc90ffc123e33a0425a0c8d811ed4fe36d /layers/multi.cpp
parent07b8cc331f9eb6c53cd32d4eeaff1c12f4685203 (diff)
downloadusermoji-3d98fec8d8c5b9a1e9b45c32ba50ca4ab651754c.tar.xz
layers: Update GetExtensionSupport() to handle queries for layer name
Layers now support loader querying their layer name via GetExtensionSupport in addition to EnumerateLayers. Also fixed bugs in ObjectTracker and DrawState to add the extensions they support in the GetExtensionSupport queries. Conflicts: xgl-layer-generate.py
Diffstat (limited to 'layers/multi.cpp')
-rw-r--r--layers/multi.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/layers/multi.cpp b/layers/multi.cpp
index 3a5e4fcc..f8c2bc9f 100644
--- a/layers/multi.cpp
+++ b/layers/multi.cpp
@@ -132,6 +132,8 @@ XGL_LAYER_EXPORT void * XGLAPI multi1GetProcAddr(XGL_PHYSICAL_GPU gpu, const cha
return (void *) multi1CreateGraphicsPipeline;
else if (!strncmp("xglStorePipeline", pName, sizeof ("xglStorePipeline")))
return (void *) multi1StorePipeline;
+ else if (!strncmp("xglGetExtensionSupport", pName, sizeof ("xglGetExtensionSupport")))
+ return (void *) xglGetExtensionSupport;
else {
if (gpuw->pGPA == NULL)
return NULL;
@@ -232,6 +234,8 @@ XGL_LAYER_EXPORT void * XGLAPI multi2GetProcAddr(XGL_PHYSICAL_GPU gpu, const cha
return (void *) multi2CreateCommandBuffer;
else if (!strncmp("xglBeginCommandBuffer", pName, sizeof ("xglBeginCommandBuffer")))
return (void *) multi2BeginCommandBuffer;
+ else if (!strncmp("xglGetExtensionSupport", pName, sizeof ("xglGetExtensionSupport")))
+ return (void *) xglGetExtensionSupport;
else {
if (gpuw->pGPA == NULL)
return NULL;
@@ -255,6 +259,33 @@ XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglEnumerateLayers(XGL_PHYSICAL_GPU gpu, size
return XGL_SUCCESS;
}
+XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetExtensionSupport(XGL_PHYSICAL_GPU gpu, const char* pExtName)
+{
+ XGL_RESULT result;
+ XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu;
+
+ /* This entrypoint is NOT going to init it's own dispatch table since loader calls here early */
+ if (!strncmp(pExtName, "multi1", strlen("multi1")))
+ {
+ result = XGL_SUCCESS;
+ } else if (!strncmp(pExtName, "multi2", strlen("multi2")))
+ {
+ result = XGL_SUCCESS;
+ } else if (!tableMap1.empty() && (tableMap1.find(gpuw) != tableMap1.end()))
+ {
+ XGL_LAYER_DISPATCH_TABLE* pTable = tableMap1[gpuw];
+ result = pTable->GetExtensionSupport((XGL_PHYSICAL_GPU)gpuw->nextObject, pExtName);
+ } else if (!tableMap2.empty() && (tableMap2.find(gpuw) != tableMap2.end()))
+ {
+ XGL_LAYER_DISPATCH_TABLE* pTable = tableMap2[gpuw];
+ result = pTable->GetExtensionSupport((XGL_PHYSICAL_GPU)gpuw->nextObject, pExtName);
+ } else
+ {
+ result = XGL_ERROR_INVALID_EXTENSION;
+ }
+ return result;
+}
+
XGL_LAYER_EXPORT void * XGLAPI xglGetProcAddr(XGL_PHYSICAL_GPU gpu, const char* pName)
{
// to find each layers GPA routine Loader will search via "<layerName>GetProcAddr"