lavapipe: fix some void ptr arithmetic

msvc disagrees with it, and they are trivial to fix.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9120>
This commit is contained in:
Dave Airlie
2021-02-17 17:06:39 -08:00
committed by Marge Bot
parent f3dd9529fa
commit ab42e49ea7
3 changed files with 5 additions and 5 deletions

View File

@@ -1096,7 +1096,7 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_MapMemory(
map = device->pscreen->map_memory(device->pscreen, mem->pmem);
*ppData = map + offset;
*ppData = (char *)map + offset;
return VK_SUCCESS;
}

View File

@@ -174,7 +174,7 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_CreateRenderPass(
VK_OBJECT_TYPE_RENDER_PASS);
pass->attachment_count = pCreateInfo->attachmentCount;
pass->subpass_count = pCreateInfo->subpassCount;
pass->attachments = (void *) pass + attachments_offset;
pass->attachments = (struct lvp_render_pass_attachment *)((char *)pass + attachments_offset);
for (uint32_t i = 0; i < pCreateInfo->attachmentCount; i++) {
struct lvp_render_pass_attachment *att = &pass->attachments[i];

View File

@@ -467,9 +467,9 @@ lvp_shader_compile_to_ir(struct lvp_pipeline *pipeline,
for (uint32_t i = 0; i < num_spec_entries; i++) {
VkSpecializationMapEntry entry = spec_info->pMapEntries[i];
const void *data =
spec_info->pData + entry.offset;
assert((const void *)(data + entry.size) <=
spec_info->pData + spec_info->dataSize);
(char *)spec_info->pData + entry.offset;
assert((const char *)((char *)data + entry.size) <=
(char *)spec_info->pData + spec_info->dataSize);
spec_entries[i].id = entry.constantID;
switch (entry.size) {