diff options
author | BogDan Vatra <[email protected]> | 2016-01-05 21:44:16 +0200 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-01-14 07:30:46 -0800 |
commit | 102c74277f989703dfb3783c5c0b93e3731012bf (patch) | |
tree | c6ae01ac9788a4af5d2112e8e85e7e0e3815e135 /src | |
parent | 8ce2b0e1405b3d6d3590dcd3ce1ac2d04d228ad4 (diff) |
WIP: Partially upgrade to vulkan v0.221.0
TODO, make use of:
- VkPhysicalDeviceFeatures.drawIndirectFirstInstance,
- VkPhysicalDeviceFeatures.inheritedQueries
- VkPhysicalDeviceLimits.timestampComputeAndGraphics
- VkSubmitInfo.pWaitDstStageMask
- VkSubresourceLayout.arrayPitch
- VkSamplerCreateInfo.anisotropyEnable
Diffstat (limited to 'src')
-rw-r--r-- | src/vulkan/anv_cmd_buffer.c | 16 | ||||
-rw-r--r-- | src/vulkan/anv_descriptor_set.c | 8 | ||||
-rw-r--r-- | src/vulkan/anv_meta.c | 4 | ||||
-rw-r--r-- | src/vulkan/anv_meta_clear.c | 8 | ||||
-rw-r--r-- | src/vulkan/anv_query.c | 14 | ||||
-rw-r--r-- | src/vulkan/anv_wsi_wayland.c | 13 | ||||
-rw-r--r-- | src/vulkan/anv_wsi_x11.c | 13 | ||||
-rw-r--r-- | src/vulkan/gen8_cmd_buffer.c | 4 |
8 files changed, 42 insertions, 38 deletions
diff --git a/src/vulkan/anv_cmd_buffer.c b/src/vulkan/anv_cmd_buffer.c index bca2deafa7d..ae33822b633 100644 --- a/src/vulkan/anv_cmd_buffer.c +++ b/src/vulkan/anv_cmd_buffer.c @@ -377,13 +377,14 @@ void anv_CmdBindPipeline( void anv_CmdSetViewport( VkCommandBuffer commandBuffer, + uint32_t firstViewport, uint32_t viewportCount, const VkViewport* pViewports) { ANV_FROM_HANDLE(anv_cmd_buffer, cmd_buffer, commandBuffer); cmd_buffer->state.dynamic.viewport.count = viewportCount; - memcpy(cmd_buffer->state.dynamic.viewport.viewports, + memcpy(cmd_buffer->state.dynamic.viewport.viewports + firstViewport, pViewports, viewportCount * sizeof(*pViewports)); cmd_buffer->state.dirty |= ANV_CMD_DIRTY_DYNAMIC_VIEWPORT; @@ -391,13 +392,14 @@ void anv_CmdSetViewport( void anv_CmdSetScissor( VkCommandBuffer commandBuffer, + uint32_t firstScissor, uint32_t scissorCount, const VkRect2D* pScissors) { ANV_FROM_HANDLE(anv_cmd_buffer, cmd_buffer, commandBuffer); cmd_buffer->state.dynamic.scissor.count = scissorCount; - memcpy(cmd_buffer->state.dynamic.scissor.scissors, + memcpy(cmd_buffer->state.dynamic.scissor.scissors + firstScissor, pScissors, scissorCount * sizeof(*pScissors)); cmd_buffer->state.dirty |= ANV_CMD_DIRTY_DYNAMIC_SCISSOR; @@ -558,7 +560,7 @@ void anv_CmdBindDescriptorSets( void anv_CmdBindVertexBuffers( VkCommandBuffer commandBuffer, - uint32_t startBinding, + uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets) @@ -569,11 +571,11 @@ void anv_CmdBindVertexBuffers( /* We have to defer setting up vertex buffer since we need the buffer * stride from the pipeline. */ - assert(startBinding + bindingCount < MAX_VBS); + assert(firstBinding + bindingCount < MAX_VBS); for (uint32_t i = 0; i < bindingCount; i++) { - vb[startBinding + i].buffer = anv_buffer_from_handle(pBuffers[i]); - vb[startBinding + i].offset = pOffsets[i]; - cmd_buffer->state.vb_dirty |= 1 << (startBinding + i); + vb[firstBinding + i].buffer = anv_buffer_from_handle(pBuffers[i]); + vb[firstBinding + i].offset = pOffsets[i]; + cmd_buffer->state.vb_dirty |= 1 << (firstBinding + i); } } diff --git a/src/vulkan/anv_descriptor_set.c b/src/vulkan/anv_descriptor_set.c index 3e11047c673..828e20ae9c9 100644 --- a/src/vulkan/anv_descriptor_set.c +++ b/src/vulkan/anv_descriptor_set.c @@ -47,9 +47,9 @@ VkResult anv_CreateDescriptorSetLayout( uint32_t max_binding = 0; uint32_t immutable_sampler_count = 0; for (uint32_t j = 0; j < pCreateInfo->bindingCount; j++) { - max_binding = MAX2(max_binding, pCreateInfo->pBinding[j].binding); - if (pCreateInfo->pBinding[j].pImmutableSamplers) - immutable_sampler_count += pCreateInfo->pBinding[j].descriptorCount; + max_binding = MAX2(max_binding, pCreateInfo->pBindings[j].binding); + if (pCreateInfo->pBindings[j].pImmutableSamplers) + immutable_sampler_count += pCreateInfo->pBindings[j].descriptorCount; } size_t size = sizeof(struct anv_descriptor_set_layout) + @@ -86,7 +86,7 @@ VkResult anv_CreateDescriptorSetLayout( uint32_t dynamic_offset_count = 0; for (uint32_t j = 0; j < pCreateInfo->bindingCount; j++) { - const VkDescriptorSetLayoutBinding *binding = &pCreateInfo->pBinding[j]; + const VkDescriptorSetLayoutBinding *binding = &pCreateInfo->pBindings[j]; uint32_t b = binding->binding; assert(binding->descriptorCount > 0); diff --git a/src/vulkan/anv_meta.c b/src/vulkan/anv_meta.c index 0c1b43925ed..a92eb7fcc97 100644 --- a/src/vulkan/anv_meta.c +++ b/src/vulkan/anv_meta.c @@ -290,7 +290,7 @@ anv_device_init_meta_blit_state(struct anv_device *device) VkDescriptorSetLayoutCreateInfo ds_layout_info = { .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO, .bindingCount = 1, - .pBinding = (VkDescriptorSetLayoutBinding[]) { + .pBindings = (VkDescriptorSetLayoutBinding[]) { { .binding = 0, .descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, @@ -637,7 +637,7 @@ meta_emit_blit(struct anv_cmd_buffer *cmd_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline); } - anv_CmdSetViewport(anv_cmd_buffer_to_handle(cmd_buffer), 1, + anv_CmdSetViewport(anv_cmd_buffer_to_handle(cmd_buffer), 0, 1, &(VkViewport) { .x = 0.0f, .y = 0.0f, diff --git a/src/vulkan/anv_meta_clear.c b/src/vulkan/anv_meta_clear.c index 1a4300c07e3..003e0e023ca 100644 --- a/src/vulkan/anv_meta_clear.c +++ b/src/vulkan/anv_meta_clear.c @@ -338,7 +338,7 @@ emit_load_color_clear(struct anv_cmd_buffer *cmd_buffer, .depth_stencil_attachment = VK_ATTACHMENT_UNUSED, }); - ANV_CALL(CmdSetViewport)(cmd_buffer_h, 1, + ANV_CALL(CmdSetViewport)(cmd_buffer_h, 0, 1, (VkViewport[]) { { .x = 0, @@ -350,7 +350,7 @@ emit_load_color_clear(struct anv_cmd_buffer *cmd_buffer, }, }); - ANV_CALL(CmdSetScissor)(cmd_buffer_h, 1, + ANV_CALL(CmdSetScissor)(cmd_buffer_h, 0, 1, (VkRect2D[]) { { .offset = { 0, 0 }, @@ -506,7 +506,7 @@ emit_load_depthstencil_clear(struct anv_cmd_buffer *cmd_buffer, .depth_stencil_attachment = attachment, }); - ANV_CALL(CmdSetViewport)(cmd_buffer_h, 1, + ANV_CALL(CmdSetViewport)(cmd_buffer_h, 0, 1, (VkViewport[]) { { .x = 0, @@ -520,7 +520,7 @@ emit_load_depthstencil_clear(struct anv_cmd_buffer *cmd_buffer, }, }); - ANV_CALL(CmdSetScissor)(cmd_buffer_h, 1, + ANV_CALL(CmdSetScissor)(cmd_buffer_h, 0, 1, (VkRect2D[]) { { .offset = { 0, 0 }, diff --git a/src/vulkan/anv_query.c b/src/vulkan/anv_query.c index 1bcac097104..d4c34c7f021 100644 --- a/src/vulkan/anv_query.c +++ b/src/vulkan/anv_query.c @@ -95,7 +95,7 @@ void anv_DestroyQueryPool( VkResult anv_GetQueryPoolResults( VkDevice _device, VkQueryPool queryPool, - uint32_t startQuery, + uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void* pData, @@ -129,14 +129,14 @@ VkResult anv_GetQueryPoolResults( for (uint32_t i = 0; i < queryCount; i++) { switch (pool->type) { case VK_QUERY_TYPE_OCCLUSION: { - result = slot[startQuery + i].end - slot[startQuery + i].begin; + result = slot[firstQuery + i].end - slot[firstQuery + i].begin; break; } case VK_QUERY_TYPE_PIPELINE_STATISTICS: /* Not yet implemented */ break; case VK_QUERY_TYPE_TIMESTAMP: { - result = slot[startQuery + i].begin; + result = slot[firstQuery + i].begin; break; } default: @@ -147,14 +147,14 @@ VkResult anv_GetQueryPoolResults( uint64_t *dst = pData; dst[0] = result; if (flags & VK_QUERY_RESULT_WITH_AVAILABILITY_BIT) - dst[1] = slot[startQuery + i].available; + dst[1] = slot[firstQuery + i].available; } else { uint32_t *dst = pData; if (result > UINT32_MAX) result = UINT32_MAX; dst[0] = result; if (flags & VK_QUERY_RESULT_WITH_AVAILABILITY_BIT) - dst[1] = slot[startQuery + i].available; + dst[1] = slot[firstQuery + i].available; } pData += stride; @@ -168,7 +168,7 @@ VkResult anv_GetQueryPoolResults( void anv_CmdResetQueryPool( VkCommandBuffer commandBuffer, VkQueryPool queryPool, - uint32_t startQuery, + uint32_t firstQuery, uint32_t queryCount) { ANV_FROM_HANDLE(anv_query_pool, pool, queryPool); @@ -178,7 +178,7 @@ void anv_CmdResetQueryPool( case VK_QUERY_TYPE_OCCLUSION: case VK_QUERY_TYPE_TIMESTAMP: { struct anv_query_pool_slot *slot = pool->bo.map; - slot[startQuery + i].available = 0; + slot[firstQuery + i].available = 0; break; } default: diff --git a/src/vulkan/anv_wsi_wayland.c b/src/vulkan/anv_wsi_wayland.c index c9eb51012dc..d708341c98f 100644 --- a/src/vulkan/anv_wsi_wayland.c +++ b/src/vulkan/anv_wsi_wayland.c @@ -351,8 +351,8 @@ wsi_wl_surface_get_capabilities(struct anv_wsi_surface *surface, caps->currentExtent = (VkExtent2D) { -1, -1 }; caps->minImageExtent = (VkExtent2D) { 1, 1 }; caps->maxImageExtent = (VkExtent2D) { INT16_MAX, INT16_MAX }; - caps->supportedTransforms = VK_SURFACE_TRANSFORM_NONE_BIT_KHR; - caps->currentTransform = VK_SURFACE_TRANSFORM_NONE_BIT_KHR; + caps->supportedTransforms = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR; + caps->currentTransform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR; caps->maxImageArrayLayers = 1; caps->supportedCompositeAlpha = @@ -432,11 +432,12 @@ wsi_wl_surface_create_swapchain(struct anv_wsi_surface *surface, VkResult anv_CreateWaylandSurfaceKHR( VkInstance _instance, - struct wl_display* wl_display, - struct wl_surface* wl_surface, + const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) { + assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR); + ANV_FROM_HANDLE(anv_instance, instance, _instance); struct wsi_wl_surface *surface; @@ -445,8 +446,8 @@ VkResult anv_CreateWaylandSurfaceKHR( if (surface == NULL) return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY); - surface->display = wl_display; - surface->surface = wl_surface; + surface->display = pCreateInfo->display; + surface->surface = pCreateInfo->surface; surface->base.instance = instance; surface->base.destroy = wsi_wl_surface_destroy; diff --git a/src/vulkan/anv_wsi_x11.c b/src/vulkan/anv_wsi_x11.c index f340de476ca..8e35191576a 100644 --- a/src/vulkan/anv_wsi_x11.c +++ b/src/vulkan/anv_wsi_x11.c @@ -83,8 +83,8 @@ x11_surface_get_capabilities(struct anv_wsi_surface *wsi_surface, caps->minImageCount = 2; caps->maxImageCount = 4; - caps->supportedTransforms = VK_SURFACE_TRANSFORM_NONE_BIT_KHR; - caps->currentTransform = VK_SURFACE_TRANSFORM_NONE_BIT_KHR; + caps->supportedTransforms = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR; + caps->currentTransform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR; caps->maxImageArrayLayers = 1; caps->supportedCompositeAlpha = VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR; caps->supportedUsageFlags = @@ -146,11 +146,12 @@ x11_surface_create_swapchain(struct anv_wsi_surface *surface, VkResult anv_CreateXcbSurfaceKHR( VkInstance _instance, - xcb_connection_t* connection, - xcb_window_t window, + const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) { + assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR); + ANV_FROM_HANDLE(anv_instance, instance, _instance); struct x11_surface *surface; @@ -159,8 +160,8 @@ VkResult anv_CreateXcbSurfaceKHR( if (surface == NULL) return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY); - surface->connection = connection; - surface->window = window; + surface->connection = pCreateInfo->connection; + surface->window = pCreateInfo->window; surface->base.instance = instance; surface->base.destroy = x11_surface_destroy; diff --git a/src/vulkan/gen8_cmd_buffer.c b/src/vulkan/gen8_cmd_buffer.c index ec86bb2221c..20a9ec75bca 100644 --- a/src/vulkan/gen8_cmd_buffer.c +++ b/src/vulkan/gen8_cmd_buffer.c @@ -1041,7 +1041,7 @@ store_query_result(struct anv_batch *batch, uint32_t reg, void genX(CmdCopyQueryPoolResults)( VkCommandBuffer commandBuffer, VkQueryPool queryPool, - uint32_t startQuery, + uint32_t firstQuery, uint32_t queryCount, VkBuffer destBuffer, VkDeviceSize destOffset, @@ -1061,7 +1061,7 @@ void genX(CmdCopyQueryPoolResults)( dst_offset = buffer->offset + destOffset; for (uint32_t i = 0; i < queryCount; i++) { - slot_offset = (startQuery + i) * sizeof(struct anv_query_pool_slot); + slot_offset = (firstQuery + i) * sizeof(struct anv_query_pool_slot); switch (pool->type) { case VK_QUERY_TYPE_OCCLUSION: emit_load_alu_reg_u64(&cmd_buffer->batch, |