assert(!err);
/* bind memory */
- err = xglBindObjectMemory(demo->depth.image,
+ err = xglBindObjectMemory(demo->depth.image, 0,
demo->depth.mem, 0);
assert(!err);
assert(!err);
/* bind memory */
- err = xglBindObjectMemory(demo->textures[i].image,
+ err = xglBindObjectMemory(demo->textures[i].image, 0,
demo->textures[i].mem, 0);
assert(!err);
err = xglUnmapMemory(demo->uniform_data.mem);
assert(!err);
- err = xglBindObjectMemory(demo->uniform_data.buf,
+ err = xglBindObjectMemory(demo->uniform_data.buf, 0,
demo->uniform_data.mem, 0);
assert(!err);
assert(!err);
/* bind memory */
- err = xglBindObjectMemory(demo->depth.image,
+ err = xglBindObjectMemory(demo->depth.image, 0,
demo->depth.mem, 0);
assert(!err);
assert(!err);
/* bind memory */
- err = xglBindObjectMemory(demo->textures[i].image,
+ err = xglBindObjectMemory(demo->textures[i].image, 0,
demo->textures[i].mem, 0);
assert(!err);
err = xglUnmapMemory(demo->vertices.mem);
assert(!err);
- err = xglBindObjectMemory(demo->vertices.buf, demo->vertices.mem, 0);
+ err = xglBindObjectMemory(demo->vertices.buf, 0, demo->vertices.mem, 0);
assert(!err);
demo->vertices.vi.sType = XGL_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_CREATE_INFO;
xglDestroyObject(demo->pipeline);
xglDestroyObject(demo->desc_layout);
- xglBindObjectMemory(demo->vertices.buf, XGL_NULL_HANDLE, 0);
+ xglBindObjectMemory(demo->vertices.buf, 0, XGL_NULL_HANDLE, 0);
xglDestroyObject(demo->vertices.buf);
xglFreeMemory(demo->vertices.mem);
for (i = 0; i < DEMO_TEXTURE_COUNT; i++) {
xglDestroyObject(demo->textures[i].view);
- xglBindObjectMemory(demo->textures[i].image, XGL_NULL_HANDLE, 0);
+ xglBindObjectMemory(demo->textures[i].image, 0, XGL_NULL_HANDLE, 0);
xglDestroyObject(demo->textures[i].image);
xglFreeMemory(demo->textures[i].mem);
xglDestroyObject(demo->textures[i].sampler);
}
xglDestroyObject(demo->depth.view);
- xglBindObjectMemory(demo->depth.image, XGL_NULL_HANDLE, 0);
+ xglBindObjectMemory(demo->depth.image, 0, XGL_NULL_HANDLE, 0);
xglDestroyObject(demo->depth.image);
xglFreeMemory(demo->depth.mem);
ICD_EXPORT XGL_RESULT XGLAPI xglBindObjectMemory(
XGL_OBJECT object,
+ XGL_UINT allocationIdx,
XGL_GPU_MEMORY mem_,
XGL_GPU_SIZE memOffset)
{
ICD_EXPORT XGL_RESULT XGLAPI xglBindObjectMemoryRange(
XGL_OBJECT object,
+ XGL_UINT allocationIdx,
XGL_GPU_SIZE rangeOffset,
XGL_GPU_SIZE rangeSize,
XGL_GPU_MEMORY mem,
ICD_EXPORT XGL_RESULT XGLAPI xglBindImageMemoryRange(
XGL_IMAGE image,
+ XGL_UINT allocationIdx,
const XGL_IMAGE_MEMORY_BIND_INFO* bindInfo,
XGL_GPU_MEMORY mem,
XGL_GPU_SIZE memOffset)
typedef XGL_RESULT (XGLAPI *xglOpenPeerImageType)(XGL_DEVICE device, const XGL_PEER_IMAGE_OPEN_INFO* pOpenInfo, XGL_IMAGE* pImage, XGL_GPU_MEMORY* pMem);
typedef XGL_RESULT (XGLAPI *xglDestroyObjectType)(XGL_OBJECT object);
typedef XGL_RESULT (XGLAPI *xglGetObjectInfoType)(XGL_BASE_OBJECT object, XGL_OBJECT_INFO_TYPE infoType, XGL_SIZE* pDataSize, XGL_VOID* pData);
-typedef XGL_RESULT (XGLAPI *xglBindObjectMemoryType)(XGL_OBJECT object, XGL_GPU_MEMORY mem, XGL_GPU_SIZE memOffset);
-typedef XGL_RESULT (XGLAPI *xglBindObjectMemoryRangeType)(XGL_OBJECT object, XGL_GPU_SIZE rangeOffset, XGL_GPU_SIZE rangeSize, XGL_GPU_MEMORY mem, XGL_GPU_SIZE memOffset);
-typedef XGL_RESULT (XGLAPI *xglBindImageMemoryRangeType)(XGL_IMAGE image, const XGL_IMAGE_MEMORY_BIND_INFO* bindInfo, XGL_GPU_MEMORY mem, XGL_GPU_SIZE memOffset);
+typedef XGL_RESULT (XGLAPI *xglBindObjectMemoryType)(XGL_OBJECT object, XGL_UINT allocationIdx, XGL_GPU_MEMORY mem, XGL_GPU_SIZE memOffset);
+typedef XGL_RESULT (XGLAPI *xglBindObjectMemoryRangeType)(XGL_OBJECT object, XGL_UINT allocationIdx, XGL_GPU_SIZE rangeOffset, XGL_GPU_SIZE rangeSize, XGL_GPU_MEMORY mem, XGL_GPU_SIZE memOffset);
+typedef XGL_RESULT (XGLAPI *xglBindImageMemoryRangeType)(XGL_IMAGE image, XGL_UINT allocationIdx, const XGL_IMAGE_MEMORY_BIND_INFO* bindInfo, XGL_GPU_MEMORY mem, XGL_GPU_SIZE memOffset);
typedef XGL_RESULT (XGLAPI *xglCreateFenceType)(XGL_DEVICE device, const XGL_FENCE_CREATE_INFO* pCreateInfo, XGL_FENCE* pFence);
typedef XGL_RESULT (XGLAPI *xglGetFenceStatusType)(XGL_FENCE fence);
typedef XGL_RESULT (XGLAPI *xglWaitForFencesType)(XGL_DEVICE device, XGL_UINT fenceCount, const XGL_FENCE* pFences, XGL_BOOL waitAll, XGL_UINT64 timeout);
XGL_RESULT XGLAPI xglBindObjectMemory(
XGL_OBJECT object,
+ XGL_UINT allocationIdx,
XGL_GPU_MEMORY mem,
XGL_GPU_SIZE memOffset);
XGL_RESULT XGLAPI xglBindObjectMemoryRange(
XGL_OBJECT object,
+ XGL_UINT allocationIdx,
XGL_GPU_SIZE rangeOffset,
XGL_GPU_SIZE rangeSize,
XGL_GPU_MEMORY mem,
XGL_RESULT XGLAPI xglBindImageMemoryRange(
XGL_IMAGE image,
+ XGL_UINT allocationIdx,
const XGL_IMAGE_MEMORY_BIND_INFO* bindInfo,
XGL_GPU_MEMORY mem,
XGL_GPU_SIZE memOffset);
return result;
}
-XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglBindObjectMemory(XGL_OBJECT object, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset)
+XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglBindObjectMemory(XGL_OBJECT object, XGL_UINT allocationIdx, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset)
{
- XGL_RESULT result = nextTable.BindObjectMemory(object, mem, offset);
+ XGL_RESULT result = nextTable.BindObjectMemory(object, allocationIdx, mem, offset);
return result;
}
return result;
}
-XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglBindObjectMemory(XGL_OBJECT object, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset)
+XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglBindObjectMemory(XGL_OBJECT object, XGL_UINT allocationIdx, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset)
{
- XGL_RESULT result = nextTable.BindObjectMemory(object, mem, offset);
+ XGL_RESULT result = nextTable.BindObjectMemory(object, allocationIdx, mem, offset);
// Track objects tied to memory
if (XGL_FALSE == updateObjectBinding(object, mem)) {
char str[1024];
err = xglAllocMemory(dev_.obj(), &mem_info, &event_mem);
ASSERT_XGL_SUCCESS(err);
- err = xglBindObjectMemory(event, event_mem, 0);
+ err = xglBindObjectMemory(event, 0, event_mem, 0);
ASSERT_XGL_SUCCESS(err);
err = xglResetEvent(event);
bufs[2].unmap();
// All done with event memory, clean up
- err = xglBindObjectMemory(event, XGL_NULL_HANDLE, 0);
+ err = xglBindObjectMemory(event, 0, XGL_NULL_HANDLE, 0);
ASSERT_XGL_SUCCESS(err);
err = xglDestroyObject(event);
err = xglAllocMemory(device(), &mem_info, &m_image_mem);
ASSERT_XGL_SUCCESS(err);
- err = xglBindObjectMemory(m_image, m_image_mem, 0);
+ err = xglBindObjectMemory(m_image, 0, m_image_mem, 0);
ASSERT_XGL_SUCCESS(err);
}
void XglImageTest::DestroyImage()
{
// All done with image memory, clean up
- ASSERT_XGL_SUCCESS(xglBindObjectMemory(m_image, XGL_NULL_HANDLE, 0));
+ ASSERT_XGL_SUCCESS(xglBindObjectMemory(m_image, 0, XGL_NULL_HANDLE, 0));
ASSERT_XGL_SUCCESS(xglFreeMemory(m_image_mem));
err = xglAllocMemory(device(), &mem_info, &event_mem);
ASSERT_XGL_SUCCESS(err);
- err = xglBindObjectMemory(event, event_mem, 0);
+ err = xglBindObjectMemory(event, 0, event_mem, 0);
ASSERT_XGL_SUCCESS(err);
err = xglResetEvent(event);
// TODO: Test actual synchronization with command buffer event.
// All done with event memory, clean up
- err = xglBindObjectMemory(event, XGL_NULL_HANDLE, 0);
+ err = xglBindObjectMemory(event, 0, XGL_NULL_HANDLE, 0);
ASSERT_XGL_SUCCESS(err);
err = xglDestroyObject(event);
err = xglAllocMemory(device(), &mem_info, &query_mem);
ASSERT_XGL_SUCCESS(err);
- err = xglBindObjectMemory(query_pool, query_mem, 0);
+ err = xglBindObjectMemory(query_pool, 0, query_mem, 0);
ASSERT_XGL_SUCCESS(err);
// TODO: Test actual synchronization with command buffer event.
}
// All done with QueryPool memory, clean up
- err = xglBindObjectMemory(query_pool, XGL_NULL_HANDLE, 0);
+ err = xglBindObjectMemory(query_pool, 0, XGL_NULL_HANDLE, 0);
ASSERT_XGL_SUCCESS(err);
err = xglDestroyObject(query_pool);
err = xglAllocMemory(device(), &mem_info, &image_mem);
ASSERT_XGL_SUCCESS(err);
- err = xglBindObjectMemory(image, image_mem, 0);
+ err = xglBindObjectMemory(image, 0, image_mem, 0);
ASSERT_XGL_SUCCESS(err);
// typedef struct _XGL_IMAGE_VIEW_CREATE_INFO
// TODO: Test image memory.
// All done with image memory, clean up
- ASSERT_XGL_SUCCESS(xglBindObjectMemory(image, XGL_NULL_HANDLE, 0));
+ ASSERT_XGL_SUCCESS(xglBindObjectMemory(image, 0, XGL_NULL_HANDLE, 0));
ASSERT_XGL_SUCCESS(xglFreeMemory(image_mem));
ASSERT_XGL_SUCCESS(err);
/* bind memory */
- err = xglBindObjectMemory(m_depthStencilImage, m_depthStencilMem, 0);
+ err = xglBindObjectMemory(m_depthStencilImage, 0, m_depthStencilMem, 0);
ASSERT_XGL_SUCCESS(err);
XGL_DYNAMIC_DS_STATE_CREATE_INFO depthStencil = {};
void Object::bind_memory(uint32_t alloc_idx, const GpuMemory &mem, XGL_GPU_SIZE mem_offset)
{
- EXPECT(!alloc_idx && xglBindObjectMemory(obj(), mem.obj(), mem_offset) == XGL_SUCCESS);
+ EXPECT(!alloc_idx && xglBindObjectMemory(obj(), 0, mem.obj(), mem_offset) == XGL_SUCCESS);
}
void Object::bind_memory(uint32_t alloc_idx, XGL_GPU_SIZE offset, XGL_GPU_SIZE size,
const GpuMemory &mem, XGL_GPU_SIZE mem_offset)
{
- EXPECT(!alloc_idx && xglBindObjectMemoryRange(obj(), offset, size, mem.obj(), mem_offset) == XGL_SUCCESS);
+ EXPECT(!alloc_idx && xglBindObjectMemoryRange(obj(), 0, offset, size, mem.obj(), mem_offset) == XGL_SUCCESS);
}
void Object::unbind_memory(uint32_t alloc_idx)
{
- EXPECT(!alloc_idx && xglBindObjectMemory(obj(), XGL_NULL_HANDLE, 0) == XGL_SUCCESS);
+ EXPECT(!alloc_idx && xglBindObjectMemory(obj(), 0, XGL_NULL_HANDLE, 0) == XGL_SUCCESS);
}
void Object::unbind_memory()
void Image::bind_memory(uint32_t alloc_idx, const XGL_IMAGE_MEMORY_BIND_INFO &info,
const GpuMemory &mem, XGL_GPU_SIZE mem_offset)
{
- EXPECT(!alloc_idx && xglBindImageMemoryRange(obj(), &info, mem.obj(), mem_offset) == XGL_SUCCESS);
+ EXPECT(!alloc_idx && xglBindImageMemoryRange(obj(), 0, &info, mem.obj(), mem_offset) == XGL_SUCCESS);
}
XGL_SUBRESOURCE_LAYOUT Image::subresource_layout(const XGL_IMAGE_SUBRESOURCE &subres) const
Proto("XGL_RESULT", "BindObjectMemory",
[Param("XGL_OBJECT", "object"),
+ Param("XGL_UINT", "allocationIdx"),
Param("XGL_GPU_MEMORY", "mem"),
Param("XGL_GPU_SIZE", "memOffset")]),
Proto("XGL_RESULT", "BindObjectMemoryRange",
[Param("XGL_OBJECT", "object"),
+ Param("XGL_UINT", "allocationIdx"),
Param("XGL_GPU_SIZE", "rangeOffset"),
Param("XGL_GPU_SIZE", "rangeSize"),
Param("XGL_GPU_MEMORY", "mem"),
Proto("XGL_RESULT", "BindImageMemoryRange",
[Param("XGL_IMAGE", "image"),
+ Param("XGL_UINT", "allocationIdx"),
Param("const XGL_IMAGE_MEMORY_BIND_INFO*", "bindInfo"),
Param("XGL_GPU_MEMORY", "mem"),
Param("XGL_GPU_SIZE", "memOffset")]),