memory alloc: Remove last heaps from memory alloc and requirements
authorJon Ashburn <jon@lunarg.com>
Tue, 20 Jan 2015 23:59:42 +0000 (16:59 -0700)
committerCourtney Goeltzenleuchter <courtney@LunarG.com>
Thu, 5 Feb 2015 00:58:09 +0000 (17:58 -0700)
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

demos/cube.c
demos/tri.c
include/xgl.h

index aabfecc31583b3bf1d9f8cc3290bf1fab44387e7..8c68e3178f2e1866816356898f3e62113f4a60b5 100644 (file)
@@ -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);
index 95297352f7b7c445ad03074330f01cd180a0959f..413431fcedc0a66fca9b71757cd088aaa473482d 100644 (file)
@@ -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);
index f8f6a7a284e670a50269b7a4b2b1962397198d85..a9aa3cbf000064dfabba6fb2805cd37d0821cd30 100644 (file)
@@ -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;