update to the latest vertex fetch proposal
The main difference is that XGL_SLOT_VERTEX_INPUT is replaced by
xglCmdBindVertexData. This actually simplifies the driver, which can be seen
with:
$ git show icd/intel/
The new proposal also adds some new formats, but they are ignored for now
because they are marked TBD.
diff --git a/layers/api_dump.c b/layers/api_dump.c
index ef6ea30..7896544 100644
--- a/layers/api_dump.c
+++ b/layers/api_dump.c
@@ -194,6 +194,8 @@
nextTable.CmdBindDescriptorSet = fpCmdBindDescriptorSet;
CmdBindDynamicMemoryViewType fpCmdBindDynamicMemoryView = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindDynamicMemoryView");
nextTable.CmdBindDynamicMemoryView = fpCmdBindDynamicMemoryView;
+ CmdBindVertexDataType fpCmdBindVertexData = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindVertexData");
+ nextTable.CmdBindVertexData = fpCmdBindVertexData;
CmdBindIndexDataType fpCmdBindIndexData = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindIndexData");
nextTable.CmdBindIndexData = fpCmdBindIndexData;
CmdBindAttachmentsType fpCmdBindAttachments = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindAttachments");
@@ -998,6 +1000,12 @@
}
}
+XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBindVertexData(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset, XGL_UINT binding)
+{
+ nextTable.CmdBindVertexData(cmdBuffer, mem, offset, binding);
+ printf("xglCmdBindVertexData(cmdBuffer = %p, mem = %p, offset = %i, binding = %d)\n", (void*)cmdBuffer, (void*)mem, offset, binding);
+}
+
XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBindIndexData(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset, XGL_INDEX_TYPE indexType)
{
nextTable.CmdBindIndexData(cmdBuffer, mem, offset, indexType);
@@ -1507,6 +1515,8 @@
return xglCmdBindDescriptorSet;
else if (!strncmp("xglCmdBindDynamicMemoryView", (const char *) funcName, sizeof("xglCmdBindDynamicMemoryView")))
return xglCmdBindDynamicMemoryView;
+ else if (!strncmp("xglCmdBindVertexData", (const char *) funcName, sizeof("xglCmdBindVertexData")))
+ return xglCmdBindVertexData;
else if (!strncmp("xglCmdBindIndexData", (const char *) funcName, sizeof("xglCmdBindIndexData")))
return xglCmdBindIndexData;
else if (!strncmp("xglCmdBindAttachments", (const char *) funcName, sizeof("xglCmdBindAttachments")))
diff --git a/layers/basic_plugin.c b/layers/basic_plugin.c
index 4126e3e..ac8362d 100644
--- a/layers/basic_plugin.c
+++ b/layers/basic_plugin.c
@@ -92,6 +92,7 @@
myTable.CmdBindStateObject = fpGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (const XGL_CHAR *) "xglCmdBindStateObject");
myTable.CmdBindDescriptorSet = fpGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (const XGL_CHAR *) "xglCmdBindDescriptorSet");
myTable.CmdBindDynamicMemoryView = fpGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (const XGL_CHAR *) "xglCmdBindDynamicMemoryView");
+ myTable.CmdBindVertexData = fpGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (const XGL_CHAR *) "xglCmdBindVertexData");
myTable.CmdBindIndexData = fpGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (const XGL_CHAR *) "xglCmdBindIndexData");
myTable.CmdBindAttachments = fpGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (const XGL_CHAR *) "xglCmdBindAttachments");
myTable.CmdPrepareMemoryRegions = fpGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (const XGL_CHAR *) "xglCmdPrepareMemoryRegions");
@@ -337,6 +338,8 @@
return myTable.CmdBindDescriptorSet;
else if (!strncmp("xglCmdBindDynamicMemoryView", (const char *) pName, sizeof ("xglCmdBindDynamicMemoryView")))
return myTable.CmdBindDynamicMemoryView;
+ else if (!strncmp("xglCmdBindVertexData", (const char *) pName, sizeof ("xglCmdBindVertexData")))
+ return myTable.CmdBindVertexData;
else if (!strncmp("xglCmdBindIndexData", (const char *) pName, sizeof ("xglCmdBindIndexData")))
return myTable.CmdBindIndexData;
else if (!strncmp("xglCmdBindAttachments", (const char *) pName, sizeof ("xglCmdBindAttachments")))
diff --git a/layers/draw_state.c b/layers/draw_state.c
index 89f0f04..8a2e4c7 100644
--- a/layers/draw_state.c
+++ b/layers/draw_state.c
@@ -354,10 +354,6 @@
if (MAPPING_SAMPLER != slotBinding)
error = XGL_TRUE;
break;
- case XGL_SLOT_VERTEX_INPUT:
- if (MAPPING_MEMORY != slotBinding)
- error = XGL_TRUE;
- break;
case XGL_SLOT_SHADER_UAV:
if (MAPPING_MEMORY != slotBinding)
error = XGL_TRUE;
@@ -602,6 +598,8 @@
nextTable.CmdBindDescriptorSet = fpCmdBindDescriptorSet;
CmdBindDynamicMemoryViewType fpCmdBindDynamicMemoryView = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindDynamicMemoryView");
nextTable.CmdBindDynamicMemoryView = fpCmdBindDynamicMemoryView;
+ CmdBindVertexDataType fpCmdBindVertexData = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindVertexData");
+ nextTable.CmdBindVertexData = fpCmdBindVertexData;
CmdBindIndexDataType fpCmdBindIndexData = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindIndexData");
nextTable.CmdBindIndexData = fpCmdBindIndexData;
CmdBindAttachmentsType fpCmdBindAttachments = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindAttachments");
@@ -1248,6 +1246,11 @@
nextTable.CmdBindDynamicMemoryView(cmdBuffer, pipelineBindPoint, pMemView);
}
+XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBindVertexData(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset, XGL_UINT binding)
+{
+ nextTable.CmdBindVertexData(cmdBuffer, mem, offset, binding);
+}
+
XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBindIndexData(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset, XGL_INDEX_TYPE indexType)
{
nextTable.CmdBindIndexData(cmdBuffer, mem, offset, indexType);
diff --git a/layers/object_track.c b/layers/object_track.c
index 07b617d..e0be185 100644
--- a/layers/object_track.c
+++ b/layers/object_track.c
@@ -252,6 +252,8 @@
nextTable.CmdBindDescriptorSet = fpCmdBindDescriptorSet;
CmdBindDynamicMemoryViewType fpCmdBindDynamicMemoryView = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindDynamicMemoryView");
nextTable.CmdBindDynamicMemoryView = fpCmdBindDynamicMemoryView;
+ CmdBindVertexDataType fpCmdBindVertexData = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindVertexData");
+ nextTable.CmdBindVertexData = fpCmdBindVertexData;
CmdBindIndexDataType fpCmdBindIndexData = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindIndexData");
nextTable.CmdBindIndexData = fpCmdBindIndexData;
CmdBindAttachmentsType fpCmdBindAttachments = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindAttachments");
@@ -988,6 +990,13 @@
nextTable.CmdBindDynamicMemoryView(cmdBuffer, pipelineBindPoint, pMemView);
}
+XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBindVertexData(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset, XGL_UINT binding)
+{
+ ll_increment_use_count((XGL_VOID*)cmdBuffer);
+ printf("OBJ[%llu] : USING cmdBuffer object %p (%lu total uses)\n", object_track_index++, (void*)cmdBuffer, ll_get_obj_uses((XGL_VOID*)cmdBuffer));
+ nextTable.CmdBindVertexData(cmdBuffer, mem, offset, binding);
+}
+
XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBindIndexData(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset, XGL_INDEX_TYPE indexType)
{
ll_increment_use_count((XGL_VOID*)cmdBuffer);
diff --git a/layers/xgl_string_helper.h b/layers/xgl_string_helper.h
index c61a21c..f1edc90 100644
--- a/layers/xgl_string_helper.h
+++ b/layers/xgl_string_helper.h
@@ -166,9 +166,6 @@
case XGL_SLOT_UNUSED:
return "XGL_SLOT_UNUSED";
- case XGL_SLOT_VERTEX_INPUT:
- return "XGL_SLOT_VERTEX_INPUT";
-
default:
return "Unhandled XGL_DESCRIPTOR_SET_SLOT_TYPE";
}