diff --git a/gapis/api/vulkan/api/bitfields.api b/gapis/api/vulkan/api/bitfields.api index 39ecf1c1e4..c215938d13 100644 --- a/gapis/api/vulkan/api/bitfields.api +++ b/gapis/api/vulkan/api/bitfields.api @@ -41,6 +41,7 @@ type VkFlags VkInstanceCreateFlags /// Format capability flags @unused +@analyze_usage bitfield VkFormatFeatureFlagBits { VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, /// Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types) VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, /// Format can be used for storage images (STORAGE_IMAGE descriptor type) @@ -56,9 +57,11 @@ bitfield VkFormatFeatureFlagBits { VK_FORMAT_FEATURE_BLIT_DST_BIT = 0x00000800, /// Format can be used as the destination image of blits with vkCommandBlitImage VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000, VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000, + VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR = 0x00004000, + VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR = 0x00008000, // Vulkan 1.1 core - VK_FORMAT_FEATURE_TRANSFER_SRC_BIT = 0x00004000, - VK_FORMAT_FEATURE_TRANSFER_DST_BIT = 0x00008000, + VK_FORMAT_FEATURE_TRANSFER_SRC_BIT = 0x00004000, // VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR + VK_FORMAT_FEATURE_TRANSFER_DST_BIT = 0x00008000, // VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT = 0x00020000, VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT = 0x00040000, VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT = 0x00080000, @@ -510,7 +513,7 @@ type VkFlags VkExternalSemaphoreHandleTypeFlags @unused @analyze_usage bitfield VkFenceImportFlagBits { - VK_FENCE_IMPORT_TEMPORARY_BIT = 0x00000001, + VK_FENCE_IMPORT_TEMPORARY_BIT = 0x000000001, VK_FENCE_IMPORT_TEMPORARY_BIT_KHR = 0x000000001, // VK_FENCE_IMPORT_TEMPORARY_BIT, } type VkFlags VkFenceImportFlags diff --git a/gapis/api/vulkan/api/command_buffer_control.api b/gapis/api/vulkan/api/command_buffer_control.api index 6a59738714..9b9c7e73a3 100644 --- a/gapis/api/vulkan/api/command_buffer_control.api +++ b/gapis/api/vulkan/api/command_buffer_control.api @@ -423,3 +423,27 @@ cmd void vkCmdExecuteCommands( AddCommand(commandBuffer, cmd_vkCmdExecuteCommands, mapPos) } + +// ---------------------------------------------------------------------------- +// Vulkan 1.1 Commands +// ---------------------------------------------------------------------------- + +////////////////// +// Command pool // +////////////////// + +sub void TrimCommandPool( + VkDevice device, + VkCommandPool commandPool, + VkCommandPoolTrimFlags flags) { + if !(device in Devices) { vkErrorInvalidDevice(device) } + if !(commandPool in CommandPools) { vkErrorInvalidCommandPool(commandPool) } +} + +@indirect("VkDevice") +cmd void vkTrimCommandPool( + VkDevice device, + VkCommandPool commandPool, + VkCommandPoolTrimFlags flags) { + TrimCommandPool(device, commandPool, flags) +} diff --git a/gapis/api/vulkan/api/copy_clear_commands.api b/gapis/api/vulkan/api/copy_clear_commands.api index 94e99b780a..07e4f245ac 100644 --- a/gapis/api/vulkan/api/copy_clear_commands.api +++ b/gapis/api/vulkan/api/copy_clear_commands.api @@ -228,7 +228,8 @@ sub void dovkCmdCopyImage(ref!vkCmdCopyImageArgs args) { dstElementAndTexelBlockSize := getElementAndTexelBlockSize(dstFormat) dstDepthElementSize := getDepthElementSize(dstFormat, false) for r in (0 .. len(args.Regions)) { - // TODO: (qining) Handle the apsect mask + // TODO: Support KHR_maintenance1 extension, support copying from a 2D array + // image to slices of a 3D image and vice versa. region := args.Regions[as!u32(r)] srcBaseLayer := region.srcSubresource.baseArrayLayer dstBaseLayer := region.srcSubresource.baseArrayLayer diff --git a/gapis/api/vulkan/extensions/khr_maintenance1.api b/gapis/api/vulkan/extensions/khr_maintenance1.api new file mode 100644 index 0000000000..d7abaa98cf --- /dev/null +++ b/gapis/api/vulkan/extensions/khr_maintenance1.api @@ -0,0 +1,57 @@ +// Copyright (C) 2018 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Based off of the original vulkan.h header file which has the following +// license. + +// Copyright (c) 2015 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and/or associated documentation files (the +// "Materials"), to deal in the Materials without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Materials, and to +// permit persons to whom the Materials are furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Materials. +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + + +/////////////// +// Bitfields // +/////////////// + +// Updated in api/bitfields.api + +////////////// +// Commands // +////////////// + +@extension("VK_KHR_maintenance1") +@indirect("VkDevice") +cmd void vkTrimCommandPoolKHR( + VkDevice device, + VkCommandPool commandPool, + VkCommandPoolTrimFlags flags) { + TrimCommandPool(device, commandPool, flags) +} diff --git a/gapis/api/vulkan/footprint_builder.go b/gapis/api/vulkan/footprint_builder.go index ea9bdc2c1d..d12e75c0ad 100644 --- a/gapis/api/vulkan/footprint_builder.go +++ b/gapis/api/vulkan/footprint_builder.go @@ -2800,6 +2800,8 @@ func (vb *FootprintBuilder) BuildFootprint(ctx context.Context, // TODO: ResetCommandPool should overwrite all the command buffers in this // pool. *VkResetCommandPool, + *VkTrimCommandPool, + *VkTrimCommandPoolKHR, *VkDestroyCommandPool: bh.Alive = true case *VkGetPhysicalDeviceXlibPresentationSupportKHR, diff --git a/gapis/api/vulkan/vulkan.api b/gapis/api/vulkan/vulkan.api index a87003fcb7..f7a580064b 100644 --- a/gapis/api/vulkan/vulkan.api +++ b/gapis/api/vulkan/vulkan.api @@ -73,6 +73,7 @@ import "extensions/khr_display_swapchain.api" import "extensions/khr_get_memory_requirements2.api" import "extensions/khr_get_physical_device_properties2.api" import "extensions/khr_get_surface_capabilities2.api" +import "extensions/khr_maintenance1.api" import "extensions/khr_surface.api" import "extensions/khr_swapchain.api" import "extensions/nv_dedicated_allocation.api"