memory alloc: Remove alignment from alloc_info structure
authorJon Ashburn <jon@lunarg.com>
Tue, 20 Jan 2015 23:38:02 +0000 (16:38 -0700)
committerCourtney Goeltzenleuchter <courtney@LunarG.com>
Thu, 5 Feb 2015 00:58:09 +0000 (17:58 -0700)
Conflicts:
icd/intel/mem.c

demos/cube.c
demos/tri.c
icd/intel/mem.c
icd/intel/wsi_x11.c
include/xgl.h
tests/blit_tests.cpp
tests/image_tests.cpp
tests/init.cpp
tests/render_tests.cpp
tests/xgltestbinding.h

index e482ffd..aabfecc 100644 (file)
@@ -471,7 +471,6 @@ static void demo_prepare_depth(struct demo *demo)
         .sType = XGL_STRUCTURE_TYPE_MEMORY_ALLOC_INFO,
         .pNext = &img_alloc,
         .allocationSize = 0,
-        .alignment = 0,
         .memProps = XGL_MEMORY_PROPERTY_GPU_ONLY,
         .memType = XGL_MEMORY_TYPE_IMAGE,
         .heapCount = 0,
@@ -520,7 +519,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.alignment = mem_reqs[i].alignment;
         mem_alloc.heapCount = mem_reqs[i].heapCount;
         XGL_UINT heapInfo[mem_reqs[i].heapCount];
         mem_alloc.pHeaps = (const XGL_UINT *) heapInfo;
@@ -742,7 +740,6 @@ static void demo_prepare_textures(struct demo *demo)
             .sType = XGL_STRUCTURE_TYPE_MEMORY_ALLOC_INFO,
             .pNext = &img_alloc,
             .allocationSize = 0,
-            .alignment = 0,
             .memProps = XGL_MEMORY_PROPERTY_GPU_ONLY,
             .memType = XGL_MEMORY_TYPE_IMAGE,
             .heapCount = 0,
@@ -800,7 +797,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.alignment = mem_reqs[j].alignment;
             mem_alloc.heapCount = mem_reqs[j].heapCount;
             XGL_UINT heapInfo[mem_reqs[j].heapCount];
             mem_alloc.pHeaps = (const XGL_UINT *)heapInfo;
@@ -862,7 +858,6 @@ void demo_prepare_cube_data_buffer(struct demo *demo)
         .sType = XGL_STRUCTURE_TYPE_MEMORY_ALLOC_INFO,
         .pNext = &buf_alloc,
         .allocationSize = 0,
-        .alignment = 0,
         .memProps = XGL_MEMORY_PROPERTY_CPU_VISIBLE_BIT,
         .memType = XGL_MEMORY_TYPE_BUFFER,
         .heapCount = 0,
@@ -921,7 +916,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.alignment = mem_reqs[i].alignment;
         alloc_info.heapCount = mem_reqs[i].heapCount;
         XGL_UINT heapInfo[mem_reqs[i].heapCount];
         alloc_info.pHeaps = (const XGL_UINT *)heapInfo;
index 32a37a1..9529735 100644 (file)
@@ -289,7 +289,6 @@ static void demo_prepare_depth(struct demo *demo)
         .sType = XGL_STRUCTURE_TYPE_MEMORY_ALLOC_INFO,
         .pNext = &img_alloc,
         .allocationSize = 0,
-        .alignment = 0,
         .memProps = XGL_MEMORY_PROPERTY_GPU_ONLY,
         .memType = XGL_MEMORY_TYPE_IMAGE,
         .heapCount = 0,
@@ -339,7 +338,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.alignment = mem_reqs[i].alignment;
         mem_alloc.heapCount = mem_reqs[i].heapCount;
         XGL_UINT heapInfo[mem_reqs[i].heapCount];
         mem_alloc.pHeaps = (const XGL_UINT *)heapInfo;
@@ -413,7 +411,6 @@ static void demo_prepare_textures(struct demo *demo)
             .sType = XGL_STRUCTURE_TYPE_MEMORY_ALLOC_INFO,
             .pNext = &img_alloc,
             .allocationSize = 0,
-            .alignment = 0,
             .memProps = XGL_MEMORY_PROPERTY_GPU_ONLY,
             .memType = XGL_MEMORY_TYPE_IMAGE,
             .heapCount = 0,
