aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Ashburn <jon@lunarg.com>2015-01-20 16:59:42 -0700
committerCourtney Goeltzenleuchter <courtney@LunarG.com>2015-02-04 17:58:09 -0700
commit6dd064e0b67ea4073dcfa27f3879f3ec3ea538be (patch)
tree6ed5ef53925fabb06b371abbce7d7323750a597d
parente4207b405c795ffb94ae7043d93e9b3e55925d50 (diff)
downloadusermoji-6dd064e0b67ea4073dcfa27f3879f3ec3ea538be.tar.xz
memory alloc: Remove last heaps from memory alloc and requirements
Also reorder memory_alloc_info struct as memPriority added back in as last member in struct. Conflicts: demos/cube.c demos/tri.c icd/intel/buf.c icd/intel/event.c icd/intel/img.c icd/intel/mem.c icd/intel/pipeline.c icd/intel/query.c include/xgl.h tests/image_tests.cpp tests/init.cpp tests/render_tests.cpp tests/xgltestbinding.cpp tests/xgltestbinding.h
-rw-r--r--demos/cube.c19
-rw-r--r--demos/tri.c18
-rw-r--r--include/xgl.h13
3 files changed, 4 insertions, 46 deletions
diff --git a/demos/cube.c b/demos/cube.c
index aabfecc3..8c68e317 100644
--- a/demos/cube.c
+++ b/demos/cube.c
@@ -473,7 +473,6 @@ static void demo_prepare_depth(struct demo *demo)
.allocationSize = 0,
.memProps = XGL_MEMORY_PROPERTY_GPU_ONLY,
.memType = XGL_MEMORY_TYPE_IMAGE,
- .heapCount = 0,
.memPriority = XGL_MEMORY_PRIORITY_NORMAL,
};
XGL_DEPTH_STENCIL_VIEW_CREATE_INFO view = {
@@ -519,11 +518,6 @@ static void demo_prepare_depth(struct demo *demo)
img_alloc.samples = img_reqs.samples;
for (XGL_UINT i = 0; i < num_allocations; i ++) {
mem_alloc.allocationSize = mem_reqs[i].size;
- mem_alloc.heapCount = mem_reqs[i].heapCount;
- XGL_UINT heapInfo[mem_reqs[i].heapCount];
- mem_alloc.pHeaps = (const XGL_UINT *) heapInfo;
- memcpy(heapInfo, mem_reqs[i].pHeaps,
- sizeof(mem_reqs[i].pHeaps[0]) * mem_reqs[i].heapCount);
/* allocate memory */
err = xglAllocMemory(demo->device, &mem_alloc,
@@ -742,8 +736,6 @@ static void demo_prepare_textures(struct demo *demo)
.allocationSize = 0,
.memProps = XGL_MEMORY_PROPERTY_GPU_ONLY,
.memType = XGL_MEMORY_TYPE_IMAGE,
- .heapCount = 0,
- .pHeaps = 0,
.memPriority = XGL_MEMORY_PRIORITY_NORMAL,
};
XGL_IMAGE_VIEW_CREATE_INFO view = {
@@ -797,11 +789,6 @@ static void demo_prepare_textures(struct demo *demo)
img_alloc.samples = img_reqs.samples;
for (XGL_UINT j = 0; j < num_allocations; j ++) {
mem_alloc.allocationSize = mem_reqs[j].size;
- mem_alloc.heapCount = mem_reqs[j].heapCount;
- XGL_UINT heapInfo[mem_reqs[j].heapCount];
- mem_alloc.pHeaps = (const XGL_UINT *)heapInfo;
- memcpy(heapInfo, mem_reqs[j].pHeaps,
- sizeof(mem_reqs[j].pHeaps[0]) * mem_reqs[j].heapCount);
/* allocate memory */
err = xglAllocMemory(demo->device, &mem_alloc,
@@ -860,7 +847,6 @@ void demo_prepare_cube_data_buffer(struct demo *demo)
.allocationSize = 0,
.memProps = XGL_MEMORY_PROPERTY_CPU_VISIBLE_BIT,
.memType = XGL_MEMORY_TYPE_BUFFER,
- .heapCount = 0,
.memPriority = XGL_MEMORY_PRIORITY_NORMAL,
};
XGL_MEMORY_REQUIREMENTS *mem_reqs;
@@ -916,11 +902,6 @@ void demo_prepare_cube_data_buffer(struct demo *demo)
buf_alloc.usage = buf_reqs.usage;
for (XGL_UINT i = 0; i < num_allocations; i ++) {
alloc_info.allocationSize = mem_reqs[i].size;
- alloc_info.heapCount = mem_reqs[i].heapCount;
- XGL_UINT heapInfo[mem_reqs[i].heapCount];
- alloc_info.pHeaps = (const XGL_UINT *)heapInfo;
- memcpy(heapInfo, mem_reqs[i].pHeaps,
- sizeof(mem_reqs[i].pHeaps[0]) * mem_reqs[i].heapCount);
err = xglAllocMemory(demo->device, &alloc_info, &(demo->uniform_data.mem[i]));
assert(!err);
diff --git a/demos/tri.c b/demos/tri.c
index 95297352..413431fc 100644
--- a/demos/tri.c
+++ b/demos/tri.c
@@ -291,7 +291,6 @@ static void demo_prepare_depth(struct demo *demo)
.allocationSize = 0,
.memProps = XGL_MEMORY_PROPERTY_GPU_ONLY,
.memType = XGL_MEMORY_TYPE_IMAGE,
- .heapCount = 0,
.memPriority = XGL_MEMORY_PRIORITY_NORMAL,
};
XGL_DEPTH_STENCIL_VIEW_CREATE_INFO view = {
@@ -338,11 +337,6 @@ static void demo_prepare_depth(struct demo *demo)
img_alloc.samples = img_reqs.samples;
for (XGL_UINT i = 0; i < num_allocations; i ++) {
mem_alloc.allocationSize = mem_reqs[i].size;
- mem_alloc.heapCount = mem_reqs[i].heapCount;
- XGL_UINT heapInfo[mem_reqs[i].heapCount];
- mem_alloc.pHeaps = (const XGL_UINT *)heapInfo;
- memcpy(heapInfo, mem_reqs[i].pHeaps,
- sizeof(mem_reqs[i].pHeaps[0]) * mem_reqs[i].heapCount);
/* allocate memory */
err = xglAllocMemory(demo->device, &mem_alloc,
@@ -413,7 +407,6 @@ static void demo_prepare_textures(struct demo *demo)
.allocationSize = 0,
.memProps = XGL_MEMORY_PROPERTY_GPU_ONLY,
.memType = XGL_MEMORY_TYPE_IMAGE,
- .heapCount = 0,
.memPriority = XGL_MEMORY_PRIORITY_NORMAL,
};
XGL_IMAGE_VIEW_CREATE_INFO view = {
@@ -467,11 +460,6 @@ static void demo_prepare_textures(struct demo *demo)
img_alloc.samples = img_reqs.samples;
for (XGL_UINT j = 0; j < num_allocations; j ++) {
mem_alloc.allocationSize = mem_reqs[j].size;
- mem_alloc.heapCount = mem_reqs[j].heapCount;
- XGL_UINT heapInfo[mem_reqs[j].heapCount];
- mem_alloc.pHeaps = (const XGL_UINT *)heapInfo;
- memcpy(heapInfo, mem_reqs[j].pHeaps,
- sizeof(mem_reqs[j].pHeaps[0]) * mem_reqs[j].heapCount);
/* allocate memory */
err = xglAllocMemory(demo->device, &mem_alloc,
@@ -546,8 +534,6 @@ static void demo_prepare_vertices(struct demo *demo)
.allocationSize = 0,
.memProps = XGL_MEMORY_PROPERTY_CPU_VISIBLE_BIT,
.memType = XGL_MEMORY_TYPE_BUFFER,
- .heapCount = 0,
- .pHeaps = 0,
.memPriority = XGL_MEMORY_PRIORITY_NORMAL,
};
XGL_MEMORY_REQUIREMENTS *mem_reqs;
@@ -582,10 +568,6 @@ static void demo_prepare_vertices(struct demo *demo)
buf_alloc.usage = buf_reqs.usage;
for (XGL_UINT i = 0; i < num_allocations; i ++) {
mem_alloc.allocationSize = mem_reqs[i].size;
- mem_alloc.heapCount = mem_reqs[i].heapCount;
- mem_alloc.pHeaps = mem_reqs[i].pHeaps;
- memcpy((void *) mem_alloc.pHeaps, mem_reqs[i].pHeaps,
- sizeof(mem_reqs[i].pHeaps[0]) * mem_reqs[i].heapCount);
err = xglAllocMemory(demo->device, &mem_alloc, &demo->vertices.mem[i]);
assert(!err);
diff --git a/include/xgl.h b/include/xgl.h
index f8f6a7a2..a9aa3cbf 100644
--- a/include/xgl.h
+++ b/include/xgl.h
@@ -995,7 +995,6 @@ typedef enum _XGL_MEMORY_TYPE
XGL_MEMORY_TYPE_OTHER = 0x00000000, // device memory that is not any of the others
XGL_MEMORY_TYPE_BUFFER = 0x00000001, // memory for buffers and associated information
XGL_MEMORY_TYPE_IMAGE = 0x00000002, // memory for images and associated information
- XGL_MEMORY_TYPE_PIPELINE = 0x00000003, // memory for pipeline objects
XGL_MAX_ENUM(_XGL_MEMORY_TYPE)
} XGL_MEMORY_TYPE;
@@ -1032,9 +1031,9 @@ typedef enum _XGL_BUFFER_VIEW_TYPE
XGL_BUFFER_VIEW_TYPED = 0x00000001, // Typed buffer, format and channels are used (TBO, image buffer)
XGL_BUFFER_VIEW_STRUCTURED = 0x00000002, // Structured buffer, stride is used (VBO, DX-style structured buffer)
- XGL_BUFFER_VIEW_TYPE_BEGIN_RANGE = XGL_BUFFER_VIEW_RAW,
- XGL_BUFFER_VIEW_TYPE_END_RANGE = XGL_BUFFER_VIEW_STRUCTURED,
- XGL_NUM_BUFFER_VIEW_TYPE = (XGL_BUFFER_VIEW_TYPE_END_RANGE - XGL_BUFFER_VIEW_TYPE_BEGIN_RANGE + 1),
+ XGL_BUFFER_VIEW_TYPE_BEGIN_RANGE = XGL_BUFFER_VIEW_RAW,
+ XGL_BUFFER_VIEW_TYPE_END_RANGE = XGL_BUFFER_VIEW_STRUCTURED,
+ XGL_NUM_BUFFER_VIEW_TYPE = (XGL_BUFFER_VIEW_TYPE_END_RANGE - XGL_BUFFER_VIEW_TYPE_BEGIN_RANGE + 1),
XGL_MAX_ENUM(_XGL_BUFFER_VIEW_TYPE)
} XGL_BUFFER_VIEW_TYPE;
@@ -1318,11 +1317,9 @@ typedef struct _XGL_MEMORY_ALLOC_INFO
XGL_STRUCTURE_TYPE sType; // Must be XGL_STRUCTURE_TYPE_MEMORY_ALLOC_INFO
XGL_VOID* pNext; // Pointer to next structure
XGL_GPU_SIZE allocationSize; // Size of memory allocation
- XGL_UINT heapCount;
- const XGL_UINT* pHeaps;
- XGL_MEMORY_PRIORITY memPriority;
XGL_FLAGS memProps; // XGL_MEMORY_PROPERTY_FLAGS
XGL_MEMORY_TYPE memType;
+ XGL_MEMORY_PRIORITY memPriority;
} XGL_MEMORY_ALLOC_INFO;
// This structure is included in the XGL_MEMORY_ALLOC_INFO chain
@@ -1364,8 +1361,6 @@ typedef struct _XGL_MEMORY_REQUIREMENTS
XGL_GPU_SIZE size; // Specified in bytes
XGL_GPU_SIZE alignment; // Specified in bytes
XGL_GPU_SIZE granularity; // Granularity on which xglBindObjectMemoryRange can bind sub-ranges of memory specified in bytes (usually the page size)
- XGL_UINT heapCount;
- XGL_UINT* pHeaps;
XGL_FLAGS memProps; // XGL_MEMORY_PROPERTY_FLAGS
XGL_MEMORY_TYPE memType;
} XGL_MEMORY_REQUIREMENTS;