Chia-I Wu | 82f50aa | 2014-08-05 10:43:03 +0800 | [diff] [blame] | 1 | /* |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 2 | * Vulkan |
Chia-I Wu | 82f50aa | 2014-08-05 10:43:03 +0800 | [diff] [blame] | 3 | * |
| 4 | * Copyright (C) 2014 LunarG, Inc. |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 7 | * copy of this software and associated documentation files (the "Software"), |
| 8 | * to deal in the Software without restriction, including without limitation |
| 9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 10 | * and/or sell copies of the Software, and to permit persons to whom the |
| 11 | * Software is furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included |
| 14 | * in all copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 19 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 22 | * DEALINGS IN THE SOFTWARE. |
Chia-I Wu | 44e4236 | 2014-09-02 08:32:09 +0800 | [diff] [blame] | 23 | * |
| 24 | * Authors: |
| 25 | * Chia-I Wu <olv@lunarg.com> |
Chia-I Wu | 82f50aa | 2014-08-05 10:43:03 +0800 | [diff] [blame] | 26 | */ |
| 27 | |
Courtney Goeltzenleuchter | fb4fb53 | 2014-08-14 09:35:21 -0600 | [diff] [blame] | 28 | #include "dev.h" |
Chia-I Wu | 9e61c0d | 2014-09-15 15:12:06 +0800 | [diff] [blame] | 29 | #include "gpu.h" |
| 30 | #include "mem.h" |
Chia-I Wu | 82f50aa | 2014-08-05 10:43:03 +0800 | [diff] [blame] | 31 | #include "obj.h" |
Chia-I Wu | 82f50aa | 2014-08-05 10:43:03 +0800 | [diff] [blame] | 32 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 33 | VkResult intel_base_get_info(struct intel_base *base, int type, |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 34 | size_t *size, void *data) |
Chia-I Wu | 26f0bd0 | 2014-08-07 10:38:40 +0800 | [diff] [blame] | 35 | { |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 36 | VkResult ret = VK_SUCCESS; |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 37 | size_t s; |
| 38 | uint32_t *count; |
Chia-I Wu | 26f0bd0 | 2014-08-07 10:38:40 +0800 | [diff] [blame] | 39 | |
| 40 | switch (type) { |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 41 | case VK_OBJECT_INFO_TYPE_MEMORY_REQUIREMENTS: |
Jon Ashburn | d803133 | 2015-01-22 10:52:13 -0700 | [diff] [blame] | 42 | { |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 43 | s = sizeof(VkMemoryRequirements); |
Jon Ashburn | d803133 | 2015-01-22 10:52:13 -0700 | [diff] [blame] | 44 | *size = s; |
| 45 | if (data == NULL) |
| 46 | return ret; |
| 47 | memset(data, 0, s); |
Jeremy Hayes | d02809a | 2015-04-15 14:17:56 -0600 | [diff] [blame] | 48 | VkMemoryRequirements *mem_req = data; |
| 49 | mem_req->memPropsAllowed = INTEL_MEMORY_PROPERTY_ALL; |
Jon Ashburn | d803133 | 2015-01-22 10:52:13 -0700 | [diff] [blame] | 50 | break; |
| 51 | } |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 52 | case VK_OBJECT_INFO_TYPE_MEMORY_ALLOCATION_COUNT: |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 53 | *size = sizeof(uint32_t); |
Jon Ashburn | a9ae383 | 2015-01-16 09:37:43 -0700 | [diff] [blame] | 54 | if (data == NULL) |
| 55 | return ret; |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 56 | count = (uint32_t *) data; |
Jon Ashburn | a9ae383 | 2015-01-16 09:37:43 -0700 | [diff] [blame] | 57 | *count = 1; |
| 58 | break; |
Chia-I Wu | 26f0bd0 | 2014-08-07 10:38:40 +0800 | [diff] [blame] | 59 | default: |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 60 | ret = VK_ERROR_INVALID_VALUE; |
Chia-I Wu | 26f0bd0 | 2014-08-07 10:38:40 +0800 | [diff] [blame] | 61 | break; |
| 62 | } |
| 63 | |
| 64 | return ret; |
| 65 | } |
| 66 | |
Chia-I Wu | f13ed3c | 2015-02-22 14:09:00 +0800 | [diff] [blame] | 67 | static bool base_dbg_copy_create_info(const struct intel_handle *handle, |
| 68 | struct intel_base_dbg *dbg, |
Chia-I Wu | 1f8fc7c | 2014-08-07 11:09:11 +0800 | [diff] [blame] | 69 | const void *create_info) |
| 70 | { |
| 71 | const union { |
| 72 | const void *ptr; |
| 73 | const struct { |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 74 | VkStructureType struct_type; |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 75 | void *next; |
Chia-I Wu | 1f8fc7c | 2014-08-07 11:09:11 +0800 | [diff] [blame] | 76 | } *header; |
| 77 | } info = { .ptr = create_info }; |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 78 | size_t shallow_copy = 0; |
Chia-I Wu | 1f8fc7c | 2014-08-07 11:09:11 +0800 | [diff] [blame] | 79 | |
| 80 | if (!create_info) |
| 81 | return true; |
| 82 | |
Chia-I Wu | b1076d7 | 2014-08-18 16:10:20 +0800 | [diff] [blame] | 83 | switch (dbg->type) { |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 84 | case VK_DBG_OBJECT_DEVICE: |
| 85 | assert(info.header->struct_type == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO); |
Chia-I Wu | 1f8fc7c | 2014-08-07 11:09:11 +0800 | [diff] [blame] | 86 | break; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 87 | case VK_DBG_OBJECT_GPU_MEMORY: |
| 88 | assert(info.header->struct_type == VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO); |
Chia-I Wu | 1f8fc7c | 2014-08-07 11:09:11 +0800 | [diff] [blame] | 89 | break; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 90 | case VK_DBG_OBJECT_EVENT: |
| 91 | assert(info.header->struct_type == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO); |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 92 | shallow_copy = sizeof(VkEventCreateInfo); |
Chia-I Wu | 1f8fc7c | 2014-08-07 11:09:11 +0800 | [diff] [blame] | 93 | break; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 94 | case VK_DBG_OBJECT_FENCE: |
| 95 | assert(info.header->struct_type == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO); |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 96 | shallow_copy = sizeof(VkFenceCreateInfo); |
Chia-I Wu | 1f8fc7c | 2014-08-07 11:09:11 +0800 | [diff] [blame] | 97 | break; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 98 | case VK_DBG_OBJECT_QUERY_POOL: |
| 99 | assert(info.header->struct_type == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO); |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 100 | shallow_copy = sizeof(VkQueryPoolCreateInfo); |
Courtney Goeltzenleuchter | 850d12c | 2014-08-07 18:13:10 -0600 | [diff] [blame] | 101 | break; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 102 | case VK_DBG_OBJECT_BUFFER: |
| 103 | assert(info.header->struct_type == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO); |
Courtney Goeltzenleuchter | ddcb619 | 2015-04-14 18:48:46 -0600 | [diff] [blame] | 104 | shallow_copy = sizeof(VkBufferCreateInfo); |
Chia-I Wu | 714df45 | 2015-01-01 07:55:04 +0800 | [diff] [blame] | 105 | break; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 106 | case VK_DBG_OBJECT_BUFFER_VIEW: |
| 107 | assert(info.header->struct_type == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO); |
Courtney Goeltzenleuchter | ddcb619 | 2015-04-14 18:48:46 -0600 | [diff] [blame] | 108 | shallow_copy = sizeof(VkBufferViewCreateInfo); |
Chia-I Wu | 714df45 | 2015-01-01 07:55:04 +0800 | [diff] [blame] | 109 | break; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 110 | case VK_DBG_OBJECT_IMAGE: |
| 111 | assert(info.header->struct_type == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO); |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 112 | shallow_copy = sizeof(VkImageCreateInfo); |
Chia-I Wu | feb441f | 2014-08-08 21:27:38 +0800 | [diff] [blame] | 113 | break; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 114 | case VK_DBG_OBJECT_IMAGE_VIEW: |
| 115 | assert(info.header->struct_type == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO); |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 116 | shallow_copy = sizeof(VkImageViewCreateInfo); |
Chia-I Wu | 5a32326 | 2014-08-11 10:31:53 +0800 | [diff] [blame] | 117 | break; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 118 | case VK_DBG_OBJECT_COLOR_TARGET_VIEW: |
| 119 | assert(info.header->struct_type == VK_STRUCTURE_TYPE_COLOR_ATTACHMENT_VIEW_CREATE_INFO); |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 120 | shallow_copy = sizeof(VkColorAttachmentViewCreateInfo); |
Chia-I Wu | 5a32326 | 2014-08-11 10:31:53 +0800 | [diff] [blame] | 121 | break; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 122 | case VK_DBG_OBJECT_DEPTH_STENCIL_VIEW: |
| 123 | assert(info.header->struct_type == VK_STRUCTURE_TYPE_DEPTH_STENCIL_VIEW_CREATE_INFO); |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 124 | shallow_copy = sizeof(VkDepthStencilViewCreateInfo); |
Chia-I Wu | 5a32326 | 2014-08-11 10:31:53 +0800 | [diff] [blame] | 125 | break; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 126 | case VK_DBG_OBJECT_SAMPLER: |
| 127 | assert(info.header->struct_type == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO); |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 128 | shallow_copy = sizeof(VkSamplerCreateInfo); |
Chia-I Wu | 28b8996 | 2014-08-18 14:40:49 +0800 | [diff] [blame] | 129 | break; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 130 | case VK_DBG_OBJECT_DESCRIPTOR_SET: |
Chia-I Wu | f838506 | 2015-01-04 16:27:24 +0800 | [diff] [blame] | 131 | /* no create info */ |
Chia-I Wu | b8d04c8 | 2014-08-18 15:51:10 +0800 | [diff] [blame] | 132 | break; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 133 | case VK_DBG_OBJECT_VIEWPORT_STATE: |
| 134 | assert(info.header->struct_type == VK_STRUCTURE_TYPE_DYNAMIC_VP_STATE_CREATE_INFO); |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 135 | shallow_copy = sizeof(VkDynamicVpStateCreateInfo); |
Chia-I Wu | a5714e8 | 2014-08-11 15:33:42 +0800 | [diff] [blame] | 136 | break; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 137 | case VK_DBG_OBJECT_RASTER_STATE: |
| 138 | assert(info.header->struct_type == VK_STRUCTURE_TYPE_DYNAMIC_RS_STATE_CREATE_INFO); |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 139 | shallow_copy = sizeof(VkDynamicRsStateCreateInfo); |
Chia-I Wu | a5714e8 | 2014-08-11 15:33:42 +0800 | [diff] [blame] | 140 | break; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 141 | case VK_DBG_OBJECT_COLOR_BLEND_STATE: |
| 142 | assert(info.header->struct_type == VK_STRUCTURE_TYPE_DYNAMIC_CB_STATE_CREATE_INFO); |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 143 | shallow_copy = sizeof(VkDynamicCbStateCreateInfo); |
Chia-I Wu | a5714e8 | 2014-08-11 15:33:42 +0800 | [diff] [blame] | 144 | break; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 145 | case VK_DBG_OBJECT_DEPTH_STENCIL_STATE: |
| 146 | assert(info.header->struct_type == VK_STRUCTURE_TYPE_DYNAMIC_DS_STATE_CREATE_INFO); |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 147 | shallow_copy = sizeof(VkDynamicDsStateCreateInfo); |
Chia-I Wu | a5714e8 | 2014-08-11 15:33:42 +0800 | [diff] [blame] | 148 | break; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 149 | case VK_DBG_OBJECT_CMD_BUFFER: |
| 150 | assert(info.header->struct_type == VK_STRUCTURE_TYPE_CMD_BUFFER_CREATE_INFO); |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 151 | shallow_copy = sizeof(VkCmdBufferCreateInfo); |
Chia-I Wu | 730e536 | 2014-08-19 12:15:09 +0800 | [diff] [blame] | 152 | break; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 153 | case VK_DBG_OBJECT_GRAPHICS_PIPELINE: |
| 154 | assert(info.header->struct_type == VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO); |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 155 | break; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 156 | case VK_DBG_OBJECT_SHADER: |
| 157 | assert(info.header->struct_type == VK_STRUCTURE_TYPE_SHADER_CREATE_INFO); |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 158 | shallow_copy = sizeof(VkShaderCreateInfo); |
Courtney Goeltzenleuchter | 52ec336 | 2014-08-19 11:52:02 -0600 | [diff] [blame] | 159 | break; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 160 | case VK_DBG_OBJECT_FRAMEBUFFER: |
| 161 | assert(info.header->struct_type == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO); |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 162 | shallow_copy = sizeof(VkFramebufferCreateInfo); |
Jon Ashburn | c6f4a41 | 2014-12-24 12:38:36 -0700 | [diff] [blame] | 163 | break; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 164 | case VK_DBG_OBJECT_RENDER_PASS: |
| 165 | assert(info.header->struct_type == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO); |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 166 | shallow_copy = sizeof(VkRenderPassCreateInfo); |
Jon Ashburn | c6f4a41 | 2014-12-24 12:38:36 -0700 | [diff] [blame] | 167 | break; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 168 | case VK_DBG_OBJECT_DESCRIPTOR_SET_LAYOUT: |
| 169 | assert(info.header->struct_type == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO); |
Chia-I Wu | f838506 | 2015-01-04 16:27:24 +0800 | [diff] [blame] | 170 | /* TODO */ |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 171 | shallow_copy = sizeof(VkDescriptorSetLayoutCreateInfo) * 0; |
Chia-I Wu | f838506 | 2015-01-04 16:27:24 +0800 | [diff] [blame] | 172 | break; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 173 | case VK_DBG_OBJECT_DESCRIPTOR_POOL: |
| 174 | assert(info.header->struct_type == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO); |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 175 | shallow_copy = sizeof(VkDescriptorPoolCreateInfo); |
Chia-I Wu | f838506 | 2015-01-04 16:27:24 +0800 | [diff] [blame] | 176 | break; |
Chia-I Wu | 1f8fc7c | 2014-08-07 11:09:11 +0800 | [diff] [blame] | 177 | default: |
Chia-I Wu | 545c2e1 | 2015-02-22 13:19:54 +0800 | [diff] [blame] | 178 | assert(!"unknown dbg object type"); |
Chia-I Wu | 1f8fc7c | 2014-08-07 11:09:11 +0800 | [diff] [blame] | 179 | return false; |
| 180 | break; |
| 181 | } |
| 182 | |
| 183 | if (shallow_copy) { |
Chia-I Wu | f13ed3c | 2015-02-22 14:09:00 +0800 | [diff] [blame] | 184 | dbg->create_info = intel_alloc(handle, shallow_copy, 0, |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 185 | VK_SYSTEM_ALLOC_TYPE_DEBUG); |
Chia-I Wu | 1f8fc7c | 2014-08-07 11:09:11 +0800 | [diff] [blame] | 186 | if (!dbg->create_info) |
| 187 | return false; |
| 188 | |
| 189 | memcpy(dbg->create_info, create_info, shallow_copy); |
Chia-I Wu | e2934f9 | 2014-08-16 13:17:22 +0800 | [diff] [blame] | 190 | dbg->create_info_size = shallow_copy; |
Chia-I Wu | 1f8fc7c | 2014-08-07 11:09:11 +0800 | [diff] [blame] | 191 | } else if (info.header->struct_type == |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 192 | VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO) { |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 193 | size_t size; |
Mark Lobodzinski | 97dcd04 | 2015-04-16 08:52:00 -0500 | [diff] [blame] | 194 | const VkMemoryAllocInfo *src = info.ptr; |
Courtney Goeltzenleuchter | ddcb619 | 2015-04-14 18:48:46 -0600 | [diff] [blame] | 195 | VkMemoryAllocInfo *dst; |
Jon Ashburn | c6ae13d | 2015-01-19 15:00:26 -0700 | [diff] [blame] | 196 | uint8_t *d; |
| 197 | size = sizeof(*src); |
| 198 | |
Jon Ashburn | c6ae13d | 2015-01-19 15:00:26 -0700 | [diff] [blame] | 199 | dbg->create_info_size = size; |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 200 | dst = intel_alloc(handle, size, 0, VK_SYSTEM_ALLOC_TYPE_DEBUG); |
Jon Ashburn | c6ae13d | 2015-01-19 15:00:26 -0700 | [diff] [blame] | 201 | if (!dst) |
| 202 | return false; |
| 203 | memcpy(dst, src, sizeof(*src)); |
| 204 | |
Jon Ashburn | c6ae13d | 2015-01-19 15:00:26 -0700 | [diff] [blame] | 205 | d = (uint8_t *) dst; |
| 206 | d += sizeof(*src); |
Mark Lobodzinski | 97dcd04 | 2015-04-16 08:52:00 -0500 | [diff] [blame] | 207 | |
Jon Ashburn | c6ae13d | 2015-01-19 15:00:26 -0700 | [diff] [blame] | 208 | dbg->create_info = dst; |
| 209 | } else if (info.header->struct_type == |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 210 | VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO) { |
Courtney Goeltzenleuchter | ddcb619 | 2015-04-14 18:48:46 -0600 | [diff] [blame] | 211 | const VkDeviceCreateInfo *src = info.ptr; |
| 212 | VkDeviceCreateInfo *dst; |
Chia-I Wu | 1f8fc7c | 2014-08-07 11:09:11 +0800 | [diff] [blame] | 213 | uint8_t *d; |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 214 | size_t size; |
| 215 | uint32_t i; |
Chia-I Wu | 1f8fc7c | 2014-08-07 11:09:11 +0800 | [diff] [blame] | 216 | |
| 217 | size = sizeof(*src); |
Chia-I Wu | e2934f9 | 2014-08-16 13:17:22 +0800 | [diff] [blame] | 218 | dbg->create_info_size = size; |
| 219 | |
Chia-I Wu | 1f8fc7c | 2014-08-07 11:09:11 +0800 | [diff] [blame] | 220 | size += sizeof(src->pRequestedQueues[0]) * src->queueRecordCount; |
| 221 | size += sizeof(src->ppEnabledExtensionNames[0]) * src->extensionCount; |
| 222 | for (i = 0; i < src->extensionCount; i++) { |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 223 | size += 1 + strlen(src->ppEnabledExtensionNames[i]); |
Chia-I Wu | 1f8fc7c | 2014-08-07 11:09:11 +0800 | [diff] [blame] | 224 | } |
| 225 | |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 226 | dst = intel_alloc(handle, size, 0, VK_SYSTEM_ALLOC_TYPE_DEBUG); |
Chia-I Wu | 1f8fc7c | 2014-08-07 11:09:11 +0800 | [diff] [blame] | 227 | if (!dst) |
| 228 | return false; |
| 229 | |
| 230 | memcpy(dst, src, sizeof(*src)); |
| 231 | |
| 232 | d = (uint8_t *) dst; |
| 233 | d += sizeof(*src); |
| 234 | |
| 235 | size = sizeof(src->pRequestedQueues[0]) * src->queueRecordCount; |
| 236 | memcpy(d, src->pRequestedQueues, size); |
Courtney Goeltzenleuchter | ddcb619 | 2015-04-14 18:48:46 -0600 | [diff] [blame] | 237 | dst->pRequestedQueues = (const VkDeviceQueueCreateInfo *) d; |
Chia-I Wu | 1f8fc7c | 2014-08-07 11:09:11 +0800 | [diff] [blame] | 238 | d += size; |
| 239 | |
| 240 | size = sizeof(src->ppEnabledExtensionNames[0]) * src->extensionCount; |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 241 | dst->ppEnabledExtensionNames = (const char * const *) d; |
Chia-I Wu | 1f8fc7c | 2014-08-07 11:09:11 +0800 | [diff] [blame] | 242 | |
| 243 | for (i = 0; i < src->extensionCount; i++) { |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 244 | const size_t len = strlen(src->ppEnabledExtensionNames[i]); |
Chia-I Wu | 1f8fc7c | 2014-08-07 11:09:11 +0800 | [diff] [blame] | 245 | |
| 246 | memcpy(d + size, src->ppEnabledExtensionNames[i], len + 1); |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 247 | ((const char **) d)[i] = (const char *) (d + size); |
Chia-I Wu | 1f8fc7c | 2014-08-07 11:09:11 +0800 | [diff] [blame] | 248 | |
| 249 | size += len + 1; |
| 250 | } |
Courtney Goeltzenleuchter | 191b06c | 2014-10-17 16:21:35 -0600 | [diff] [blame] | 251 | dbg->create_info = dst; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 252 | } else if (info.header->struct_type == VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO) { |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 253 | // TODO: What do we want to copy here? |
Chia-I Wu | 1f8fc7c | 2014-08-07 11:09:11 +0800 | [diff] [blame] | 254 | } |
| 255 | |
| 256 | return true; |
| 257 | } |
| 258 | |
Chia-I Wu | 82f50aa | 2014-08-05 10:43:03 +0800 | [diff] [blame] | 259 | /** |
Chia-I Wu | bbf2c93 | 2014-08-07 12:20:08 +0800 | [diff] [blame] | 260 | * Create an intel_base_dbg. When dbg_size is non-zero, a buffer of that |
Chia-I Wu | 660caf8 | 2014-08-07 10:54:26 +0800 | [diff] [blame] | 261 | * size is allocated and zeroed. |
Chia-I Wu | 82f50aa | 2014-08-05 10:43:03 +0800 | [diff] [blame] | 262 | */ |
Chia-I Wu | 545c2e1 | 2015-02-22 13:19:54 +0800 | [diff] [blame] | 263 | struct intel_base_dbg *intel_base_dbg_create(const struct intel_handle *handle, |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 264 | VK_DBG_OBJECT_TYPE type, |
Chia-I Wu | 660caf8 | 2014-08-07 10:54:26 +0800 | [diff] [blame] | 265 | const void *create_info, |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 266 | size_t dbg_size) |
Chia-I Wu | 82f50aa | 2014-08-05 10:43:03 +0800 | [diff] [blame] | 267 | { |
Chia-I Wu | 660caf8 | 2014-08-07 10:54:26 +0800 | [diff] [blame] | 268 | struct intel_base_dbg *dbg; |
| 269 | |
Chia-I Wu | bbf2c93 | 2014-08-07 12:20:08 +0800 | [diff] [blame] | 270 | if (!dbg_size) |
| 271 | dbg_size = sizeof(*dbg); |
Chia-I Wu | 660caf8 | 2014-08-07 10:54:26 +0800 | [diff] [blame] | 272 | |
Chia-I Wu | bbf2c93 | 2014-08-07 12:20:08 +0800 | [diff] [blame] | 273 | assert(dbg_size >= sizeof(*dbg)); |
Chia-I Wu | 660caf8 | 2014-08-07 10:54:26 +0800 | [diff] [blame] | 274 | |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 275 | dbg = intel_alloc(handle, dbg_size, 0, VK_SYSTEM_ALLOC_TYPE_DEBUG); |
Chia-I Wu | 660caf8 | 2014-08-07 10:54:26 +0800 | [diff] [blame] | 276 | if (!dbg) |
| 277 | return NULL; |
| 278 | |
Chia-I Wu | bbf2c93 | 2014-08-07 12:20:08 +0800 | [diff] [blame] | 279 | memset(dbg, 0, dbg_size); |
Chia-I Wu | 660caf8 | 2014-08-07 10:54:26 +0800 | [diff] [blame] | 280 | |
Chia-I Wu | 82f50aa | 2014-08-05 10:43:03 +0800 | [diff] [blame] | 281 | dbg->type = type; |
| 282 | |
Chia-I Wu | f13ed3c | 2015-02-22 14:09:00 +0800 | [diff] [blame] | 283 | if (!base_dbg_copy_create_info(handle, dbg, create_info)) { |
Chia-I Wu | f9c81ef | 2015-02-22 13:49:15 +0800 | [diff] [blame] | 284 | intel_free(handle, dbg); |
Chia-I Wu | 1f8fc7c | 2014-08-07 11:09:11 +0800 | [diff] [blame] | 285 | return NULL; |
Chia-I Wu | 82f50aa | 2014-08-05 10:43:03 +0800 | [diff] [blame] | 286 | } |
| 287 | |
Chia-I Wu | 82f50aa | 2014-08-05 10:43:03 +0800 | [diff] [blame] | 288 | return dbg; |
| 289 | } |
| 290 | |
Chia-I Wu | f13ed3c | 2015-02-22 14:09:00 +0800 | [diff] [blame] | 291 | void intel_base_dbg_destroy(const struct intel_handle *handle, |
| 292 | struct intel_base_dbg *dbg) |
Chia-I Wu | 82f50aa | 2014-08-05 10:43:03 +0800 | [diff] [blame] | 293 | { |
Chia-I Wu | 660caf8 | 2014-08-07 10:54:26 +0800 | [diff] [blame] | 294 | if (dbg->tag) |
Chia-I Wu | f13ed3c | 2015-02-22 14:09:00 +0800 | [diff] [blame] | 295 | intel_free(handle, dbg->tag); |
Chia-I Wu | 660caf8 | 2014-08-07 10:54:26 +0800 | [diff] [blame] | 296 | |
| 297 | if (dbg->create_info) |
Chia-I Wu | f13ed3c | 2015-02-22 14:09:00 +0800 | [diff] [blame] | 298 | intel_free(handle, dbg->create_info); |
Chia-I Wu | 660caf8 | 2014-08-07 10:54:26 +0800 | [diff] [blame] | 299 | |
Chia-I Wu | f13ed3c | 2015-02-22 14:09:00 +0800 | [diff] [blame] | 300 | intel_free(handle, dbg); |
Chia-I Wu | 82f50aa | 2014-08-05 10:43:03 +0800 | [diff] [blame] | 301 | } |
Chia-I Wu | 53fc6aa | 2014-08-06 14:22:51 +0800 | [diff] [blame] | 302 | |
Chia-I Wu | bbf2c93 | 2014-08-07 12:20:08 +0800 | [diff] [blame] | 303 | /** |
| 304 | * Create an intel_base. obj_size and dbg_size specify the real sizes of the |
| 305 | * object and the debug metadata. Memories are zeroed. |
| 306 | */ |
Chia-I Wu | 545c2e1 | 2015-02-22 13:19:54 +0800 | [diff] [blame] | 307 | struct intel_base *intel_base_create(const struct intel_handle *handle, |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 308 | size_t obj_size, bool debug, |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 309 | VK_DBG_OBJECT_TYPE type, |
Chia-I Wu | bbf2c93 | 2014-08-07 12:20:08 +0800 | [diff] [blame] | 310 | const void *create_info, |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 311 | size_t dbg_size) |
Chia-I Wu | bbf2c93 | 2014-08-07 12:20:08 +0800 | [diff] [blame] | 312 | { |
| 313 | struct intel_base *base; |
| 314 | |
| 315 | if (!obj_size) |
| 316 | obj_size = sizeof(*base); |
| 317 | |
| 318 | assert(obj_size >= sizeof(*base)); |
| 319 | |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 320 | base = intel_alloc(handle, obj_size, 0, VK_SYSTEM_ALLOC_TYPE_API_OBJECT); |
Chia-I Wu | bbf2c93 | 2014-08-07 12:20:08 +0800 | [diff] [blame] | 321 | if (!base) |
| 322 | return NULL; |
| 323 | |
Chia-I Wu | 778a80c | 2015-01-03 22:45:10 +0800 | [diff] [blame] | 324 | memset(base, 0, obj_size); |
Chia-I Wu | 032a2e3 | 2015-01-19 11:14:00 +0800 | [diff] [blame] | 325 | intel_handle_init(&base->handle, type, handle->icd); |
Chia-I Wu | 778a80c | 2015-01-03 22:45:10 +0800 | [diff] [blame] | 326 | |
Chia-I Wu | bbf2c93 | 2014-08-07 12:20:08 +0800 | [diff] [blame] | 327 | if (debug) { |
Chia-I Wu | f13ed3c | 2015-02-22 14:09:00 +0800 | [diff] [blame] | 328 | base->dbg = intel_base_dbg_create(&base->handle, |
Chia-I Wu | 545c2e1 | 2015-02-22 13:19:54 +0800 | [diff] [blame] | 329 | type, create_info, dbg_size); |
Chia-I Wu | bbf2c93 | 2014-08-07 12:20:08 +0800 | [diff] [blame] | 330 | if (!base->dbg) { |
Chia-I Wu | f9c81ef | 2015-02-22 13:49:15 +0800 | [diff] [blame] | 331 | intel_free(handle, base); |
Chia-I Wu | bbf2c93 | 2014-08-07 12:20:08 +0800 | [diff] [blame] | 332 | return NULL; |
| 333 | } |
| 334 | } |
Chia-I Wu | 6a42c2a | 2014-08-19 14:36:47 +0800 | [diff] [blame] | 335 | |
Chia-I Wu | bbf2c93 | 2014-08-07 12:20:08 +0800 | [diff] [blame] | 336 | base->get_info = intel_base_get_info; |
| 337 | |
| 338 | return base; |
| 339 | } |
| 340 | |
| 341 | void intel_base_destroy(struct intel_base *base) |
| 342 | { |
| 343 | if (base->dbg) |
Chia-I Wu | f13ed3c | 2015-02-22 14:09:00 +0800 | [diff] [blame] | 344 | intel_base_dbg_destroy(&base->handle, base->dbg); |
Chia-I Wu | f9c81ef | 2015-02-22 13:49:15 +0800 | [diff] [blame] | 345 | intel_free(base, base); |
Chia-I Wu | bbf2c93 | 2014-08-07 12:20:08 +0800 | [diff] [blame] | 346 | } |
| 347 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 348 | ICD_EXPORT VkResult VKAPI vkDestroyObject( |
Mike Stroyan | 230e625 | 2015-04-17 12:36:38 -0600 | [diff] [blame] | 349 | VkDevice device, |
| 350 | VkObjectType objType, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 351 | VkObject object) |
Chia-I Wu | 53fc6aa | 2014-08-06 14:22:51 +0800 | [diff] [blame] | 352 | { |
| 353 | struct intel_obj *obj = intel_obj(object); |
| 354 | |
| 355 | obj->destroy(obj); |
| 356 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 357 | return VK_SUCCESS; |
Chia-I Wu | 53fc6aa | 2014-08-06 14:22:51 +0800 | [diff] [blame] | 358 | } |
| 359 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 360 | ICD_EXPORT VkResult VKAPI vkGetObjectInfo( |
Mike Stroyan | 230e625 | 2015-04-17 12:36:38 -0600 | [diff] [blame] | 361 | VkDevice device, |
| 362 | VkObjectType objType, |
| 363 | VkObject object, |
| 364 | VkObjectInfoType infoType, |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 365 | size_t* pDataSize, |
| 366 | void* pData) |
Chia-I Wu | 53fc6aa | 2014-08-06 14:22:51 +0800 | [diff] [blame] | 367 | { |
| 368 | struct intel_base *base = intel_base(object); |
Chia-I Wu | 53fc6aa | 2014-08-06 14:22:51 +0800 | [diff] [blame] | 369 | |
Chia-I Wu | 26f0bd0 | 2014-08-07 10:38:40 +0800 | [diff] [blame] | 370 | return base->get_info(base, infoType, pDataSize, pData); |
Chia-I Wu | 53fc6aa | 2014-08-06 14:22:51 +0800 | [diff] [blame] | 371 | } |
| 372 | |
Mark Lobodzinski | fb9f564 | 2015-05-11 17:21:15 -0500 | [diff] [blame^] | 373 | ICD_EXPORT VkResult VKAPI vkBindObjectMemory( |
| 374 | VkDevice device, |
Mike Stroyan | 230e625 | 2015-04-17 12:36:38 -0600 | [diff] [blame] | 375 | VkObjectType objType, |
| 376 | VkObject object, |
| 377 | uint32_t allocationIdx, |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 378 | VkDeviceMemory mem_, |
| 379 | VkDeviceSize memOffset) |
Chia-I Wu | 53fc6aa | 2014-08-06 14:22:51 +0800 | [diff] [blame] | 380 | { |
| 381 | struct intel_obj *obj = intel_obj(object); |
Chia-I Wu | 9e61c0d | 2014-09-15 15:12:06 +0800 | [diff] [blame] | 382 | struct intel_mem *mem = intel_mem(mem_); |
Chia-I Wu | 53fc6aa | 2014-08-06 14:22:51 +0800 | [diff] [blame] | 383 | |
Chia-I Wu | 714df45 | 2015-01-01 07:55:04 +0800 | [diff] [blame] | 384 | intel_obj_bind_mem(obj, mem, memOffset); |
Chia-I Wu | 53fc6aa | 2014-08-06 14:22:51 +0800 | [diff] [blame] | 385 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 386 | return VK_SUCCESS; |
Chia-I Wu | 53fc6aa | 2014-08-06 14:22:51 +0800 | [diff] [blame] | 387 | } |
Chia-I Wu | 7ec9f34 | 2014-08-19 10:47:53 +0800 | [diff] [blame] | 388 | |
Mark Lobodzinski | fb9f564 | 2015-05-11 17:21:15 -0500 | [diff] [blame^] | 389 | ICD_EXPORT VkResult VKAPI vkQueueBindSparseBufferMemory( |
Mike Stroyan | 230e625 | 2015-04-17 12:36:38 -0600 | [diff] [blame] | 390 | VkQueue queue, |
Mark Lobodzinski | fb9f564 | 2015-05-11 17:21:15 -0500 | [diff] [blame^] | 391 | VkBuffer buffer, |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 392 | uint32_t allocationIdx, |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 393 | VkDeviceSize rangeOffset, |
| 394 | VkDeviceSize rangeSize, |
| 395 | VkDeviceMemory mem, |
| 396 | VkDeviceSize memOffset) |
Chia-I Wu | 714df45 | 2015-01-01 07:55:04 +0800 | [diff] [blame] | 397 | { |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 398 | return VK_ERROR_UNKNOWN; |
Chia-I Wu | 714df45 | 2015-01-01 07:55:04 +0800 | [diff] [blame] | 399 | } |
| 400 | |
Mark Lobodzinski | fb9f564 | 2015-05-11 17:21:15 -0500 | [diff] [blame^] | 401 | ICD_EXPORT VkResult VKAPI vkQueueBindSparseImageMemory( |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 402 | VkQueue queue, |
| 403 | VkImage image, |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 404 | uint32_t allocationIdx, |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 405 | const VkImageMemoryBindInfo* pBindInfo, |
| 406 | VkDeviceMemory mem, |
| 407 | VkDeviceSize memOffset) |
Chia-I Wu | 714df45 | 2015-01-01 07:55:04 +0800 | [diff] [blame] | 408 | { |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 409 | return VK_ERROR_UNKNOWN; |
Chia-I Wu | 714df45 | 2015-01-01 07:55:04 +0800 | [diff] [blame] | 410 | } |
| 411 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 412 | ICD_EXPORT VkResult VKAPI vkDbgSetObjectTag( |
Mike Stroyan | 230e625 | 2015-04-17 12:36:38 -0600 | [diff] [blame] | 413 | VkDevice device, |
| 414 | VkObject object, |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 415 | size_t tagSize, |
| 416 | const void* pTag) |
Chia-I Wu | 7ec9f34 | 2014-08-19 10:47:53 +0800 | [diff] [blame] | 417 | { |
| 418 | struct intel_base *base = intel_base(object); |
| 419 | struct intel_base_dbg *dbg = base->dbg; |
| 420 | void *tag; |
| 421 | |
| 422 | if (!dbg) |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 423 | return VK_SUCCESS; |
Chia-I Wu | 7ec9f34 | 2014-08-19 10:47:53 +0800 | [diff] [blame] | 424 | |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 425 | tag = intel_alloc(base, tagSize, 0, VK_SYSTEM_ALLOC_TYPE_DEBUG); |
Chia-I Wu | 7ec9f34 | 2014-08-19 10:47:53 +0800 | [diff] [blame] | 426 | if (!tag) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 427 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
Chia-I Wu | 7ec9f34 | 2014-08-19 10:47:53 +0800 | [diff] [blame] | 428 | |
| 429 | memcpy(tag, pTag, tagSize); |
| 430 | |
| 431 | if (dbg->tag) |
Chia-I Wu | f9c81ef | 2015-02-22 13:49:15 +0800 | [diff] [blame] | 432 | intel_free(base, dbg->tag); |
Chia-I Wu | 7ec9f34 | 2014-08-19 10:47:53 +0800 | [diff] [blame] | 433 | |
| 434 | dbg->tag = tag; |
| 435 | dbg->tag_size = tagSize; |
| 436 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 437 | return VK_SUCCESS; |
Chia-I Wu | 7ec9f34 | 2014-08-19 10:47:53 +0800 | [diff] [blame] | 438 | } |