@@ -470,7 +467,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.alignment = mem_reqs[j].alignment;
             mem_alloc.heapCount = mem_reqs[j].heapCount;
             XGL_UINT heapInfo[mem_reqs[j].heapCount];
             mem_alloc.pHeaps = (const XGL_UINT *)heapInfo;
@@ -548,7 +544,6 @@ static void demo_prepare_vertices(struct demo *demo)
         .sType = XGL_STRUCTURE_TYPE_MEMORY_ALLOC_INFO,
         .pNext = &buf_alloc,
         .allocationSize = 0,
-        .alignment = 0,
         .memProps = XGL_MEMORY_PROPERTY_CPU_VISIBLE_BIT,
         .memType = XGL_MEMORY_TYPE_BUFFER,
         .heapCount = 0,
@@ -587,7 +582,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.alignment = mem_reqs[i].alignment;
         mem_alloc.heapCount = mem_reqs[i].heapCount;
         mem_alloc.pHeaps = mem_reqs[i].pHeaps;
         memcpy((void *) mem_alloc.pHeaps, mem_reqs[i].pHeaps,
index c2c31fe..736febf 100644 (file)
@@ -35,8 +35,6 @@ XGL_RESULT intel_mem_alloc(struct intel_dev *dev,
     struct intel_mem *mem;
 
     /* ignore any IMAGE_INFO and BUFFER_INFO usage: they don't alter allocations */
-    if ((info->alignment != 0) && (4096 % info->alignment))
-        return XGL_ERROR_INVALID_ALIGNMENT;
     if (info->heapCount != 1 || info->pHeaps[0] != 0)
         return XGL_ERROR_INVALID_POINTER;
 
index e6edee4..110d1b4 100644 (file)
@@ -518,7 +518,6 @@ static XGL_RESULT wsi_x11_img_create(struct intel_wsi_x11 *x11,
     memset(&mem_info, 0, sizeof(mem_info));
     mem_info.sType = XGL_STRUCTURE_TYPE_MEMORY_ALLOC_INFO;
     mem_info.allocationSize = img->total_size;
-    mem_info.alignment = 4096;
     mem_info.memProps =  0;
     mem_info.memType = XGL_MEMORY_TYPE_IMAGE;
     mem_info.heapCount = 1;
index 6f4659b..f8f6a7a 100644 (file)
@@ -1318,7 +1318,6 @@ 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_GPU_SIZE                            alignment;
     XGL_UINT                                heapCount;
     const XGL_UINT*                         pHeaps;
     XGL_MEMORY_PRIORITY                     memPriority;
index 599a041..015b6e5 100644 (file)
@@ -745,7 +745,6 @@ TEST_F(XglCmdCopyBufferTest, RAWHazard)
     memset(&mem_info, 0, sizeof(mem_info));
     mem_info.sType = XGL_STRUCTURE_TYPE_MEMORY_ALLOC_INFO;
     mem_info.allocationSize = mem_req.size;
-    mem_info.alignment = mem_req.alignment;
     mem_info.heapCount = mem_req.heapCount;
     mem_info.pHeaps = heapInfo;
     memcpy(heapInfo, mem_req.pHeaps, sizeof(XGL_UINT)*mem_info.heapCount);
index f3f4d7b..f8ba526 100644 (file)
@@ -227,14 +227,13 @@ void XglImageTest::CreateImage(XGL_UINT w, XGL_UINT h)
     for (XGL_UINT i = 0; i < num_allocations; i ++) {
         ASSERT_NE(0, mem_req[i].size) << "xglGetObjectInfo (Image): Failed - expect images to require memory";
         mem_info.allocationSize = mem_req[i].size;
-        mem_info.alignment = mem_req[i].alignment;
         mem_info.heapCount = mem_req[i].heapCount;
         XGL_UINT heapInfo[mem_req[i].heapCount];
         mem_info.pHeaps = heapInfo;
         memcpy(heapInfo, mem_req[i].pHeaps, sizeof(XGL_UINT)*mem_info.heapCount);
         mem_info.memProps = XGL_MEMORY_PROPERTY_SHAREABLE_BIT;
-        mem_info.memPriority = XGL_MEMORY_PRIORITY_NORMAL;
         mem_info.memType = XGL_MEMORY_TYPE_IMAGE;
+        mem_info.memPriority = XGL_MEMORY_PRIORITY_NORMAL;
 
         /* allocate memory */
         err = xglAllocMemory(device(), &mem_info, &m_image_mem[i]);
index 60cca3e..129423a 100644 (file)
@@ -163,7 +163,6 @@ TEST_F(XglTest, AllocMemory) {
 
     alloc_info.sType = XGL_STRUCTURE_TYPE_MEMORY_ALLOC_INFO;
     alloc_info.allocationSize = 1024 * 1024; // 1MB
-    alloc_info.alignment = 0;
     alloc_info.memProps = XGL_MEMORY_PROPERTY_SHAREABLE_BIT |
                           XGL_MEMORY_PROPERTY_CPU_VISIBLE_BIT;
     alloc_info.memType = XGL_MEMORY_TYPE_OTHER,
@@ -226,7 +225,6 @@ TEST_F(XglTest, Event) {
     memset(&mem_info, 0, sizeof(mem_info));
     mem_info.sType = XGL_STRUCTURE_TYPE_MEMORY_ALLOC_INFO;
     mem_info.allocationSize = mem_req.size;
-    mem_info.alignment = mem_req.alignment;
     mem_info.memProps = XGL_MEMORY_PROPERTY_SHAREABLE_BIT;
     mem_info.heapCount = mem_req.heapCount;
     mem_info.pHeaps = heapInfo;
@@ -363,7 +361,6 @@ TEST_F(XglTest, Query) {
     mem_info.sType = XGL_STRUCTURE_TYPE_MEMORY_ALLOC_INFO;
     // TODO: Is a simple multiple all that's needed here?
     mem_info.allocationSize = mem_req.size * MAX_QUERY_SLOTS;
-    mem_info.alignment = mem_req.alignment;
     mem_info.heapCount = mem_req.heapCount;
     mem_info.pHeaps = heapInfo;
     memcpy(heapInfo, mem_req.pHeaps, sizeof(XGL_UINT)*mem_info.heapCount);
@@ -649,7 +646,6 @@ void XglTest::CreateImageTest()
     mem_info.sType = XGL_STRUCTURE_TYPE_MEMORY_ALLOC_INFO;
     mem_info.pNext = &img_alloc;
     mem_info.allocationSize = mem_req.size;
-    mem_info.alignment = mem_req.alignment;
     mem_info.heapCount = mem_req.heapCount;
     mem_info.pHeaps = heapInfo;
     memcpy(heapInfo, mem_req.pHeaps, sizeof(XGL_UINT)*mem_info.heapCount);
index b3dc938..1608c0e 100644 (file)
@@ -363,7 +363,6 @@ void XglRenderTest::InitDepthStencil()
     mem_alloc.sType = XGL_STRUCTURE_TYPE_MEMORY_ALLOC_INFO;
     mem_alloc.pNext = &img_alloc;
     mem_alloc.allocationSize = 0;
-    mem_alloc.alignment = 0;
     mem_alloc.memProps = XGL_MEMORY_PROPERTY_GPU_ONLY;
     mem_alloc.memType = XGL_MEMORY_TYPE_IMAGE;
     mem_alloc.heapCount = 0;
@@ -397,7 +396,6 @@ void XglRenderTest::InitDepthStencil()
     img_alloc.samples = img_reqs.samples;
     for (XGL_UINT i = 0; i < num_allocations; i ++) {
         mem_alloc.allocationSize = mem_reqs[i].size;
-        mem_alloc.alignment = mem_reqs[i].alignment;
         mem_alloc.heapCount = mem_reqs[i].heapCount;
         XGL_UINT heapInfo[mem_reqs[i].heapCount];
         mem_alloc.pHeaps = heapInfo;
index bf8cb4d..3de6bfc 100644 (file)
@@ -626,7 +626,6 @@ inline XGL_MEMORY_ALLOC_INFO GpuMemory::alloc_info(const XGL_MEMORY_REQUIREMENTS
         info.pNext = (XGL_VOID *) next_info;
 
     info.allocationSize = reqs.size;
-    info.alignment = reqs.alignment;
     info.heapCount = reqs.heapCount;
     info.pHeaps = reqs.pHeaps;
     info.memProps = reqs.memProps;