Merge remote-tracking branch 'upstream/18.2' into master
Change-Id: Ib3754c06dcf97605e48fc886bba6a5f46b47eb3d
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000..052fea7
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,12 @@
+Language: Cpp
+ColumnLimit: 100
+UseTab: Never
+IndentWidth: 3
+BreakBeforeBraces: WebKit
+AccessModifierOffset: -3
+DerivePointerAlignment: false
+PointerAlignment: Left
+AllowShortFunctionsOnASingleLine: All
+KeepEmptyLinesAtTheStartOfBlocks: true
+AlignEscapedNewlinesLeft: false
+ForEachMacros: ['list_for_every_entry']
diff --git a/.gn b/.gn
new file mode 100644
index 0000000..a37c1d0
--- /dev/null
+++ b/.gn
@@ -0,0 +1,26 @@
+# Copyright 2016 The Fuchsia Authors
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+# This file is used by the gn meta-buildsystem find the root of the source tree
+# and to set startup options.
+
+# The location of the build configuration file.
+buildconfig = "//gnbuild/config/BUILDCONFIG.gn"
diff --git a/BUILD.gn b/BUILD.gn
new file mode 100644
index 0000000..635f722
--- /dev/null
+++ b/BUILD.gn
@@ -0,0 +1,37 @@
+# Copyright 2016 The Fuchsia Authors
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+group("magma_vulkan") {
+ assert(target_cpu == "x64")
+ public_deps = [
+ "include:vulkan",
+ "src/intel/vulkan:vulkan_intel",
+ ]
+}
+
+group("tests") {
+ testonly = true
+
+ public_deps = [
+ "src/intel/vulkan/tests",
+ "tests",
+ ]
+}
diff --git a/CREDITS.fuchsia b/CREDITS.fuchsia
new file mode 100644
index 0000000..86137ad
--- /dev/null
+++ b/CREDITS.fuchsia
@@ -0,0 +1,156 @@
+# License / Copyright Information
+
+The Mesa distribution consists of several components. Different copyrights and
+licenses apply to different components. For example, the GLX client code uses
+the SGI Free Software License B, and some of the Mesa device drivers are
+copyrighted by their authors. See below for a list of Mesa's main components
+and the license for each.
+
+The core Mesa library is licensed according to the terms of the MIT license.
+This allows integration with the XFree86, Xorg and DRI projects.
+
+The default Mesa license is as follows:
+
+Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is 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 Software.
+
+THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+## Mesa Component Licenses
+
+Component Location License
+------------------------------------------------------------------
+Main Mesa code src/mesa/ MIT
+
+Device drivers src/mesa/drivers/* MIT, generally
+
+Gallium code src/gallium/ MIT
+
+Ext headers include/GL/glext.h Khronos
+ include/GL/glxext.h
+
+GLX client code src/glx/ SGI Free Software License B
+
+C11 thread include/c11/threads*.h Boost (permissive)
+emulation
+
+In general, consult the source files for license terms.
+
+********************************************************************************
+
+include/GL/glext.h
+include/GL/glxext.h
+
+Copyright (c) 2013-2017 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.
+
+********************************************************************************
+
+src/glx/clientattrib.c
+src/glx/compsize.c
+src/glx/eval.c
+src/glx/glxclient.h
+src/glx/glxcmds.c
+src/glx/glxcurrent.c
+src/glx/glxext.c
+src/glx/packrender.h
+src/glx/packsingle.h
+src/glx/pixel.c
+src/glx/pixelstore.c
+src/glx/render2.c
+src/glx/renderpix.c
+src/glx/single2.c
+src/glx/singlepix.c
+src/glx/vertarr.c
+
+SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
+Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice including the dates of first publication and
+either this permission notice or a reference to
+http://oss.sgi.com/projects/FreeB/
+shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS 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
+SILICON GRAPHICS, INC. 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+Except as contained in this notice, the name of Silicon Graphics, Inc.
+shall not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization from
+Silicon Graphics, Inc.
+
+********************************************************************************
+
+include/c11/threads.h
+include/c11/threads_posix.h
+include/c11/threads_win32.h
+
+(C) Copyright yohhoy 2012.
+Distributed under the Boost Software License, Version 1.0.
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare [[derivative work]]s of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/README.fuchsia b/README.fuchsia
new file mode 100644
index 0000000..26fd382
--- /dev/null
+++ b/README.fuchsia
@@ -0,0 +1,9 @@
+Name: Mesa
+URL: https://www.mesa3d.org/
+License: MIT
+License File: CREDITS.fuchsia
+Upstream Git: https://anongit.freedesktop.org/git/mesa/mesa.git
+Description:
+
+The Mesa3D graphics library.
+
diff --git a/bin/get-fixes-pick-list.sh b/bin/get-fixes-pick-list.sh
new file mode 100755
index 0000000..047ea3b
--- /dev/null
+++ b/bin/get-fixes-pick-list.sh
@@ -0,0 +1,81 @@
+#!/bin/sh
+
+# Script for generating a list of candidates [referenced by a Fixes tag] for
+# cherry-picking to a stable branch
+#
+# Usage examples:
+#
+# $ bin/get-fixes-pick-list.sh
+# $ bin/get-fixes-pick-list.sh > picklist
+# $ bin/get-fixes-pick-list.sh | tee picklist
+
+# Use the last branchpoint as our limit for the search
+latest_branchpoint=`git merge-base origin/master HEAD`
+
+# List all the commits between day 1 and the branch point...
+git log --reverse --pretty=%H $latest_branchpoint > already_landed
+
+# ... and the ones cherry-picked.
+git log --reverse --pretty=medium --grep="cherry picked from commit" $latest_branchpoint..HEAD |\
+ grep "cherry picked from commit" |\
+ sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 's/)//' > already_picked
+
+# Grep for commits with Fixes tag
+git log --reverse --pretty=%H -i --grep="fixes:" $latest_branchpoint..origin/master |\
+while read sha
+do
+ # Check to see whether the patch is on the ignore list ...
+ if [ -f bin/.cherry-ignore ] ; then
+ if grep -q ^$sha bin/.cherry-ignore ; then
+ continue
+ fi
+ fi
+
+ # Skip if it has been already cherry-picked.
+ if grep -q ^$sha already_picked ; then
+ continue
+ fi
+
+ # Place every "fixes:" tag on its own line and join with the next word
+ # on its line or a later one.
+ fixes=`git show --pretty=medium -s $sha | tr -d "\n" | sed -e 's/fixes:[[:space:]]*/\nfixes:/Ig' | grep "fixes:" | sed -e 's/\(fixes:[a-zA-Z0-9]*\).*$/\1/'`
+
+ # For each one try to extract the tag
+ fixes_count=`echo "$fixes" | wc -l`
+ warn=`(test $fixes_count -gt 1 && echo $fixes_count) || echo 0`
+ while [ $fixes_count -gt 0 ] ; do
+ # Treat only the current line
+ id=`echo "$fixes" | tail -n $fixes_count | head -n 1 | cut -d : -f 2`
+ fixes_count=$(($fixes_count-1))
+
+ # Bail out if we cannot find suitable id.
+ # Any specific validation the $id is valid and not some junk, is
+ # implied with the follow up code
+ if [ "x$id" = x ] ; then
+ continue
+ fi
+
+ # Check if the offending commit is in branch.
+
+ # Be that cherry-picked ...
+ # ... or landed before the branchpoint.
+ if grep -q ^$id already_picked ||
+ grep -q ^$id already_landed ; then
+
+ printf "Commit \"%s\" fixes %s\n" \
+ "`git log -n1 --pretty=oneline $sha`" \
+ "$id"
+ warn=$(($warn-1))
+ fi
+
+ done
+
+ if [ $warn -gt 0 ] ; then
+ printf "WARNING: Commit \"%s\" has more than one Fixes tag\n" \
+ "`git log -n1 --pretty=oneline $sha`"
+ fi
+
+done
+
+rm -f already_picked
+rm -f already_landed
diff --git a/fetch_buildtools.sh b/fetch_buildtools.sh
new file mode 100755
index 0000000..e4d7562
--- /dev/null
+++ b/fetch_buildtools.sh
@@ -0,0 +1,4 @@
+git clone https://chromium.googlesource.com/chromium/buildtools.git
+
+# From depot_tools
+download_from_google_storage -s buildtools/linux64/gn.sha1 --bucket chromium-gn
diff --git a/include/BUILD.gn b/include/BUILD.gn
new file mode 100644
index 0000000..af3d88e
--- /dev/null
+++ b/include/BUILD.gn
@@ -0,0 +1,65 @@
+# Copyright 2016 The Fuchsia Authors
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+import("../mesa.gni")
+
+config("include_config") {
+ include_dirs = [ "." ]
+}
+
+config("vulkan_public_config") {
+ defines = [ "VK_USE_PLATFORM_MAGMA_KHR=1" ]
+}
+
+mesa_source_set("vulkan") {
+ public_configs = [
+ ":include_config",
+ ":vulkan_public_config",
+ ]
+ sources = [
+ "vulkan/vk_platform.h",
+ "vulkan/vulkan.h",
+ "vulkan/vulkan_intel.h",
+ ]
+}
+
+config("c_compat_public_config") {
+ defines = [
+ "_DEFAULT_SOURCE",
+ "HAVE_PTHREAD=1",
+ ]
+}
+
+mesa_source_set("c_compat") {
+ public_configs = [
+ ":include_config",
+ ":c_compat_public_config",
+ ]
+
+ sources = [
+ "c11/threads.h",
+ "c11/threads_posix.h",
+ "c99_alloca.h",
+ "c99_compat.h",
+ "c99_math.h",
+ "no_extern_c.h",
+ ]
+}
diff --git a/include/drm-uapi/drm.h b/include/drm-uapi/drm.h
index f0bd91d..95f922c 100644
--- a/include/drm-uapi/drm.h
+++ b/include/drm-uapi/drm.h
@@ -42,6 +42,21 @@
#include <asm/ioctl.h>
typedef unsigned int drm_handle_t;
+#elif defined(__Fuchsia__)
+
+#include <bits/ioctl.h>
+#include <sys/types.h>
+typedef int8_t __s8;
+typedef uint8_t __u8;
+typedef int16_t __s16;
+typedef uint16_t __u16;
+typedef int32_t __s32;
+typedef uint32_t __u32;
+typedef int64_t __s64;
+typedef uint64_t __u64;
+typedef size_t __kernel_size_t;
+typedef unsigned long drm_handle_t;
+
#else /* One of the BSDs */
#include <sys/ioccom.h>
diff --git a/include/drm-uapi/i915_drm.h b/include/drm-uapi/i915_drm.h
index 16e452a..cdc0c57 100644
--- a/include/drm-uapi/i915_drm.h
+++ b/include/drm-uapi/i915_drm.h
@@ -842,7 +842,7 @@
* User's handle for a buffer to be bound into the GTT for this
* operation.
*/
- __u32 handle;
+ __u64 handle; // magma uses 64bit buffer 'handles'
/** Number of relocations to be performed on this buffer */
__u32 relocation_count;
@@ -914,7 +914,7 @@
/**
* User's handle for a drm_syncobj to wait on or signal.
*/
- __u32 handle;
+ __u64 handle; // magma uses 64bit buffer 'handles'
#define I915_EXEC_FENCE_WAIT (1<<0)
#define I915_EXEC_FENCE_SIGNAL (1<<1)
diff --git a/include/vulkan/vulkan.h b/include/vulkan/vulkan.h
index d05c849..42c4a3d 100644
--- a/include/vulkan/vulkan.h
+++ b/include/vulkan/vulkan.h
@@ -24,6 +24,10 @@
#include "vulkan_android.h"
#endif
+#if defined(VK_USE_PLATFORM_FUCHSIA) || defined(VK_USE_PLATFORM_MAGMA_KHR)
+#include <zircon/types.h>
+#include "vulkan_fuchsia.h"
+#endif
#ifdef VK_USE_PLATFORM_IOS_MVK
#include "vulkan_ios.h"
diff --git a/include/vulkan/vulkan_core.h b/include/vulkan/vulkan_core.h
index fe45014..8c69900 100644
--- a/include/vulkan/vulkan_core.h
+++ b/include/vulkan/vulkan_core.h
@@ -43,7 +43,7 @@
#define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff)
#define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xfff)
// Version of this file
-#define VK_HEADER_VERSION 84
+#define VK_HEADER_VERSION 89
#define VK_NULL_HANDLE 0
@@ -147,6 +147,7 @@
VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = -1000003001,
VK_ERROR_VALIDATION_FAILED_EXT = -1000011001,
VK_ERROR_INVALID_SHADER_NV = -1000012000,
+ VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT = -1000158000,
VK_ERROR_FRAGMENTATION_EXT = -1000161000,
VK_ERROR_NOT_PERMITTED_EXT = -1000174001,
VK_ERROR_OUT_OF_POOL_MEMORY_KHR = VK_ERROR_OUT_OF_POOL_MEMORY,
@@ -297,7 +298,11 @@
VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000,
VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001,
VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT = 1000028000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT = 1000028001,
+ VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT = 1000028002,
VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD = 1000041000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV = 1000050000,
VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000,
VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = 1000056001,
VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057000,
@@ -397,6 +402,12 @@
VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT = 1000148002,
VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV = 1000149000,
VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV = 1000152000,
+ VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT = 1000158000,
+ VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT = 1000158001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT = 1000158002,
+ VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT = 1000158003,
+ VK_STRUCTURE_TYPE_IMAGE_EXCPLICIT_DRM_FORMAT_MODIFIER_CREATE_INFO_EXT = 1000158004,
+ VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT = 1000158005,
VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT = 1000160000,
VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT = 1000160001,
VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO_EXT = 1000161000,
@@ -404,18 +415,52 @@
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES_EXT = 1000161002,
VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO_EXT = 1000161003,
VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT_EXT = 1000161004,
+ VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV = 1000164000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV = 1000164001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV = 1000164002,
+ VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV = 1000164005,
+ VK_STRUCTURE_TYPE_RAYTRACING_PIPELINE_CREATE_INFO_NVX = 1000165000,
+ VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NVX = 1000165001,
+ VK_STRUCTURE_TYPE_GEOMETRY_INSTANCE_NVX = 1000165002,
+ VK_STRUCTURE_TYPE_GEOMETRY_NVX = 1000165003,
+ VK_STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NVX = 1000165004,
+ VK_STRUCTURE_TYPE_GEOMETRY_AABB_NVX = 1000165005,
+ VK_STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NVX = 1000165006,
+ VK_STRUCTURE_TYPE_DESCRIPTOR_ACCELERATION_STRUCTURE_INFO_NVX = 1000165007,
+ VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NVX = 1000165008,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAYTRACING_PROPERTIES_NVX = 1000165009,
+ VK_STRUCTURE_TYPE_HIT_SHADER_MODULE_CREATE_INFO_NVX = 1000165010,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV = 1000166000,
+ VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV = 1000166001,
VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT = 1000174000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR = 1000177000,
VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT = 1000178000,
VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT = 1000178001,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT = 1000178002,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR = 1000180000,
+ VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT = 1000184000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD = 1000185000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT = 1000190000,
VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT = 1000190001,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT = 1000190002,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR = 1000196000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV = 1000201000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV = 1000202000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV = 1000202001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV = 1000203000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV = 1000204000,
+ VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV = 1000205000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV = 1000205002,
VK_STRUCTURE_TYPE_CHECKPOINT_DATA_NV = 1000206000,
VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV = 1000206001,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR = 1000211000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT = 1000212000,
+ VK_STRUCTURE_TYPE_IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA = 1000214000,
+ VK_STRUCTURE_TYPE_IMPORT_MEMORY_FUCHSIA_HANDLE_INFO_KHR = 1001000000,
+ VK_STRUCTURE_TYPE_MEMORY_FUCHSIA_HANDLE_PROPERTIES_KHR = 1001000001,
+ VK_STRUCTURE_TYPE_MEMORY_GET_FUCHSIA_HANDLE_INFO_KHR = 1001000002,
+ VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FUCHSIA_HANDLE_INFO_KHR = 1001001000,
+ VK_STRUCTURE_TYPE_SEMAPHORE_GET_FUCHSIA_HANDLE_INFO_KHR = 1001001001,
VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT,
VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES,
@@ -784,6 +829,7 @@
typedef enum VkImageTiling {
VK_IMAGE_TILING_OPTIMAL = 0,
VK_IMAGE_TILING_LINEAR = 1,
+ VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT = 1000158000,
VK_IMAGE_TILING_BEGIN_RANGE = VK_IMAGE_TILING_OPTIMAL,
VK_IMAGE_TILING_END_RANGE = VK_IMAGE_TILING_LINEAR,
VK_IMAGE_TILING_RANGE_SIZE = (VK_IMAGE_TILING_LINEAR - VK_IMAGE_TILING_OPTIMAL + 1),
@@ -806,6 +852,8 @@
VK_QUERY_TYPE_OCCLUSION = 0,
VK_QUERY_TYPE_PIPELINE_STATISTICS = 1,
VK_QUERY_TYPE_TIMESTAMP = 2,
+ VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT = 1000028004,
+ VK_QUERY_TYPE_COMPACTED_SIZE_NVX = 1000165000,
VK_QUERY_TYPE_BEGIN_RANGE = VK_QUERY_TYPE_OCCLUSION,
VK_QUERY_TYPE_END_RANGE = VK_QUERY_TYPE_TIMESTAMP,
VK_QUERY_TYPE_RANGE_SIZE = (VK_QUERY_TYPE_TIMESTAMP - VK_QUERY_TYPE_OCCLUSION + 1),
@@ -835,6 +883,7 @@
VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL = 1000117001,
VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002,
VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR = 1000111000,
+ VK_IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV = 1000164003,
VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR = VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL,
VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR = VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL,
VK_IMAGE_LAYOUT_BEGIN_RANGE = VK_IMAGE_LAYOUT_UNDEFINED,
@@ -1068,6 +1117,9 @@
VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV = 1000087000,
VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT = 1000099000,
VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT = 1000143000,
+ VK_DYNAMIC_STATE_VIEWPORT_SHADING_RATE_PALETTE_NV = 1000164004,
+ VK_DYNAMIC_STATE_VIEWPORT_COARSE_SAMPLE_ORDER_NV = 1000164006,
+ VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_NV = 1000205001,
VK_DYNAMIC_STATE_BEGIN_RANGE = VK_DYNAMIC_STATE_VIEWPORT,
VK_DYNAMIC_STATE_END_RANGE = VK_DYNAMIC_STATE_STENCIL_REFERENCE,
VK_DYNAMIC_STATE_RANGE_SIZE = (VK_DYNAMIC_STATE_STENCIL_REFERENCE - VK_DYNAMIC_STATE_VIEWPORT + 1),
@@ -1131,6 +1183,7 @@
VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 9,
VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 10,
VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT = 1000138000,
+ VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NVX = 1000165000,
VK_DESCRIPTOR_TYPE_BEGIN_RANGE = VK_DESCRIPTOR_TYPE_SAMPLER,
VK_DESCRIPTOR_TYPE_END_RANGE = VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT,
VK_DESCRIPTOR_TYPE_RANGE_SIZE = (VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT - VK_DESCRIPTOR_TYPE_SAMPLER + 1),
@@ -1159,6 +1212,7 @@
typedef enum VkPipelineBindPoint {
VK_PIPELINE_BIND_POINT_GRAPHICS = 0,
VK_PIPELINE_BIND_POINT_COMPUTE = 1,
+ VK_PIPELINE_BIND_POINT_RAYTRACING_NVX = 1000165000,
VK_PIPELINE_BIND_POINT_BEGIN_RANGE = VK_PIPELINE_BIND_POINT_GRAPHICS,
VK_PIPELINE_BIND_POINT_END_RANGE = VK_PIPELINE_BIND_POINT_COMPUTE,
VK_PIPELINE_BIND_POINT_RANGE_SIZE = (VK_PIPELINE_BIND_POINT_COMPUTE - VK_PIPELINE_BIND_POINT_GRAPHICS + 1),
@@ -1230,6 +1284,7 @@
VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX = 1000086001,
VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT = 1000128000,
VK_OBJECT_TYPE_VALIDATION_CACHE_EXT = 1000160000,
+ VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NVX = 1000165000,
VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR = VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE,
VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR = VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION,
VK_OBJECT_TYPE_BEGIN_RANGE = VK_OBJECT_TYPE_UNKNOWN,
@@ -1297,6 +1352,8 @@
VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020,
VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040,
VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080,
+ VK_IMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV = 0x00000100,
+ VK_IMAGE_USAGE_SCANOUT_BIT_GOOGLE = 0x00010000,
VK_IMAGE_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
} VkImageUsageFlagBits;
typedef VkFlags VkImageUsageFlags;
@@ -1314,6 +1371,7 @@
VK_IMAGE_CREATE_EXTENDED_USAGE_BIT = 0x00000100,
VK_IMAGE_CREATE_PROTECTED_BIT = 0x00000800,
VK_IMAGE_CREATE_DISJOINT_BIT = 0x00000200,
+ VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV = 0x00002000,
VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT = 0x00001000,
VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR = VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT,
VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR = VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT,
@@ -1391,8 +1449,13 @@
VK_PIPELINE_STAGE_HOST_BIT = 0x00004000,
VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000,
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000,
+ VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT = 0x01000000,
VK_PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT = 0x00040000,
VK_PIPELINE_STAGE_COMMAND_PROCESS_BIT_NVX = 0x00020000,
+ VK_PIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV = 0x00400000,
+ VK_PIPELINE_STAGE_RAYTRACING_BIT_NVX = 0x00200000,
+ VK_PIPELINE_STAGE_TASK_SHADER_BIT_NV = 0x00080000,
+ VK_PIPELINE_STAGE_MESH_SHADER_BIT_NV = 0x00100000,
VK_PIPELINE_STAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
} VkPipelineStageFlagBits;
typedef VkFlags VkPipelineStageFlags;
@@ -1406,6 +1469,10 @@
VK_IMAGE_ASPECT_PLANE_0_BIT = 0x00000010,
VK_IMAGE_ASPECT_PLANE_1_BIT = 0x00000020,
VK_IMAGE_ASPECT_PLANE_2_BIT = 0x00000040,
+ VK_IMAGE_ASPECT_MEMORY_PLANE_0_BIT_EXT = 0x00000080,
+ VK_IMAGE_ASPECT_MEMORY_PLANE_1_BIT_EXT = 0x00000100,
+ VK_IMAGE_ASPECT_MEMORY_PLANE_2_BIT_EXT = 0x00000200,
+ VK_IMAGE_ASPECT_MEMORY_PLANE_3_BIT_EXT = 0x00000400,
VK_IMAGE_ASPECT_PLANE_0_BIT_KHR = VK_IMAGE_ASPECT_PLANE_0_BIT,
VK_IMAGE_ASPECT_PLANE_1_BIT_KHR = VK_IMAGE_ASPECT_PLANE_1_BIT,
VK_IMAGE_ASPECT_PLANE_2_BIT_KHR = VK_IMAGE_ASPECT_PLANE_2_BIT,
@@ -1480,7 +1547,10 @@
VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040,
VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080,
VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100,
+ VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT = 0x00000800,
+ VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT = 0x00001000,
VK_BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT = 0x00000200,
+ VK_BUFFER_USAGE_RAYTRACING_BIT_NVX = 0x00000400,
VK_BUFFER_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
} VkBufferUsageFlagBits;
typedef VkFlags VkBufferUsageFlags;
@@ -1495,6 +1565,7 @@
VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004,
VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT = 0x00000008,
VK_PIPELINE_CREATE_DISPATCH_BASE = 0x00000010,
+ VK_PIPELINE_CREATE_DEFER_COMPILE_BIT_NVX = 0x00000020,
VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHR = VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT,
VK_PIPELINE_CREATE_DISPATCH_BASE_KHR = VK_PIPELINE_CREATE_DISPATCH_BASE,
VK_PIPELINE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
@@ -1511,6 +1582,14 @@
VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020,
VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F,
VK_SHADER_STAGE_ALL = 0x7FFFFFFF,
+ VK_SHADER_STAGE_RAYGEN_BIT_NVX = 0x00000100,
+ VK_SHADER_STAGE_ANY_HIT_BIT_NVX = 0x00000200,
+ VK_SHADER_STAGE_CLOSEST_HIT_BIT_NVX = 0x00000400,
+ VK_SHADER_STAGE_MISS_BIT_NVX = 0x00000800,
+ VK_SHADER_STAGE_INTERSECTION_BIT_NVX = 0x00001000,
+ VK_SHADER_STAGE_CALLABLE_BIT_NVX = 0x00002000,
+ VK_SHADER_STAGE_TASK_BIT_NV = 0x00000040,
+ VK_SHADER_STAGE_MESH_BIT_NV = 0x00000080,
VK_SHADER_STAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
} VkShaderStageFlagBits;
typedef VkFlags VkPipelineVertexInputStateCreateFlags;
@@ -1592,10 +1671,16 @@
VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000,
+ VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT = 0x02000000,
+ VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT = 0x04000000,
+ VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT = 0x08000000,
VK_ACCESS_CONDITIONAL_RENDERING_READ_BIT_EXT = 0x00100000,
VK_ACCESS_COMMAND_PROCESS_READ_BIT_NVX = 0x00020000,
VK_ACCESS_COMMAND_PROCESS_WRITE_BIT_NVX = 0x00040000,
VK_ACCESS_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT = 0x00080000,
+ VK_ACCESS_SHADING_RATE_IMAGE_READ_BIT_NV = 0x00800000,
+ VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_NVX = 0x00200000,
+ VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_NVX = 0x00400000,
VK_ACCESS_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
} VkAccessFlagBits;
typedef VkFlags VkAccessFlags;
@@ -3838,6 +3923,7 @@
VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID = 0x00000400,
VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT = 0x00000080,
VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT = 0x00000100,
+ VK_EXTERNAL_MEMORY_HANDLE_TYPE_FUCHSIA_VMO_BIT_KHR = 0x00000800,
VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT,
VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT,
VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT,
@@ -3902,6 +3988,7 @@
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 0x00000004,
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT = 0x00000008,
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT = 0x00000010,
+ VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_FUCHSIA_FENCE_BIT_KHR = 0x00000020,
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT,
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT,
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT,
@@ -4062,6 +4149,8 @@
VkMemoryRequirements memoryRequirements;
} VkMemoryRequirements2;
+typedef VkMemoryRequirements2 VkMemoryRequirements2KHR;
+
typedef struct VkSparseImageMemoryRequirements2 {
VkStructureType sType;
void* pNext;
@@ -5826,8 +5915,6 @@
typedef VkImageSparseMemoryRequirementsInfo2 VkImageSparseMemoryRequirementsInfo2KHR;
-typedef VkMemoryRequirements2 VkMemoryRequirements2KHR;
-
typedef VkSparseImageMemoryRequirements2 VkSparseImageMemoryRequirements2KHR;
@@ -5992,6 +6079,60 @@
+#define VK_KHR_shader_atomic_int64 1
+#define VK_KHR_SHADER_ATOMIC_INT64_SPEC_VERSION 1
+#define VK_KHR_SHADER_ATOMIC_INT64_EXTENSION_NAME "VK_KHR_shader_atomic_int64"
+
+typedef struct VkPhysicalDeviceShaderAtomicInt64FeaturesKHR {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 shaderBufferInt64Atomics;
+ VkBool32 shaderSharedInt64Atomics;
+} VkPhysicalDeviceShaderAtomicInt64FeaturesKHR;
+
+
+
+#define VK_KHR_driver_properties 1
+#define VK_MAX_DRIVER_NAME_SIZE_KHR 256
+#define VK_MAX_DRIVER_INFO_SIZE_KHR 256
+#define VK_KHR_DRIVER_PROPERTIES_SPEC_VERSION 1
+#define VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME "VK_KHR_driver_properties"
+
+
+typedef enum VkDriverIdKHR {
+ VK_DRIVER_ID_AMD_PROPRIETARY_KHR = 1,
+ VK_DRIVER_ID_AMD_OPEN_SOURCE_KHR = 2,
+ VK_DRIVER_ID_MESA_RADV_KHR = 3,
+ VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR = 4,
+ VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS_KHR = 5,
+ VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA_KHR = 6,
+ VK_DRIVER_ID_IMAGINATION_PROPRIETARY_KHR = 7,
+ VK_DRIVER_ID_QUALCOMM_PROPRIETARY_KHR = 8,
+ VK_DRIVER_ID_ARM_PROPRIETARY_KHR = 9,
+ VK_DRIVER_ID_BEGIN_RANGE_KHR = VK_DRIVER_ID_AMD_PROPRIETARY_KHR,
+ VK_DRIVER_ID_END_RANGE_KHR = VK_DRIVER_ID_ARM_PROPRIETARY_KHR,
+ VK_DRIVER_ID_RANGE_SIZE_KHR = (VK_DRIVER_ID_ARM_PROPRIETARY_KHR - VK_DRIVER_ID_AMD_PROPRIETARY_KHR + 1),
+ VK_DRIVER_ID_MAX_ENUM_KHR = 0x7FFFFFFF
+} VkDriverIdKHR;
+
+typedef struct VkConformanceVersionKHR {
+ uint8_t major;
+ uint8_t minor;
+ uint8_t subminor;
+ uint8_t patch;
+} VkConformanceVersionKHR;
+
+typedef struct VkPhysicalDeviceDriverPropertiesKHR {
+ VkStructureType sType;
+ void* pNext;
+ VkDriverIdKHR driverID;
+ char driverName[VK_MAX_DRIVER_NAME_SIZE_KHR];
+ char driverInfo[VK_MAX_DRIVER_INFO_SIZE_KHR];
+ VkConformanceVersionKHR conformanceVersion;
+} VkPhysicalDeviceDriverPropertiesKHR;
+
+
+
#define VK_KHR_vulkan_memory_model 1
#define VK_KHR_VULKAN_MEMORY_MODEL_SPEC_VERSION 2
#define VK_KHR_VULKAN_MEMORY_MODEL_EXTENSION_NAME "VK_KHR_vulkan_memory_model"
@@ -6049,6 +6190,7 @@
VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT = 33,
VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT = 1000156000,
VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT = 1000085000,
+ VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_NVX_EXT = 1000165000,
VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT,
VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT,
VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT,
@@ -6250,6 +6392,95 @@
+#define VK_EXT_transform_feedback 1
+#define VK_EXT_TRANSFORM_FEEDBACK_SPEC_VERSION 1
+#define VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME "VK_EXT_transform_feedback"
+
+typedef VkFlags VkPipelineRasterizationStateStreamCreateFlagsEXT;
+
+typedef struct VkPhysicalDeviceTransformFeedbackFeaturesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 transformFeedback;
+ VkBool32 geometryStreams;
+} VkPhysicalDeviceTransformFeedbackFeaturesEXT;
+
+typedef struct VkPhysicalDeviceTransformFeedbackPropertiesEXT {
+ VkStructureType sType;
+ void* pNext;
+ uint32_t maxTransformFeedbackStreams;
+ uint32_t maxTransformFeedbackBuffers;
+ VkDeviceSize maxTransformFeedbackBufferSize;
+ uint32_t maxTransformFeedbackStreamDataSize;
+ uint32_t maxTransformFeedbackBufferDataSize;
+ uint32_t maxTransformFeedbackBufferDataStride;
+ VkBool32 transformFeedbackQueries;
+ VkBool32 transformFeedbackStreamsLinesTriangles;
+ VkBool32 transformFeedbackRasterizationStreamSelect;
+ VkBool32 transformFeedbackDraw;
+} VkPhysicalDeviceTransformFeedbackPropertiesEXT;
+
+typedef struct VkPipelineRasterizationStateStreamCreateInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkPipelineRasterizationStateStreamCreateFlagsEXT flags;
+ uint32_t rasterizationStream;
+} VkPipelineRasterizationStateStreamCreateInfoEXT;
+
+
+typedef void (VKAPI_PTR *PFN_vkCmdBindTransformFeedbackBuffersEXT)(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes);
+typedef void (VKAPI_PTR *PFN_vkCmdBeginTransformFeedbackEXT)(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer* pCounterBuffers, const VkDeviceSize* pCounterBufferOffsets);
+typedef void (VKAPI_PTR *PFN_vkCmdEndTransformFeedbackEXT)(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer* pCounterBuffers, const VkDeviceSize* pCounterBufferOffsets);
+typedef void (VKAPI_PTR *PFN_vkCmdBeginQueryIndexedEXT)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags, uint32_t index);
+typedef void (VKAPI_PTR *PFN_vkCmdEndQueryIndexedEXT)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, uint32_t index);
+typedef void (VKAPI_PTR *PFN_vkCmdDrawIndirectByteCountEXT)(VkCommandBuffer commandBuffer, uint32_t instanceCount, uint32_t firstInstance, VkBuffer counterBuffer, VkDeviceSize counterBufferOffset, uint32_t counterOffset, uint32_t vertexStride);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR void VKAPI_CALL vkCmdBindTransformFeedbackBuffersEXT(
+ VkCommandBuffer commandBuffer,
+ uint32_t firstBinding,
+ uint32_t bindingCount,
+ const VkBuffer* pBuffers,
+ const VkDeviceSize* pOffsets,
+ const VkDeviceSize* pSizes);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdBeginTransformFeedbackEXT(
+ VkCommandBuffer commandBuffer,
+ uint32_t firstCounterBuffer,
+ uint32_t counterBufferCount,
+ const VkBuffer* pCounterBuffers,
+ const VkDeviceSize* pCounterBufferOffsets);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdEndTransformFeedbackEXT(
+ VkCommandBuffer commandBuffer,
+ uint32_t firstCounterBuffer,
+ uint32_t counterBufferCount,
+ const VkBuffer* pCounterBuffers,
+ const VkDeviceSize* pCounterBufferOffsets);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdBeginQueryIndexedEXT(
+ VkCommandBuffer commandBuffer,
+ VkQueryPool queryPool,
+ uint32_t query,
+ VkQueryControlFlags flags,
+ uint32_t index);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdEndQueryIndexedEXT(
+ VkCommandBuffer commandBuffer,
+ VkQueryPool queryPool,
+ uint32_t query,
+ uint32_t index);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndirectByteCountEXT(
+ VkCommandBuffer commandBuffer,
+ uint32_t instanceCount,
+ uint32_t firstInstance,
+ VkBuffer counterBuffer,
+ VkDeviceSize counterBufferOffset,
+ uint32_t counterOffset,
+ uint32_t vertexStride);
+#endif
+
#define VK_AMD_draw_indirect_count 1
#define VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION 1
#define VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_AMD_draw_indirect_count"
@@ -6355,6 +6586,18 @@
#define VK_AMD_SHADER_IMAGE_LOAD_STORE_LOD_EXTENSION_NAME "VK_AMD_shader_image_load_store_lod"
+#define VK_NV_corner_sampled_image 1
+#define VK_NV_CORNER_SAMPLED_IMAGE_SPEC_VERSION 2
+#define VK_NV_CORNER_SAMPLED_IMAGE_EXTENSION_NAME "VK_NV_corner_sampled_image"
+
+typedef struct VkPhysicalDeviceCornerSampledImageFeaturesNV {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 cornerSampledImage;
+} VkPhysicalDeviceCornerSampledImageFeaturesNV;
+
+
+
#define VK_IMG_format_pvrtc 1
#define VK_IMG_FORMAT_PVRTC_SPEC_VERSION 1
#define VK_IMG_FORMAT_PVRTC_EXTENSION_NAME "VK_IMG_format_pvrtc"
@@ -7220,7 +7463,7 @@
typedef VkBool32 (VKAPI_PTR *PFN_vkDebugUtilsMessengerCallbackEXT)(
VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
- VkDebugUtilsMessageTypeFlagsEXT messageType,
+ VkDebugUtilsMessageTypeFlagsEXT messageTypes,
const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData,
void* pUserData);
@@ -7555,6 +7798,65 @@
#define VK_EXT_POST_DEPTH_COVERAGE_EXTENSION_NAME "VK_EXT_post_depth_coverage"
+#define VK_EXT_image_drm_format_modifier 1
+#define VK_EXT_EXTENSION_159_SPEC_VERSION 0
+#define VK_EXT_EXTENSION_159_EXTENSION_NAME "VK_EXT_extension_159"
+#define VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_SPEC_VERSION 1
+#define VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME "VK_EXT_image_drm_format_modifier"
+
+typedef struct VkDrmFormatModifierPropertiesEXT {
+ uint64_t drmFormatModifier;
+ uint32_t drmFormatModifierPlaneCount;
+ VkFormatFeatureFlags drmFormatModifierTilingFeatures;
+} VkDrmFormatModifierPropertiesEXT;
+
+typedef struct VkDrmFormatModifierPropertiesListEXT {
+ VkStructureType sType;
+ void* pNext;
+ uint32_t drmFormatModifierCount;
+ VkDrmFormatModifierPropertiesEXT* pDrmFormatModifierProperties;
+} VkDrmFormatModifierPropertiesListEXT;
+
+typedef struct VkPhysicalDeviceImageDrmFormatModifierInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ uint64_t drmFormatModifier;
+ VkSharingMode sharingMode;
+ uint32_t queueFamilyIndexCount;
+ const uint32_t* pQueueFamilyIndices;
+} VkPhysicalDeviceImageDrmFormatModifierInfoEXT;
+
+typedef struct VkImageDrmFormatModifierListCreateInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t drmFormatModifierCount;
+ const uint64_t* pDrmFormatModifiers;
+} VkImageDrmFormatModifierListCreateInfoEXT;
+
+typedef struct VkImageDrmFormatModifierExplicitCreateInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ uint64_t drmFormatModifier;
+ uint32_t drmFormatModifierPlaneCount;
+ const VkSubresourceLayout* pPlaneLayouts;
+} VkImageDrmFormatModifierExplicitCreateInfoEXT;
+
+typedef struct VkImageDrmFormatModifierPropertiesEXT {
+ VkStructureType sType;
+ void* pNext;
+ uint64_t drmFormatModifier;
+} VkImageDrmFormatModifierPropertiesEXT;
+
+
+typedef VkResult (VKAPI_PTR *PFN_vkGetImageDrmFormatModifierPropertiesEXT)(VkDevice device, VkImage image, VkImageDrmFormatModifierPropertiesEXT* pProperties);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR VkResult VKAPI_CALL vkGetImageDrmFormatModifierPropertiesEXT(
+ VkDevice device,
+ VkImage image,
+ VkImageDrmFormatModifierPropertiesEXT* pProperties);
+#endif
+
#define VK_EXT_validation_cache 1
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkValidationCacheEXT)
@@ -7711,6 +8013,397 @@
#define VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_EXTENSION_NAME "VK_EXT_shader_viewport_index_layer"
+#define VK_NV_shading_rate_image 1
+#define VK_NV_SHADING_RATE_IMAGE_SPEC_VERSION 3
+#define VK_NV_SHADING_RATE_IMAGE_EXTENSION_NAME "VK_NV_shading_rate_image"
+
+
+typedef enum VkShadingRatePaletteEntryNV {
+ VK_SHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV = 0,
+ VK_SHADING_RATE_PALETTE_ENTRY_16_INVOCATIONS_PER_PIXEL_NV = 1,
+ VK_SHADING_RATE_PALETTE_ENTRY_8_INVOCATIONS_PER_PIXEL_NV = 2,
+ VK_SHADING_RATE_PALETTE_ENTRY_4_INVOCATIONS_PER_PIXEL_NV = 3,
+ VK_SHADING_RATE_PALETTE_ENTRY_2_INVOCATIONS_PER_PIXEL_NV = 4,
+ VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_PIXEL_NV = 5,
+ VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X1_PIXELS_NV = 6,
+ VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_1X2_PIXELS_NV = 7,
+ VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X2_PIXELS_NV = 8,
+ VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X2_PIXELS_NV = 9,
+ VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X4_PIXELS_NV = 10,
+ VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X4_PIXELS_NV = 11,
+ VK_SHADING_RATE_PALETTE_ENTRY_BEGIN_RANGE_NV = VK_SHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV,
+ VK_SHADING_RATE_PALETTE_ENTRY_END_RANGE_NV = VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X4_PIXELS_NV,
+ VK_SHADING_RATE_PALETTE_ENTRY_RANGE_SIZE_NV = (VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X4_PIXELS_NV - VK_SHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV + 1),
+ VK_SHADING_RATE_PALETTE_ENTRY_MAX_ENUM_NV = 0x7FFFFFFF
+} VkShadingRatePaletteEntryNV;
+
+typedef enum VkCoarseSampleOrderTypeNV {
+ VK_COARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV = 0,
+ VK_COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV = 1,
+ VK_COARSE_SAMPLE_ORDER_TYPE_PIXEL_MAJOR_NV = 2,
+ VK_COARSE_SAMPLE_ORDER_TYPE_SAMPLE_MAJOR_NV = 3,
+ VK_COARSE_SAMPLE_ORDER_TYPE_BEGIN_RANGE_NV = VK_COARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV,
+ VK_COARSE_SAMPLE_ORDER_TYPE_END_RANGE_NV = VK_COARSE_SAMPLE_ORDER_TYPE_SAMPLE_MAJOR_NV,
+ VK_COARSE_SAMPLE_ORDER_TYPE_RANGE_SIZE_NV = (VK_COARSE_SAMPLE_ORDER_TYPE_SAMPLE_MAJOR_NV - VK_COARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV + 1),
+ VK_COARSE_SAMPLE_ORDER_TYPE_MAX_ENUM_NV = 0x7FFFFFFF
+} VkCoarseSampleOrderTypeNV;
+
+typedef struct VkShadingRatePaletteNV {
+ uint32_t shadingRatePaletteEntryCount;
+ const VkShadingRatePaletteEntryNV* pShadingRatePaletteEntries;
+} VkShadingRatePaletteNV;
+
+typedef struct VkPipelineViewportShadingRateImageStateCreateInfoNV {
+ VkStructureType sType;
+ const void* pNext;
+ VkBool32 shadingRateImageEnable;
+ uint32_t viewportCount;
+ const VkShadingRatePaletteNV* pShadingRatePalettes;
+} VkPipelineViewportShadingRateImageStateCreateInfoNV;
+
+typedef struct VkPhysicalDeviceShadingRateImageFeaturesNV {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 shadingRateImage;
+ VkBool32 shadingRateCoarseSampleOrder;
+} VkPhysicalDeviceShadingRateImageFeaturesNV;
+
+typedef struct VkPhysicalDeviceShadingRateImagePropertiesNV {
+ VkStructureType sType;
+ void* pNext;
+ VkExtent2D shadingRateTexelSize;
+ uint32_t shadingRatePaletteSize;
+ uint32_t shadingRateMaxCoarseSamples;
+} VkPhysicalDeviceShadingRateImagePropertiesNV;
+
+typedef struct VkCoarseSampleLocationNV {
+ uint32_t pixelX;
+ uint32_t pixelY;
+ uint32_t sample;
+} VkCoarseSampleLocationNV;
+
+typedef struct VkCoarseSampleOrderCustomNV {
+ VkShadingRatePaletteEntryNV shadingRate;
+ uint32_t sampleCount;
+ uint32_t sampleLocationCount;
+ const VkCoarseSampleLocationNV* pSampleLocations;
+} VkCoarseSampleOrderCustomNV;
+
+typedef struct VkPipelineViewportCoarseSampleOrderStateCreateInfoNV {
+ VkStructureType sType;
+ const void* pNext;
+ VkCoarseSampleOrderTypeNV sampleOrderType;
+ uint32_t customSampleOrderCount;
+ const VkCoarseSampleOrderCustomNV* pCustomSampleOrders;
+} VkPipelineViewportCoarseSampleOrderStateCreateInfoNV;
+
+
+typedef void (VKAPI_PTR *PFN_vkCmdBindShadingRateImageNV)(VkCommandBuffer commandBuffer, VkImageView imageView, VkImageLayout imageLayout);
+typedef void (VKAPI_PTR *PFN_vkCmdSetViewportShadingRatePaletteNV)(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkShadingRatePaletteNV* pShadingRatePalettes);
+typedef void (VKAPI_PTR *PFN_vkCmdSetCoarseSampleOrderNV)(VkCommandBuffer commandBuffer, VkCoarseSampleOrderTypeNV sampleOrderType, uint32_t customSampleOrderCount, const VkCoarseSampleOrderCustomNV* pCustomSampleOrders);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR void VKAPI_CALL vkCmdBindShadingRateImageNV(
+ VkCommandBuffer commandBuffer,
+ VkImageView imageView,
+ VkImageLayout imageLayout);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetViewportShadingRatePaletteNV(
+ VkCommandBuffer commandBuffer,
+ uint32_t firstViewport,
+ uint32_t viewportCount,
+ const VkShadingRatePaletteNV* pShadingRatePalettes);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetCoarseSampleOrderNV(
+ VkCommandBuffer commandBuffer,
+ VkCoarseSampleOrderTypeNV sampleOrderType,
+ uint32_t customSampleOrderCount,
+ const VkCoarseSampleOrderCustomNV* pCustomSampleOrders);
+#endif
+
+#define VK_NVX_raytracing 1
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkAccelerationStructureNVX)
+
+#define VK_NVX_RAYTRACING_SPEC_VERSION 1
+#define VK_NVX_RAYTRACING_EXTENSION_NAME "VK_NVX_raytracing"
+
+
+typedef enum VkGeometryTypeNVX {
+ VK_GEOMETRY_TYPE_TRIANGLES_NVX = 0,
+ VK_GEOMETRY_TYPE_AABBS_NVX = 1,
+ VK_GEOMETRY_TYPE_BEGIN_RANGE_NVX = VK_GEOMETRY_TYPE_TRIANGLES_NVX,
+ VK_GEOMETRY_TYPE_END_RANGE_NVX = VK_GEOMETRY_TYPE_AABBS_NVX,
+ VK_GEOMETRY_TYPE_RANGE_SIZE_NVX = (VK_GEOMETRY_TYPE_AABBS_NVX - VK_GEOMETRY_TYPE_TRIANGLES_NVX + 1),
+ VK_GEOMETRY_TYPE_MAX_ENUM_NVX = 0x7FFFFFFF
+} VkGeometryTypeNVX;
+
+typedef enum VkAccelerationStructureTypeNVX {
+ VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_NVX = 0,
+ VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_NVX = 1,
+ VK_ACCELERATION_STRUCTURE_TYPE_BEGIN_RANGE_NVX = VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_NVX,
+ VK_ACCELERATION_STRUCTURE_TYPE_END_RANGE_NVX = VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_NVX,
+ VK_ACCELERATION_STRUCTURE_TYPE_RANGE_SIZE_NVX = (VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_NVX - VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_NVX + 1),
+ VK_ACCELERATION_STRUCTURE_TYPE_MAX_ENUM_NVX = 0x7FFFFFFF
+} VkAccelerationStructureTypeNVX;
+
+typedef enum VkCopyAccelerationStructureModeNVX {
+ VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_NVX = 0,
+ VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_NVX = 1,
+ VK_COPY_ACCELERATION_STRUCTURE_MODE_BEGIN_RANGE_NVX = VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_NVX,
+ VK_COPY_ACCELERATION_STRUCTURE_MODE_END_RANGE_NVX = VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_NVX,
+ VK_COPY_ACCELERATION_STRUCTURE_MODE_RANGE_SIZE_NVX = (VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_NVX - VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_NVX + 1),
+ VK_COPY_ACCELERATION_STRUCTURE_MODE_MAX_ENUM_NVX = 0x7FFFFFFF
+} VkCopyAccelerationStructureModeNVX;
+
+
+typedef enum VkGeometryFlagBitsNVX {
+ VK_GEOMETRY_OPAQUE_BIT_NVX = 0x00000001,
+ VK_GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_NVX = 0x00000002,
+ VK_GEOMETRY_FLAG_BITS_MAX_ENUM_NVX = 0x7FFFFFFF
+} VkGeometryFlagBitsNVX;
+typedef VkFlags VkGeometryFlagsNVX;
+
+typedef enum VkGeometryInstanceFlagBitsNVX {
+ VK_GEOMETRY_INSTANCE_TRIANGLE_CULL_DISABLE_BIT_NVX = 0x00000001,
+ VK_GEOMETRY_INSTANCE_TRIANGLE_CULL_FLIP_WINDING_BIT_NVX = 0x00000002,
+ VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_NVX = 0x00000004,
+ VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_NVX = 0x00000008,
+ VK_GEOMETRY_INSTANCE_FLAG_BITS_MAX_ENUM_NVX = 0x7FFFFFFF
+} VkGeometryInstanceFlagBitsNVX;
+typedef VkFlags VkGeometryInstanceFlagsNVX;
+
+typedef enum VkBuildAccelerationStructureFlagBitsNVX {
+ VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_NVX = 0x00000001,
+ VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_NVX = 0x00000002,
+ VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_NVX = 0x00000004,
+ VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_NVX = 0x00000008,
+ VK_BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_NVX = 0x00000010,
+ VK_BUILD_ACCELERATION_STRUCTURE_FLAG_BITS_MAX_ENUM_NVX = 0x7FFFFFFF
+} VkBuildAccelerationStructureFlagBitsNVX;
+typedef VkFlags VkBuildAccelerationStructureFlagsNVX;
+
+typedef struct VkRaytracingPipelineCreateInfoNVX {
+ VkStructureType sType;
+ const void* pNext;
+ VkPipelineCreateFlags flags;
+ uint32_t stageCount;
+ const VkPipelineShaderStageCreateInfo* pStages;
+ const uint32_t* pGroupNumbers;
+ uint32_t maxRecursionDepth;
+ VkPipelineLayout layout;
+ VkPipeline basePipelineHandle;
+ int32_t basePipelineIndex;
+} VkRaytracingPipelineCreateInfoNVX;
+
+typedef struct VkGeometryTrianglesNVX {
+ VkStructureType sType;
+ const void* pNext;
+ VkBuffer vertexData;
+ VkDeviceSize vertexOffset;
+ uint32_t vertexCount;
+ VkDeviceSize vertexStride;
+ VkFormat vertexFormat;
+ VkBuffer indexData;
+ VkDeviceSize indexOffset;
+ uint32_t indexCount;
+ VkIndexType indexType;
+ VkBuffer transformData;
+ VkDeviceSize transformOffset;
+} VkGeometryTrianglesNVX;
+
+typedef struct VkGeometryAABBNVX {
+ VkStructureType sType;
+ const void* pNext;
+ VkBuffer aabbData;
+ uint32_t numAABBs;
+ uint32_t stride;
+ VkDeviceSize offset;
+} VkGeometryAABBNVX;
+
+typedef struct VkGeometryDataNVX {
+ VkGeometryTrianglesNVX triangles;
+ VkGeometryAABBNVX aabbs;
+} VkGeometryDataNVX;
+
+typedef struct VkGeometryNVX {
+ VkStructureType sType;
+ const void* pNext;
+ VkGeometryTypeNVX geometryType;
+ VkGeometryDataNVX geometry;
+ VkGeometryFlagsNVX flags;
+} VkGeometryNVX;
+
+typedef struct VkAccelerationStructureCreateInfoNVX {
+ VkStructureType sType;
+ const void* pNext;
+ VkAccelerationStructureTypeNVX type;
+ VkBuildAccelerationStructureFlagsNVX flags;
+ VkDeviceSize compactedSize;
+ uint32_t instanceCount;
+ uint32_t geometryCount;
+ const VkGeometryNVX* pGeometries;
+} VkAccelerationStructureCreateInfoNVX;
+
+typedef struct VkBindAccelerationStructureMemoryInfoNVX {
+ VkStructureType sType;
+ const void* pNext;
+ VkAccelerationStructureNVX accelerationStructure;
+ VkDeviceMemory memory;
+ VkDeviceSize memoryOffset;
+ uint32_t deviceIndexCount;
+ const uint32_t* pDeviceIndices;
+} VkBindAccelerationStructureMemoryInfoNVX;
+
+typedef struct VkDescriptorAccelerationStructureInfoNVX {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t accelerationStructureCount;
+ const VkAccelerationStructureNVX* pAccelerationStructures;
+} VkDescriptorAccelerationStructureInfoNVX;
+
+typedef struct VkAccelerationStructureMemoryRequirementsInfoNVX {
+ VkStructureType sType;
+ const void* pNext;
+ VkAccelerationStructureNVX accelerationStructure;
+} VkAccelerationStructureMemoryRequirementsInfoNVX;
+
+typedef struct VkPhysicalDeviceRaytracingPropertiesNVX {
+ VkStructureType sType;
+ void* pNext;
+ uint32_t shaderHeaderSize;
+ uint32_t maxRecursionDepth;
+ uint32_t maxGeometryCount;
+} VkPhysicalDeviceRaytracingPropertiesNVX;
+
+
+typedef VkResult (VKAPI_PTR *PFN_vkCreateAccelerationStructureNVX)(VkDevice device, const VkAccelerationStructureCreateInfoNVX* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkAccelerationStructureNVX* pAccelerationStructure);
+typedef void (VKAPI_PTR *PFN_vkDestroyAccelerationStructureNVX)(VkDevice device, VkAccelerationStructureNVX accelerationStructure, const VkAllocationCallbacks* pAllocator);
+typedef void (VKAPI_PTR *PFN_vkGetAccelerationStructureMemoryRequirementsNVX)(VkDevice device, const VkAccelerationStructureMemoryRequirementsInfoNVX* pInfo, VkMemoryRequirements2KHR* pMemoryRequirements);
+typedef void (VKAPI_PTR *PFN_vkGetAccelerationStructureScratchMemoryRequirementsNVX)(VkDevice device, const VkAccelerationStructureMemoryRequirementsInfoNVX* pInfo, VkMemoryRequirements2KHR* pMemoryRequirements);
+typedef VkResult (VKAPI_PTR *PFN_vkBindAccelerationStructureMemoryNVX)(VkDevice device, uint32_t bindInfoCount, const VkBindAccelerationStructureMemoryInfoNVX* pBindInfos);
+typedef void (VKAPI_PTR *PFN_vkCmdBuildAccelerationStructureNVX)(VkCommandBuffer commandBuffer, VkAccelerationStructureTypeNVX type, uint32_t instanceCount, VkBuffer instanceData, VkDeviceSize instanceOffset, uint32_t geometryCount, const VkGeometryNVX* pGeometries, VkBuildAccelerationStructureFlagsNVX flags, VkBool32 update, VkAccelerationStructureNVX dst, VkAccelerationStructureNVX src, VkBuffer scratch, VkDeviceSize scratchOffset);
+typedef void (VKAPI_PTR *PFN_vkCmdCopyAccelerationStructureNVX)(VkCommandBuffer commandBuffer, VkAccelerationStructureNVX dst, VkAccelerationStructureNVX src, VkCopyAccelerationStructureModeNVX mode);
+typedef void (VKAPI_PTR *PFN_vkCmdTraceRaysNVX)(VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer, VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer, VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride, VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset, VkDeviceSize hitShaderBindingStride, uint32_t width, uint32_t height);
+typedef VkResult (VKAPI_PTR *PFN_vkCreateRaytracingPipelinesNVX)(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRaytracingPipelineCreateInfoNVX* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines);
+typedef VkResult (VKAPI_PTR *PFN_vkGetRaytracingShaderHandlesNVX)(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void* pData);
+typedef VkResult (VKAPI_PTR *PFN_vkGetAccelerationStructureHandleNVX)(VkDevice device, VkAccelerationStructureNVX accelerationStructure, size_t dataSize, void* pData);
+typedef void (VKAPI_PTR *PFN_vkCmdWriteAccelerationStructurePropertiesNVX)(VkCommandBuffer commandBuffer, VkAccelerationStructureNVX accelerationStructure, VkQueryType queryType, VkQueryPool queryPool, uint32_t query);
+typedef VkResult (VKAPI_PTR *PFN_vkCompileDeferredNVX)(VkDevice device, VkPipeline pipeline, uint32_t shader);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR VkResult VKAPI_CALL vkCreateAccelerationStructureNVX(
+ VkDevice device,
+ const VkAccelerationStructureCreateInfoNVX* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkAccelerationStructureNVX* pAccelerationStructure);
+
+VKAPI_ATTR void VKAPI_CALL vkDestroyAccelerationStructureNVX(
+ VkDevice device,
+ VkAccelerationStructureNVX accelerationStructure,
+ const VkAllocationCallbacks* pAllocator);
+
+VKAPI_ATTR void VKAPI_CALL vkGetAccelerationStructureMemoryRequirementsNVX(
+ VkDevice device,
+ const VkAccelerationStructureMemoryRequirementsInfoNVX* pInfo,
+ VkMemoryRequirements2KHR* pMemoryRequirements);
+
+VKAPI_ATTR void VKAPI_CALL vkGetAccelerationStructureScratchMemoryRequirementsNVX(
+ VkDevice device,
+ const VkAccelerationStructureMemoryRequirementsInfoNVX* pInfo,
+ VkMemoryRequirements2KHR* pMemoryRequirements);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkBindAccelerationStructureMemoryNVX(
+ VkDevice device,
+ uint32_t bindInfoCount,
+ const VkBindAccelerationStructureMemoryInfoNVX* pBindInfos);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdBuildAccelerationStructureNVX(
+ VkCommandBuffer commandBuffer,
+ VkAccelerationStructureTypeNVX type,
+ uint32_t instanceCount,
+ VkBuffer instanceData,
+ VkDeviceSize instanceOffset,
+ uint32_t geometryCount,
+ const VkGeometryNVX* pGeometries,
+ VkBuildAccelerationStructureFlagsNVX flags,
+ VkBool32 update,
+ VkAccelerationStructureNVX dst,
+ VkAccelerationStructureNVX src,
+ VkBuffer scratch,
+ VkDeviceSize scratchOffset);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdCopyAccelerationStructureNVX(
+ VkCommandBuffer commandBuffer,
+ VkAccelerationStructureNVX dst,
+ VkAccelerationStructureNVX src,
+ VkCopyAccelerationStructureModeNVX mode);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdTraceRaysNVX(
+ VkCommandBuffer commandBuffer,
+ VkBuffer raygenShaderBindingTableBuffer,
+ VkDeviceSize raygenShaderBindingOffset,
+ VkBuffer missShaderBindingTableBuffer,
+ VkDeviceSize missShaderBindingOffset,
+ VkDeviceSize missShaderBindingStride,
+ VkBuffer hitShaderBindingTableBuffer,
+ VkDeviceSize hitShaderBindingOffset,
+ VkDeviceSize hitShaderBindingStride,
+ uint32_t width,
+ uint32_t height);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkCreateRaytracingPipelinesNVX(
+ VkDevice device,
+ VkPipelineCache pipelineCache,
+ uint32_t createInfoCount,
+ const VkRaytracingPipelineCreateInfoNVX* pCreateInfos,
+ const VkAllocationCallbacks* pAllocator,
+ VkPipeline* pPipelines);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkGetRaytracingShaderHandlesNVX(
+ VkDevice device,
+ VkPipeline pipeline,
+ uint32_t firstGroup,
+ uint32_t groupCount,
+ size_t dataSize,
+ void* pData);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkGetAccelerationStructureHandleNVX(
+ VkDevice device,
+ VkAccelerationStructureNVX accelerationStructure,
+ size_t dataSize,
+ void* pData);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdWriteAccelerationStructurePropertiesNVX(
+ VkCommandBuffer commandBuffer,
+ VkAccelerationStructureNVX accelerationStructure,
+ VkQueryType queryType,
+ VkQueryPool queryPool,
+ uint32_t query);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkCompileDeferredNVX(
+ VkDevice device,
+ VkPipeline pipeline,
+ uint32_t shader);
+#endif
+
+#define VK_NV_representative_fragment_test 1
+#define VK_NV_REPRESENTATIVE_FRAGMENT_TEST_SPEC_VERSION 1
+#define VK_NV_REPRESENTATIVE_FRAGMENT_TEST_EXTENSION_NAME "VK_NV_representative_fragment_test"
+
+typedef struct VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 representativeFragmentTest;
+} VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV;
+
+typedef struct VkPipelineRepresentativeFragmentTestStateCreateInfoNV {
+ VkStructureType sType;
+ const void* pNext;
+ VkBool32 representativeFragmentTestEnable;
+} VkPipelineRepresentativeFragmentTestStateCreateInfoNV;
+
+
+
#define VK_EXT_global_priority 1
#define VK_EXT_GLOBAL_PRIORITY_SPEC_VERSION 2
#define VK_EXT_GLOBAL_PRIORITY_EXTENSION_NAME "VK_EXT_global_priority"
@@ -7784,6 +8477,46 @@
uint32_t marker);
#endif
+#define VK_EXT_calibrated_timestamps 1
+#define VK_EXT_CALIBRATED_TIMESTAMPS_SPEC_VERSION 1
+#define VK_EXT_CALIBRATED_TIMESTAMPS_EXTENSION_NAME "VK_EXT_calibrated_timestamps"
+
+
+typedef enum VkTimeDomainEXT {
+ VK_TIME_DOMAIN_DEVICE_EXT = 0,
+ VK_TIME_DOMAIN_CLOCK_MONOTONIC_EXT = 1,
+ VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT = 2,
+ VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT = 3,
+ VK_TIME_DOMAIN_BEGIN_RANGE_EXT = VK_TIME_DOMAIN_DEVICE_EXT,
+ VK_TIME_DOMAIN_END_RANGE_EXT = VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT,
+ VK_TIME_DOMAIN_RANGE_SIZE_EXT = (VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT - VK_TIME_DOMAIN_DEVICE_EXT + 1),
+ VK_TIME_DOMAIN_MAX_ENUM_EXT = 0x7FFFFFFF
+} VkTimeDomainEXT;
+
+typedef struct VkCalibratedTimestampInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkTimeDomainEXT timeDomain;
+} VkCalibratedTimestampInfoEXT;
+
+
+typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT)(VkPhysicalDevice physicalDevice, uint32_t* pTimeDomainCount, VkTimeDomainEXT* pTimeDomains);
+typedef VkResult (VKAPI_PTR *PFN_vkGetCalibratedTimestampsEXT)(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoEXT* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(
+ VkPhysicalDevice physicalDevice,
+ uint32_t* pTimeDomainCount,
+ VkTimeDomainEXT* pTimeDomains);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkGetCalibratedTimestampsEXT(
+ VkDevice device,
+ uint32_t timestampCount,
+ const VkCalibratedTimestampInfoEXT* pTimestampInfos,
+ uint64_t* pTimestamps,
+ uint64_t* pMaxDeviation);
+#endif
+
#define VK_AMD_shader_core_properties 1
#define VK_AMD_SHADER_CORE_PROPERTIES_SPEC_VERSION 1
#define VK_AMD_SHADER_CORE_PROPERTIES_EXTENSION_NAME "VK_AMD_shader_core_properties"
@@ -7845,6 +8578,133 @@
#define VK_NV_SHADER_SUBGROUP_PARTITIONED_EXTENSION_NAME "VK_NV_shader_subgroup_partitioned"
+#define VK_NV_compute_shader_derivatives 1
+#define VK_NV_COMPUTE_SHADER_DERIVATIVES_SPEC_VERSION 1
+#define VK_NV_COMPUTE_SHADER_DERIVATIVES_EXTENSION_NAME "VK_NV_compute_shader_derivatives"
+
+typedef struct VkPhysicalDeviceComputeShaderDerivativesFeaturesNV {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 computeDerivativeGroupQuads;
+ VkBool32 computeDerivativeGroupLinear;
+} VkPhysicalDeviceComputeShaderDerivativesFeaturesNV;
+
+
+
+#define VK_NV_mesh_shader 1
+#define VK_NV_MESH_SHADER_SPEC_VERSION 1
+#define VK_NV_MESH_SHADER_EXTENSION_NAME "VK_NV_mesh_shader"
+
+typedef struct VkPhysicalDeviceMeshShaderFeaturesNV {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 taskShader;
+ VkBool32 meshShader;
+} VkPhysicalDeviceMeshShaderFeaturesNV;
+
+typedef struct VkPhysicalDeviceMeshShaderPropertiesNV {
+ VkStructureType sType;
+ void* pNext;
+ uint32_t maxDrawMeshTasksCount;
+ uint32_t maxTaskWorkGroupInvocations;
+ uint32_t maxTaskWorkGroupSize[3];
+ uint32_t maxTaskTotalMemorySize;
+ uint32_t maxTaskOutputCount;
+ uint32_t maxMeshWorkGroupInvocations;
+ uint32_t maxMeshWorkGroupSize[3];
+ uint32_t maxMeshTotalMemorySize;
+ uint32_t maxMeshOutputVertices;
+ uint32_t maxMeshOutputPrimitives;
+ uint32_t maxMeshMultiviewViewCount;
+ uint32_t meshOutputPerVertexGranularity;
+ uint32_t meshOutputPerPrimitiveGranularity;
+} VkPhysicalDeviceMeshShaderPropertiesNV;
+
+typedef struct VkDrawMeshTasksIndirectCommandNV {
+ uint32_t taskCount;
+ uint32_t firstTask;
+} VkDrawMeshTasksIndirectCommandNV;
+
+
+typedef void (VKAPI_PTR *PFN_vkCmdDrawMeshTasksNV)(VkCommandBuffer commandBuffer, uint32_t taskCount, uint32_t firstTask);
+typedef void (VKAPI_PTR *PFN_vkCmdDrawMeshTasksIndirectNV)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride);
+typedef void (VKAPI_PTR *PFN_vkCmdDrawMeshTasksIndirectCountNV)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR void VKAPI_CALL vkCmdDrawMeshTasksNV(
+ VkCommandBuffer commandBuffer,
+ uint32_t taskCount,
+ uint32_t firstTask);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdDrawMeshTasksIndirectNV(
+ VkCommandBuffer commandBuffer,
+ VkBuffer buffer,
+ VkDeviceSize offset,
+ uint32_t drawCount,
+ uint32_t stride);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdDrawMeshTasksIndirectCountNV(
+ VkCommandBuffer commandBuffer,
+ VkBuffer buffer,
+ VkDeviceSize offset,
+ VkBuffer countBuffer,
+ VkDeviceSize countBufferOffset,
+ uint32_t maxDrawCount,
+ uint32_t stride);
+#endif
+
+#define VK_NV_fragment_shader_barycentric 1
+#define VK_NV_FRAGMENT_SHADER_BARYCENTRIC_SPEC_VERSION 1
+#define VK_NV_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME "VK_NV_fragment_shader_barycentric"
+
+typedef struct VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 fragmentShaderBarycentric;
+} VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV;
+
+
+
+#define VK_NV_shader_image_footprint 1
+#define VK_NV_SHADER_IMAGE_FOOTPRINT_SPEC_VERSION 1
+#define VK_NV_SHADER_IMAGE_FOOTPRINT_EXTENSION_NAME "VK_NV_shader_image_footprint"
+
+typedef struct VkPhysicalDeviceShaderImageFootprintFeaturesNV {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 imageFootprint;
+} VkPhysicalDeviceShaderImageFootprintFeaturesNV;
+
+
+
+#define VK_NV_scissor_exclusive 1
+#define VK_NV_SCISSOR_EXCLUSIVE_SPEC_VERSION 1
+#define VK_NV_SCISSOR_EXCLUSIVE_EXTENSION_NAME "VK_NV_scissor_exclusive"
+
+typedef struct VkPipelineViewportExclusiveScissorStateCreateInfoNV {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t exclusiveScissorCount;
+ const VkRect2D* pExclusiveScissors;
+} VkPipelineViewportExclusiveScissorStateCreateInfoNV;
+
+typedef struct VkPhysicalDeviceExclusiveScissorFeaturesNV {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 exclusiveScissor;
+} VkPhysicalDeviceExclusiveScissorFeaturesNV;
+
+
+typedef void (VKAPI_PTR *PFN_vkCmdSetExclusiveScissorNV)(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, uint32_t exclusiveScissorCount, const VkRect2D* pExclusiveScissors);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR void VKAPI_CALL vkCmdSetExclusiveScissorNV(
+ VkCommandBuffer commandBuffer,
+ uint32_t firstExclusiveScissor,
+ uint32_t exclusiveScissorCount,
+ const VkRect2D* pExclusiveScissors);
+#endif
+
#define VK_NV_device_diagnostic_checkpoints 1
#define VK_NV_DEVICE_DIAGNOSTIC_CHECKPOINTS_SPEC_VERSION 2
#define VK_NV_DEVICE_DIAGNOSTIC_CHECKPOINTS_EXTENSION_NAME "VK_NV_device_diagnostic_checkpoints"
@@ -7877,6 +8737,31 @@
VkCheckpointDataNV* pCheckpointData);
#endif
+#define VK_EXT_pci_bus_info 1
+#define VK_EXT_PCI_BUS_INFO_SPEC_VERSION 1
+#define VK_EXT_PCI_BUS_INFO_EXTENSION_NAME "VK_EXT_pci_bus_info"
+
+typedef struct VkPhysicalDevicePCIBusInfoPropertiesEXT {
+ VkStructureType sType;
+ void* pNext;
+ uint16_t pciDomain;
+ uint8_t pciBus;
+ uint8_t pciDevice;
+ uint8_t pciFunction;
+} VkPhysicalDevicePCIBusInfoPropertiesEXT;
+
+
+
+#define VK_GOOGLE_hlsl_functionality1 1
+#define VK_GOOGLE_HLSL_FUNCTIONALITY1_SPEC_VERSION 0
+#define VK_GOOGLE_HLSL_FUNCTIONALITY1_EXTENSION_NAME "VK_GOOGLE_hlsl_functionality1"
+
+
+#define VK_GOOGLE_decorate_string 1
+#define VK_GOOGLE_DECORATE_STRING_SPEC_VERSION 0
+#define VK_GOOGLE_DECORATE_STRING_EXTENSION_NAME "VK_GOOGLE_decorate_string"
+
+
#ifdef __cplusplus
}
#endif
diff --git a/include/vulkan/vulkan_fuchsia.h b/include/vulkan/vulkan_fuchsia.h
new file mode 100644
index 0000000..73a3152
--- /dev/null
+++ b/include/vulkan/vulkan_fuchsia.h
@@ -0,0 +1,139 @@
+#ifndef VULKAN_FUCHSIA_H_
+#define VULKAN_FUCHSIA_H_ 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright (c) 2015-2018 The Khronos Group 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.
+*/
+
+/*
+** This header is generated from the Khronos Vulkan XML API Registry.
+**
+*/
+
+
+#define VK_KHR_external_memory_fuchsia 1
+#define VK_KHR_EXTERNAL_MEMORY_FUCHSIA_SPEC_VERSION 1
+#define VK_KHR_EXTERNAL_MEMORY_FUCHSIA_EXTENSION_NAME "VK_KHR_external_memory_fuchsia"
+
+typedef struct VkImportMemoryFuchsiaHandleInfoKHR {
+ VkStructureType sType;
+ const void* pNext;
+ VkExternalMemoryHandleTypeFlagBits handleType;
+ uint32_t handle;
+} VkImportMemoryFuchsiaHandleInfoKHR;
+
+typedef struct VkMemoryFuchsiaHandlePropertiesKHR {
+ VkStructureType sType;
+ void* pNext;
+ uint32_t memoryTypeBits;
+} VkMemoryFuchsiaHandlePropertiesKHR;
+
+typedef struct VkMemoryGetFuchsiaHandleInfoKHR {
+ VkStructureType sType;
+ const void* pNext;
+ VkDeviceMemory memory;
+ VkExternalMemoryHandleTypeFlagBits handleType;
+} VkMemoryGetFuchsiaHandleInfoKHR;
+
+
+typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryFuchsiaHandleKHR)(VkDevice device, const VkMemoryGetFuchsiaHandleInfoKHR* pGetFuchsiaHandleInfo, uint32_t* pFuchsiaHandle);
+typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryFuchsiaHandlePropertiesKHR)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, uint32_t fuchsiaHandle, VkMemoryFuchsiaHandlePropertiesKHR* pMemoryFuchsiaHandleProperties);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryFuchsiaHandleKHR(
+ VkDevice device,
+ const VkMemoryGetFuchsiaHandleInfoKHR* pGetFuchsiaHandleInfo,
+ uint32_t* pFuchsiaHandle);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryFuchsiaHandlePropertiesKHR(
+ VkDevice device,
+ VkExternalMemoryHandleTypeFlagBits handleType,
+ uint32_t fuchsiaHandle,
+ VkMemoryFuchsiaHandlePropertiesKHR* pMemoryFuchsiaHandleProperties);
+#endif
+
+#define VK_KHR_external_semaphore_fuchsia 1
+#define VK_KHR_EXTERNAL_SEMAPHORE_FUCHSIA_SPEC_VERSION 1
+#define VK_KHR_EXTERNAL_SEMAPHORE_FUCHSIA_EXTENSION_NAME "VK_KHR_external_semaphore_fuchsia"
+
+typedef struct VkImportSemaphoreFuchsiaHandleInfoKHR {
+ VkStructureType sType;
+ const void* pNext;
+ VkSemaphore semaphore;
+ VkSemaphoreImportFlags flags;
+ VkExternalSemaphoreHandleTypeFlagBits handleType;
+ uint32_t handle;
+} VkImportSemaphoreFuchsiaHandleInfoKHR;
+
+typedef struct VkSemaphoreGetFuchsiaHandleInfoKHR {
+ VkStructureType sType;
+ const void* pNext;
+ VkSemaphore semaphore;
+ VkExternalSemaphoreHandleTypeFlagBits handleType;
+} VkSemaphoreGetFuchsiaHandleInfoKHR;
+
+
+typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreFuchsiaHandleKHR)(VkDevice device, const VkImportSemaphoreFuchsiaHandleInfoKHR* pImportSemaphoreFuchsiaHandleInfo);
+typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreFuchsiaHandleKHR)(VkDevice device, const VkSemaphoreGetFuchsiaHandleInfoKHR* pGetFuchsiaHandleInfo, uint32_t* pFuchsiaHandle);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreFuchsiaHandleKHR(
+ VkDevice device,
+ const VkImportSemaphoreFuchsiaHandleInfoKHR* pImportSemaphoreFuchsiaHandleInfo);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreFuchsiaHandleKHR(
+ VkDevice device,
+ const VkSemaphoreGetFuchsiaHandleInfoKHR* pGetFuchsiaHandleInfo,
+ uint32_t* pFuchsiaHandle);
+#endif
+
+#define VK_FUCHSIA_imagepipe_surface 1
+#define VK_FUCHSIA_IMAGEPIPE_SURFACE_SPEC_VERSION 1
+#define VK_FUCHSIA_IMAGEPIPE_SURFACE_EXTENSION_NAME "VK_FUCHSIA_imagepipe_surface"
+
+typedef VkFlags VkImagePipeSurfaceCreateFlagsFUCHSIA;
+
+typedef struct VkImagePipeSurfaceCreateInfoFUCHSIA {
+ VkStructureType sType;
+ const void* pNext;
+ VkImagePipeSurfaceCreateFlagsFUCHSIA flags;
+ zx_handle_t imagePipeHandle;
+} VkImagePipeSurfaceCreateInfoFUCHSIA;
+
+
+typedef VkResult (VKAPI_PTR *PFN_vkCreateImagePipeSurfaceFUCHSIA)(VkInstance instance, const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR VkResult VKAPI_CALL vkCreateImagePipeSurfaceFUCHSIA(
+ VkInstance instance,
+ const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkSurfaceKHR* pSurface);
+#endif
+
+#define VK_GOOGLE_image_usage_scanout 1
+#define VK_GOOGLE_IMAGE_USAGE_SCANOUT_SPEC_VERSION 1
+#define VK_GOOGLE_IMAGE_USAGE_SCANOUT_EXTENSION_NAME "VK_GOOGLE_image_usage_scanout"
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/mesa.gni b/mesa.gni
new file mode 100644
index 0000000..d6f1651
--- /dev/null
+++ b/mesa.gni
@@ -0,0 +1,39 @@
+# Copyright 2018 The Fuchsia Authors
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+import("//garnet/lib/magma/gnbuild/magma.gni")
+
+mesa_build_root="//third_party/mesa"
+
+template("mesa_source_set") {
+ source_set(target_name) {
+ # Can't forward configs because doing so overwrites the default
+ # configs specified by the build system.
+ forward_variables_from(invoker, "*", ["configs"])
+ if (!defined(public_configs)) {
+ public_configs = []
+ }
+ public_configs += [ "//third_party/mesa/src:common_config" ]
+ if (defined(invoker.configs)) {
+ configs += invoker.configs
+ }
+ }
+}
diff --git a/scripts/gn_script_wrapper.py b/scripts/gn_script_wrapper.py
new file mode 100755
index 0000000..cb49150
--- /dev/null
+++ b/scripts/gn_script_wrapper.py
@@ -0,0 +1,12 @@
+#!/usr/bin/env python
+#all this script does is execute the second argument and pipe its output to the file specified by the first argument
+#this is to let GN use the mesa python scripts that generate headers and barf them to stdout
+import subprocess
+import sys
+
+if __name__ == '__main__':
+ f = open(sys.argv[2], 'w')
+ exec_string = "PYTHONPATH=" + sys.argv[1] + " python " + " ".join(sys.argv[3:])
+ child = subprocess.Popen(exec_string, shell=True, stdout=subprocess.PIPE)
+ f.write(child.stdout.read())
+ exit(child.returncode)
\ No newline at end of file
diff --git a/src/BUILD.gn b/src/BUILD.gn
new file mode 100644
index 0000000..ae6b040
--- /dev/null
+++ b/src/BUILD.gn
@@ -0,0 +1,96 @@
+# Copyright 2016 The Fuchsia Authors
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+config("common_config") {
+ mesa_version = read_file("../VERSION", "trim string")
+
+ defines = [
+ "STDC_HEADERS=1",
+ "HAVE_SYS_TYPES_H=1",
+ "HAVE_SYS_STAT_H=1",
+ "HAVE_STDLIB_H=1",
+ "HAVE_STRING_H=1",
+ "HAVE_MEMORY_H=1",
+ "HAVE_STRINGS_H=1",
+ "HAVE_INTTYPES_H=1",
+ "HAVE_STDINT_H=1",
+ "HAVE_TIMESPEC_GET=1",
+ "HAVE_UNISTD_H=1",
+ "HAVE_DLFCN_H=1",
+ "YYTEXT_POINTER=1",
+ "HAVE___BUILTIN_BSWAP32=1",
+ "HAVE___BUILTIN_BSWAP64=1",
+ "HAVE___BUILTIN_CLZ=1",
+ "HAVE___BUILTIN_CLZLL=1",
+ "HAVE___BUILTIN_CTZ=1",
+ "HAVE___BUILTIN_EXPECT=1",
+ "HAVE___BUILTIN_FFS=1",
+ "HAVE___BUILTIN_FFSLL=1",
+ "HAVE___BUILTIN_POPCOUNT=1",
+ "HAVE___BUILTIN_POPCOUNTLL=1",
+ "HAVE___BUILTIN_UNREACHABLE=1",
+ "HAVE_FUNC_ATTRIBUTE_CONST=1",
+ "HAVE_FUNC_ATTRIBUTE_FLATTEN=1",
+ "HAVE_FUNC_ATTRIBUTE_FORMAT=1",
+ "HAVE_FUNC_ATTRIBUTE_MALLOC=1",
+ "HAVE_FUNC_ATTRIBUTE_PACKED=1",
+ "HAVE_FUNC_ATTRIBUTE_PURE=1",
+ "HAVE_FUNC_ATTRIBUTE_UNUSED=1",
+ "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT=1",
+ "HAVE_FUNC_ATTRIBUTE_NORETURN=1",
+ "HAVE_DLADDR=1",
+ "HAVE_CLOCK_GETTIME=1",
+ "PACKAGE_NAME=\"Mesa\" ",
+ "PACKAGE_TARNAME=\"mesa\" ",
+ "PACKAGE_VERSION=\"$mesa_version\" ",
+ "PACKAGE_STRING=\"Mesa $mesa_version\" ",
+ "PACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi\?product=Mesa\" ",
+ "PACKAGE_URL=\"\" ",
+ "PACKAGE=\"mesa\" ",
+ "VERSION=\"$mesa_version\"",
+ "_DEFAULT_SOURCE",
+ ]
+
+ if (is_debug) {
+ defines += [ "DEBUG=1" ]
+ }
+
+ # TODO(MA-18) fix these warnings and remove the -Wno*
+ cflags = [
+ "-Wall",
+ "-Wno-missing-field-initializers",
+ "-Wno-initializer-overrides",
+ "-Wno-sign-compare",
+ "-Wno-overloaded-virtual",
+ "-Wno-absolute-value",
+ "-Wno-missing-braces",
+ "-Wno-unused-function",
+ "-Wno-mismatched-tags",
+ "-Wno-enum-conversion",
+ "-Wno-unused-variable",
+ "-Wno-unused-private-field",
+ "-Wno-sometimes-uninitialized",
+ "-Wno-incompatible-pointer-types-discards-qualifiers",
+ "-Wno-unused-label",
+ "-Wno-switch",
+ "-Wno-gnu-variable-sized-type-not-at-end",
+ ]
+}
diff --git a/src/compiler/BUILD.gn b/src/compiler/BUILD.gn
new file mode 100644
index 0000000..471f610
--- /dev/null
+++ b/src/compiler/BUILD.gn
@@ -0,0 +1,47 @@
+# Copyright 2016 The Fuchsia Authors
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+import("../../mesa.gni")
+
+mesa_source_set("compiler") {
+ sources = [
+ "blob.c",
+ "blob.h",
+ "builtin_type_macros.h",
+ "glsl_types.cpp",
+ "glsl_types.h",
+ "nir_types.cpp",
+ "nir_types.h",
+ "shader_enums.c",
+ "shader_enums.h",
+ ]
+
+ include_dirs = [
+ "$mesa_build_root/src/mesa",
+ "$mesa_build_root/src/mapi",
+ ]
+
+ deps = [
+ "$mesa_build_root/src/util",
+ "glsl:ir_expression_operation",
+ "nir",
+ ]
+}
diff --git a/src/compiler/glsl/BUILD.gn b/src/compiler/glsl/BUILD.gn
new file mode 100644
index 0000000..17145fb
--- /dev/null
+++ b/src/compiler/glsl/BUILD.gn
@@ -0,0 +1,52 @@
+# Copyright 2016 The Fuchsia Authors
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+import("../../../mesa.gni")
+
+action("gen_ir_expression_operation") {
+ output_name = "ir_expression_operation.h"
+ script_name = "ir_expression_operation.py"
+
+ script = "$mesa_build_root/scripts/gn_script_wrapper.py"
+
+ outputs = [
+ "$target_gen_dir/$output_name",
+ ]
+
+ args = [
+ "$magma_python_path",
+ rebase_path("$target_gen_dir") + "/$output_name",
+ rebase_path(".") + "/$script_name",
+ "enum",
+ ]
+}
+
+config("gen_includes") {
+ include_dirs = [ target_gen_dir ]
+}
+
+group("ir_expression_operation") {
+ public_configs = [ ":gen_includes" ]
+
+ deps = [
+ ":gen_ir_expression_operation",
+ ]
+}
diff --git a/src/compiler/glsl/bash_script_wrapper.py b/src/compiler/glsl/bash_script_wrapper.py
new file mode 100755
index 0000000..28da00b
--- /dev/null
+++ b/src/compiler/glsl/bash_script_wrapper.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+# Copyright 2016 The Fuchsia Authors
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+import subprocess
+import sys
+
+if __name__ == '__main__':
+ child = subprocess.Popen(" ".join(sys.argv[1:]), shell=True)
+ exit(child.returncode)
\ No newline at end of file
diff --git a/src/compiler/glsl/generate_parser_and_lexer.sh b/src/compiler/glsl/generate_parser_and_lexer.sh
new file mode 100644
index 0000000..767a630
--- /dev/null
+++ b/src/compiler/glsl/generate_parser_and_lexer.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+# Copyright 2016 The Fuchsia Authors
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+# This script generates the glsl and glcpp lexer and parser
+
+echo "$1"
\ No newline at end of file
diff --git a/src/compiler/glsl/opt_copy_propagation.cpp b/src/compiler/glsl/opt_copy_propagation.cpp
new file mode 100644
index 0000000..206dffe
--- /dev/null
+++ b/src/compiler/glsl/opt_copy_propagation.cpp
@@ -0,0 +1,369 @@
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file opt_copy_propagation.cpp
+ *
+ * Moves usage of recently-copied variables to the previous copy of
+ * the variable.
+ *
+ * This should reduce the number of MOV instructions in the generated
+ * programs unless copy propagation is also done on the LIR, and may
+ * help anyway by triggering other optimizations that live in the HIR.
+ */
+
+#include "ir.h"
+#include "ir_visitor.h"
+#include "ir_basic_block.h"
+#include "ir_optimization.h"
+#include "compiler/glsl_types.h"
+#include "util/hash_table.h"
+#include "util/set.h"
+
+namespace {
+
+class ir_copy_propagation_visitor : public ir_hierarchical_visitor {
+public:
+ ir_copy_propagation_visitor()
+ {
+ progress = false;
+ mem_ctx = ralloc_context(0);
+ lin_ctx = linear_alloc_parent(mem_ctx, 0);
+ acp = _mesa_hash_table_create(mem_ctx, _mesa_hash_pointer,
+ _mesa_key_pointer_equal);
+ kills = _mesa_set_create(mem_ctx, _mesa_hash_pointer,
+ _mesa_key_pointer_equal);
+ killed_all = false;
+ }
+ ~ir_copy_propagation_visitor()
+ {
+ ralloc_free(mem_ctx);
+ }
+
+ virtual ir_visitor_status visit(class ir_dereference_variable *);
+ void handle_loop(class ir_loop *, bool keep_acp);
+ virtual ir_visitor_status visit_enter(class ir_loop *);
+ virtual ir_visitor_status visit_enter(class ir_function_signature *);
+ virtual ir_visitor_status visit_enter(class ir_function *);
+ virtual ir_visitor_status visit_leave(class ir_assignment *);
+ virtual ir_visitor_status visit_enter(class ir_call *);
+ virtual ir_visitor_status visit_enter(class ir_if *);
+
+ void add_copy(ir_assignment *ir);
+ void kill(ir_variable *ir);
+ void handle_if_block(exec_list *instructions);
+
+ /** Hash of lhs->rhs: The available copies to propagate */
+ hash_table *acp;
+
+ /**
+ * Set of ir_variables: Whose values were killed in this block.
+ */
+ set *kills;
+
+ bool progress;
+
+ bool killed_all;
+
+ void *mem_ctx;
+ void *lin_ctx;
+};
+
+} /* unnamed namespace */
+
+ir_visitor_status
+ir_copy_propagation_visitor::visit_enter(ir_function_signature *ir)
+{
+ /* Treat entry into a function signature as a completely separate
+ * block. Any instructions at global scope will be shuffled into
+ * main() at link time, so they're irrelevant to us.
+ */
+ hash_table *orig_acp = this->acp;
+ set *orig_kills = this->kills;
+ bool orig_killed_all = this->killed_all;
+
+ acp = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
+ _mesa_key_pointer_equal);
+ kills = _mesa_set_create(NULL, _mesa_hash_pointer,
+ _mesa_key_pointer_equal);
+ this->killed_all = false;
+
+ visit_list_elements(this, &ir->body);
+
+ _mesa_hash_table_destroy(acp, NULL);
+ _mesa_set_destroy(kills, NULL);
+
+ this->kills = orig_kills;
+ this->acp = orig_acp;
+ this->killed_all = orig_killed_all;
+
+ return visit_continue_with_parent;
+}
+
+ir_visitor_status
+ir_copy_propagation_visitor::visit_leave(ir_assignment *ir)
+{
+ kill(ir->lhs->variable_referenced());
+
+ add_copy(ir);
+
+ return visit_continue;
+}
+
+ir_visitor_status
+ir_copy_propagation_visitor::visit_enter(ir_function *ir)
+{
+ (void) ir;
+ return visit_continue;
+}
+
+/**
+ * Replaces dereferences of ACP RHS variables with ACP LHS variables.
+ *
+ * This is where the actual copy propagation occurs. Note that the
+ * rewriting of ir_dereference means that the ir_dereference instance
+ * must not be shared by multiple IR operations!
+ */
+ir_visitor_status
+ir_copy_propagation_visitor::visit(ir_dereference_variable *ir)
+{
+ if (this->in_assignee)
+ return visit_continue;
+
+ struct hash_entry *entry = _mesa_hash_table_search(acp, ir->var);
+ if (entry) {
+ ir->var = (ir_variable *) entry->data;
+ progress = true;
+ }
+
+ return visit_continue;
+}
+
+
+ir_visitor_status
+ir_copy_propagation_visitor::visit_enter(ir_call *ir)
+{
+ /* Do copy propagation on call parameters, but skip any out params */
+ foreach_two_lists(formal_node, &ir->callee->parameters,
+ actual_node, &ir->actual_parameters) {
+ ir_variable *sig_param = (ir_variable *) formal_node;
+ ir_rvalue *ir = (ir_rvalue *) actual_node;
+ if (sig_param->data.mode != ir_var_function_out
+ && sig_param->data.mode != ir_var_function_inout) {
+ ir->accept(this);
+ }
+ }
+
+ /* Since this pass can run when unlinked, we don't (necessarily) know
+ * the side effects of calls. (When linked, most calls are inlined
+ * anyway, so it doesn't matter much.)
+ *
+ * One place where this does matter is IR intrinsics. They're never
+ * inlined. We also know what they do - while some have side effects
+ * (such as image writes), none edit random global variables. So we
+ * can assume they're side-effect free (other than the return value
+ * and out parameters).
+ */
+ if (!ir->callee->is_intrinsic()) {
+ _mesa_hash_table_clear(acp, NULL);
+ this->killed_all = true;
+ } else {
+ if (ir->return_deref)
+ kill(ir->return_deref->var);
+
+ foreach_two_lists(formal_node, &ir->callee->parameters,
+ actual_node, &ir->actual_parameters) {
+ ir_variable *sig_param = (ir_variable *) formal_node;
+ if (sig_param->data.mode == ir_var_function_out ||
+ sig_param->data.mode == ir_var_function_inout) {
+ ir_rvalue *ir = (ir_rvalue *) actual_node;
+ ir_variable *var = ir->variable_referenced();
+ kill(var);
+ }
+ }
+ }
+
+ return visit_continue_with_parent;
+}
+
+void
+ir_copy_propagation_visitor::handle_if_block(exec_list *instructions)
+{
+ hash_table *orig_acp = this->acp;
+ set *orig_kills = this->kills;
+ bool orig_killed_all = this->killed_all;
+
+ kills = _mesa_set_create(NULL, _mesa_hash_pointer,
+ _mesa_key_pointer_equal);
+ this->killed_all = false;
+
+ /* Populate the initial acp with a copy of the original */
+ acp = _mesa_hash_table_clone(orig_acp, NULL);
+
+ visit_list_elements(this, instructions);
+
+ if (this->killed_all) {
+ _mesa_hash_table_clear(orig_acp, NULL);
+ }
+
+ set *new_kills = this->kills;
+ this->kills = orig_kills;
+ _mesa_hash_table_destroy(acp, NULL);
+ this->acp = orig_acp;
+ this->killed_all = this->killed_all || orig_killed_all;
+
+ struct set_entry *s_entry;
+ set_foreach(new_kills, s_entry) {
+ kill((ir_variable *) s_entry->key);
+ }
+
+ _mesa_set_destroy(new_kills, NULL);
+}
+
+ir_visitor_status
+ir_copy_propagation_visitor::visit_enter(ir_if *ir)
+{
+ ir->condition->accept(this);
+
+ handle_if_block(&ir->then_instructions);
+ handle_if_block(&ir->else_instructions);
+
+ /* handle_if_block() already descended into the children. */
+ return visit_continue_with_parent;
+}
+
+void
+ir_copy_propagation_visitor::handle_loop(ir_loop *ir, bool keep_acp)
+{
+ hash_table *orig_acp = this->acp;
+ set *orig_kills = this->kills;
+ bool orig_killed_all = this->killed_all;
+
+ kills = _mesa_set_create(NULL, _mesa_hash_pointer,
+ _mesa_key_pointer_equal);
+ this->killed_all = false;
+
+ if (keep_acp) {
+ acp = _mesa_hash_table_clone(orig_acp, NULL);
+ } else {
+ acp = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
+ _mesa_key_pointer_equal);
+ }
+
+ visit_list_elements(this, &ir->body_instructions);
+
+ if (this->killed_all) {
+ _mesa_hash_table_clear(orig_acp, NULL);
+ }
+
+ set *new_kills = this->kills;
+ this->kills = orig_kills;
+ _mesa_hash_table_destroy(acp, NULL);
+ this->acp = orig_acp;
+ this->killed_all = this->killed_all || orig_killed_all;
+
+ struct set_entry *entry;
+ set_foreach(new_kills, entry) {
+ kill((ir_variable *) entry->key);
+ }
+
+ _mesa_set_destroy(new_kills, NULL);
+}
+
+ir_visitor_status
+ir_copy_propagation_visitor::visit_enter(ir_loop *ir)
+{
+ /* Make a conservative first pass over the loop with an empty ACP set.
+ * This also removes any killed entries from the original ACP set.
+ */
+ handle_loop(ir, false);
+
+ /* Then, run it again with the real ACP set, minus any killed entries.
+ * This takes care of propagating values from before the loop into it.
+ */
+ handle_loop(ir, true);
+
+ /* already descended into the children. */
+ return visit_continue_with_parent;
+}
+
+void
+ir_copy_propagation_visitor::kill(ir_variable *var)
+{
+ assert(var != NULL);
+
+ /* Remove any entries currently in the ACP for this kill. */
+ struct hash_entry *entry = _mesa_hash_table_search(acp, var);
+ if (entry) {
+ _mesa_hash_table_remove(acp, entry);
+ }
+
+ hash_table_foreach(acp, entry) {
+ if (var == (ir_variable *) entry->data) {
+ _mesa_hash_table_remove(acp, entry);
+ }
+ }
+
+ /* Add the LHS variable to the set of killed variables in this block. */
+ _mesa_set_add(kills, var);
+}
+
+/**
+ * Adds an entry to the available copy list if it's a plain assignment
+ * of a variable to a variable.
+ */
+void
+ir_copy_propagation_visitor::add_copy(ir_assignment *ir)
+{
+ if (ir->condition)
+ return;
+
+ ir_variable *lhs_var = ir->whole_variable_written();
+ ir_variable *rhs_var = ir->rhs->whole_variable_referenced();
+
+ /* Don't try to remove a dumb assignment of a variable to itself. Removing
+ * it now would mess up the loop iteration calling us.
+ */
+ if (lhs_var != NULL && rhs_var != NULL && lhs_var != rhs_var) {
+ if (lhs_var->data.mode != ir_var_shader_storage &&
+ lhs_var->data.mode != ir_var_shader_shared &&
+ rhs_var->data.mode != ir_var_shader_storage &&
+ rhs_var->data.mode != ir_var_shader_shared &&
+ lhs_var->data.precise == rhs_var->data.precise) {
+ _mesa_hash_table_insert(acp, lhs_var, rhs_var);
+ }
+ }
+}
+
+/**
+ * Does a copy propagation pass on the code present in the instruction stream.
+ */
+bool
+do_copy_propagation(exec_list *instructions)
+{
+ ir_copy_propagation_visitor v;
+
+ visit_list_elements(&v, instructions);
+
+ return v.progress;
+}
diff --git a/src/compiler/nir/BUILD.gn b/src/compiler/nir/BUILD.gn
new file mode 100644
index 0000000..6ec36c1
--- /dev/null
+++ b/src/compiler/nir/BUILD.gn
@@ -0,0 +1,346 @@
+# Copyright 2016 The Fuchsia Authors
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+import("../../../mesa.gni")
+
+config("nir_public_config") {
+ include_dirs = [ "." ]
+}
+
+mesa_source_set("nir") {
+ public_configs = [
+ ":nir_public_config",
+ ]
+
+ public_deps = [
+ ":gen",
+ ]
+
+ deps = [
+ ":nir_compiler_workaround",
+ "$mesa_build_root/include:c_compat",
+ "$mesa_build_root/src/compiler/glsl:ir_expression_operation",
+ "$mesa_build_root/src/util",
+ ]
+
+ include_dirs = [
+ "..",
+ "$mesa_build_root/src/mapi",
+ "$mesa_build_root/src/mesa",
+ ]
+
+ sources = [
+ "nir.c",
+ "nir.h",
+ "nir_builder.h",
+ "nir_builtin_builder.c",
+ "nir_clone.c",
+ "nir_constant_expressions.h",
+ "nir_control_flow.c",
+ "nir_control_flow.h",
+ "nir_control_flow_private.h",
+ "nir_deref.c",
+ "nir_dominance.c",
+ "nir_from_ssa.c",
+ "nir_gather_info.c",
+ "nir_gs_count_vertices.c",
+ "nir_inline_functions.c",
+ "nir_instr_set.c",
+ "nir_instr_set.h",
+ "nir_linking_helpers.c",
+ "nir_liveness.c",
+ "nir_loop_analyze.c",
+ "nir_lower_alu_to_scalar.c",
+ "nir_lower_bit_size.c",
+ "nir_lower_clip.c",
+ "nir_lower_clip_cull_distance_arrays.c",
+ "nir_lower_constant_initializers.c",
+ "nir_lower_double_ops.c",
+ "nir_lower_global_vars_to_local.c",
+ "nir_lower_gs_intrinsics.c",
+ "nir_lower_idiv.c",
+ "nir_lower_indirect_derefs.c",
+ "nir_lower_int64.c",
+ "nir_lower_io.c",
+ "nir_lower_io_arrays_to_elements.c",
+ "nir_lower_io_to_temporaries.c",
+ "nir_lower_load_const_to_scalar.c",
+ "nir_lower_locals_to_regs.c",
+ "nir_lower_packing.c",
+ "nir_lower_patch_vertices.c",
+ "nir_lower_phis_to_scalar.c",
+ "nir_lower_regs_to_ssa.c",
+ "nir_lower_returns.c",
+ "nir_lower_subgroups.c",
+ "nir_lower_system_values.c",
+ "nir_lower_tex.c",
+ "nir_lower_to_source_mods.c",
+ "nir_lower_two_sided_color.c",
+ "nir_lower_var_copies.c",
+ "nir_lower_vars_to_ssa.c",
+ "nir_lower_vec_to_movs.c",
+ "nir_lower_wpos_center.c",
+ "nir_metadata.c",
+ "nir_move_vec_src_uses_to_dest.c",
+ "nir_normalize_cubemap_coords.c",
+ "nir_opt_constant_folding.c",
+ "nir_opt_copy_prop_vars.c",
+ "nir_opt_copy_propagate.c",
+ "nir_opt_cse.c",
+ "nir_opt_dce.c",
+ "nir_opt_dead_cf.c",
+ "nir_opt_gcm.c",
+ "nir_opt_global_to_local.c",
+ "nir_opt_if.c",
+ "nir_opt_intrinsics.c",
+ "nir_opt_large_constants.c",
+ "nir_opt_loop_unroll.c",
+ "nir_opt_move_comparisons.c",
+ "nir_opt_peephole_select.c",
+ "nir_opt_remove_phis.c",
+ "nir_opt_trivial_continues.c",
+ "nir_opt_undef.c",
+ "nir_phi_builder.c",
+ "nir_print.c",
+ "nir_propagate_invariant.c",
+ "nir_remove_dead_variables.c",
+ "nir_repair_ssa.c",
+ "nir_search.c",
+ "nir_search.h",
+ "nir_serialize.c",
+ "nir_split_per_member_structs.c",
+ "nir_split_var_copies.c",
+ "nir_sweep.c",
+ "nir_to_lcssa.c",
+ "nir_validate.c",
+ "nir_vla.h",
+ "nir_worklist.c",
+ "nir_worklist.h",
+ ]
+}
+
+# With -O2 this file causes an infinite loop with clang 3.9.0
+mesa_source_set("nir_compiler_workaround") {
+ sources = [
+ "nir_lower_wpos_ytransform.c",
+ ]
+
+ cflags_c = [ "-O1" ]
+
+ include_dirs = [ "$mesa_build_root/src/mesa" ]
+
+ deps = [
+ ":gen",
+ "$mesa_build_root/src/util",
+ ]
+}
+
+group("nir_headers") {
+ public_configs = [ ":nir_public_config" ]
+
+ public_deps = [
+ ":gen",
+ ]
+}
+
+action("nir_opcodes") {
+ output_name = "nir_opcodes.h"
+ script_name = "nir_opcodes_h.py"
+
+ script = "$mesa_build_root/scripts/gn_script_wrapper.py"
+
+ outputs = [
+ "$target_gen_dir/$output_name",
+ ]
+
+ inputs = [
+ "nir_opcodes.py",
+ script_name,
+ ]
+
+ args = [
+ "$magma_python_path",
+ rebase_path(target_gen_dir) + "/$output_name",
+ rebase_path(".") + "/$script_name",
+ ]
+}
+
+action("nir_builder_opcodes") {
+ output_name = "nir_builder_opcodes.h"
+ script_name = "nir_builder_opcodes_h.py"
+
+ script = "$mesa_build_root/scripts/gn_script_wrapper.py"
+
+ outputs = [
+ "$target_gen_dir/$output_name",
+ ]
+
+ inputs = [
+ "nir_opcodes.py",
+ script_name,
+ ]
+
+ args = [
+ "$magma_python_path",
+ rebase_path(target_gen_dir) + "/$output_name",
+ rebase_path(".") + "/$script_name",
+ ]
+}
+
+action("nir_constant_expressions") {
+ output_name = "nir_constant_expressions.c"
+ script_name = "nir_constant_expressions.py"
+
+ script = "$mesa_build_root/scripts/gn_script_wrapper.py"
+
+ outputs = [
+ "$target_gen_dir/$output_name",
+ ]
+
+ inputs = [
+ "nir_opcodes.py",
+ script_name,
+ ]
+
+ args = [
+ "$magma_python_path",
+ rebase_path(target_gen_dir) + "/$output_name",
+ rebase_path(".") + "/$script_name",
+ ]
+}
+
+action("nir_opcodes_c") {
+ output_name = "nir_opcodes.c"
+ script_name = "nir_opcodes_c.py"
+
+ script = "$mesa_build_root/scripts/gn_script_wrapper.py"
+
+ outputs = [
+ "$target_gen_dir/$output_name",
+ ]
+
+ inputs = [
+ "nir_opcodes.py",
+ script_name,
+ ]
+
+ args = [
+ "$magma_python_path",
+ rebase_path(target_gen_dir) + "/$output_name",
+ rebase_path(".") + "/$script_name",
+ ]
+}
+
+action("nir_opt_algebraic") {
+ output_name = "nir_opt_algebraic.c"
+ script_name = "nir_opt_algebraic.py"
+
+ script = "$mesa_build_root/scripts/gn_script_wrapper.py"
+
+ outputs = [
+ "$target_gen_dir/$output_name",
+ ]
+
+ inputs = [
+ "nir_algebraic.py",
+ script_name,
+ ]
+
+ args = [
+ "$magma_python_path",
+ rebase_path(target_gen_dir) + "/$output_name",
+ rebase_path(".") + "/$script_name",
+ ]
+}
+
+action("nir_intrinsics_h") {
+ output_name = "nir_intrinsics.h"
+ script = "nir_intrinsics_h.py"
+
+ outputs = [
+ "$target_gen_dir/$output_name",
+ ]
+
+ inputs = [
+ "nir_intrinsics_h.py",
+ "nir_intrinsics.py",
+ ]
+
+ args = [
+ "--pythonpath",
+ "$magma_python_path",
+ "--outdir",
+ rebase_path(target_gen_dir),
+ ]
+}
+
+action("nir_intrinsics_c") {
+ output_name = "nir_intrinsics.c"
+ script = "nir_intrinsics_c.py"
+
+ outputs = [
+ "$target_gen_dir/$output_name",
+ ]
+
+ inputs = [
+ "nir_intrinsics_c.py",
+ "nir_intrinsics.py",
+ ]
+
+ args = [
+ "--pythonpath",
+ "$magma_python_path",
+ "--outdir",
+ rebase_path(target_gen_dir),
+ ]
+}
+
+config("gen_public_config") {
+ include_dirs = [ target_gen_dir ]
+}
+
+mesa_source_set("gen") {
+ public_configs = [ ":gen_public_config" ]
+
+ public_deps = [
+ ":nir_builder_opcodes",
+ ":nir_constant_expressions",
+ ":nir_intrinsics_c",
+ ":nir_intrinsics_h",
+ ":nir_opcodes",
+ ":nir_opcodes_c",
+ ":nir_opt_algebraic",
+ "$mesa_build_root/src/util",
+ ]
+
+ include_dirs = [
+ "$mesa_build_root/src/mesa",
+ "$mesa_build_root/src/mapi",
+ ".",
+ ]
+
+ sources = [
+ "$target_gen_dir/nir_constant_expressions.c",
+ "$target_gen_dir/nir_intrinsics.c",
+ "$target_gen_dir/nir_opcodes.c",
+ "$target_gen_dir/nir_opt_algebraic.c",
+ ]
+}
diff --git a/src/compiler/nir/nir_intrinsics_c.py b/src/compiler/nir/nir_intrinsics_c.py
old mode 100644
new mode 100755
index 98af67c..ccf0a03
--- a/src/compiler/nir/nir_intrinsics_c.py
+++ b/src/compiler/nir/nir_intrinsics_c.py
@@ -1,4 +1,4 @@
-
+#!/usr/bin/env python
template = """\
/* Copyright (C) 2018 Red Hat
*
@@ -50,6 +50,11 @@
};
"""
+import sys
+
+# --pythonpath must be the first argument
+sys.path.append(sys.argv[2])
+
from nir_intrinsics import INTR_OPCODES
from mako.template import Template
import argparse
@@ -57,6 +62,7 @@
def main():
parser = argparse.ArgumentParser()
+ parser.add_argument('--pythonpath')
parser.add_argument('--outdir', required=True,
help='Directory to put the generated files in')
diff --git a/src/compiler/nir/nir_intrinsics_h.py b/src/compiler/nir/nir_intrinsics_h.py
old mode 100644
new mode 100755
index 8a4f0d5..7431128
--- a/src/compiler/nir/nir_intrinsics_h.py
+++ b/src/compiler/nir/nir_intrinsics_h.py
@@ -1,4 +1,4 @@
-
+#!/usr/bin/env python
template = """\
/* Copyright (C) 2018 Red Hat
*
@@ -38,6 +38,11 @@
#endif /* _NIR_INTRINSICS_ */"""
+import sys
+
+# --pythonpath must be the first argument
+sys.path.append(sys.argv[2])
+
from nir_intrinsics import INTR_OPCODES
from mako.template import Template
import argparse
@@ -46,6 +51,7 @@
def main():
parser = argparse.ArgumentParser()
+ parser.add_argument('--pythonpath')
parser.add_argument('--outdir', required=True,
help='Directory to put the generated files in')
diff --git a/src/compiler/spirv/BUILD.gn b/src/compiler/spirv/BUILD.gn
new file mode 100644
index 0000000..b8c0b8b
--- /dev/null
+++ b/src/compiler/spirv/BUILD.gn
@@ -0,0 +1,97 @@
+# Copyright 2016 The Fuchsia Authors
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+import("../../../mesa.gni")
+
+config("spirv_public_config") {
+ include_dirs = [ "." ]
+}
+
+mesa_source_set("spirv") {
+ public_configs = [
+ ":spirv_public_config",
+ ]
+
+ deps = [
+ ":spirv_info",
+ ":vtn_gather_types",
+ "$mesa_build_root/include:c_compat",
+ "$mesa_build_root/src/compiler/nir",
+ "$mesa_build_root/src/util",
+ ]
+
+ include_dirs = [ ".." ]
+
+ sources = [
+ "$target_gen_dir/spirv_info.c",
+ "$target_gen_dir/vtn_gather_types.c",
+ "spirv_to_nir.c",
+ "vtn_alu.c",
+ "vtn_amd.c",
+ "vtn_cfg.c",
+ "vtn_glsl450.c",
+ "vtn_private.h",
+ "vtn_subgroup.c",
+ "vtn_variables.c",
+ ]
+}
+
+action("spirv_info") {
+ output_name = "spirv_info.c"
+ script_name = "spirv_info_c.py"
+
+ script = "$mesa_build_root/scripts/gn_script_wrapper.py"
+
+ outputs = [
+ "$target_gen_dir/$output_name",
+ ]
+
+ inputs = [
+ "spirv.core.grammar.json",
+ script_name,
+ ]
+
+ args = [
+ "$magma_python_path",
+ rebase_path(target_gen_dir) + "/stdout",
+ rebase_path(".") + "/$script_name",
+ rebase_path(".") + "/spirv.core.grammar.json",
+ rebase_path(target_gen_dir) + "/$output_name",
+ ]
+}
+
+action("vtn_gather_types") {
+ output_name = "vtn_gather_types.c"
+ script_name = "vtn_gather_types_c.py"
+ script = "$mesa_build_root/scripts/gn_script_wrapper.py"
+ outputs = [ "$target_gen_dir/$output_name" ]
+ inputs = [
+ "spirv.core.grammar.json",
+ script_name,
+ ]
+ args = [
+ "$magma_python_path",
+ rebase_path(target_gen_dir) + "/stdout",
+ rebase_path(".") + "/$script_name",
+ rebase_path(".") + "/spirv.core.grammar.json",
+ rebase_path(target_gen_dir) + "/$output_name",
+ ]
+}
diff --git a/src/intel/BUILD.gn b/src/intel/BUILD.gn
new file mode 100644
index 0000000..8ad855a
--- /dev/null
+++ b/src/intel/BUILD.gn
@@ -0,0 +1,212 @@
+# Copyright 2016 The Fuchsia Authors
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+import("../../mesa.gni")
+
+config("intel_config") {
+ include_dirs = [
+ "$mesa_build_root/src/intel",
+ "$mesa_build_root/src/intel/isl",
+ ]
+}
+
+mesa_source_set("isl") {
+ public_configs = [ ":intel_config" ]
+
+ sources = [
+ "$target_gen_dir/isl_format_layout.c",
+ "isl/isl.c",
+ "isl/isl.h",
+ "isl/isl_drm.c",
+ "isl/isl_format.c",
+ "isl/isl_gen4.c",
+ "isl/isl_gen4.h",
+ "isl/isl_gen6.c",
+ "isl/isl_gen6.h",
+ "isl/isl_priv.h",
+ "isl/isl_storage_image.c",
+ ]
+
+ include_dirs = [
+ "$mesa_build_root/src/mesa",
+ "$mesa_build_root/src/mapi",
+ "$mesa_build_root/include/drm-uapi",
+ ]
+
+ deps = [
+ ":gen_format_layout",
+ ":genxml",
+ ":isl_gen7",
+ ":isl_gen75",
+ ":isl_gen8",
+ ":isl_gen9",
+ ":isl_gen10",
+ ":isl_gen11",
+ "$mesa_build_root/include:c_compat",
+ "$mesa_build_root/src/util",
+ ]
+}
+
+mesa_source_set("isl_gen7") {
+ configs = [ ":intel_config" ]
+
+ sources = [
+ "isl/isl_emit_depth_stencil.c",
+ "isl/isl_gen7.c",
+ "isl/isl_gen7.h",
+ "isl/isl_surface_state.c",
+ ]
+
+ defines = [ "GEN_VERSIONx10=70" ]
+
+ deps = [
+ ":genxml",
+ "$mesa_build_root/include:c_compat",
+ "$mesa_build_root/src/util",
+ ]
+}
+
+mesa_source_set("isl_gen75") {
+ configs = [ ":intel_config" ]
+
+ sources = [
+ "isl/isl_emit_depth_stencil.c",
+ "isl/isl_surface_state.c",
+ ]
+
+ defines = [ "GEN_VERSIONx10=75" ]
+
+ deps = [
+ ":genxml",
+ "$mesa_build_root/include:c_compat",
+ "$mesa_build_root/src/util",
+ ]
+}
+
+mesa_source_set("isl_gen8") {
+ configs = [ ":intel_config" ]
+
+ sources = [
+ "isl/isl_emit_depth_stencil.c",
+ "isl/isl_gen8.c",
+ "isl/isl_gen8.h",
+ "isl/isl_surface_state.c",
+ ]
+
+ defines = [ "GEN_VERSIONx10=80" ]
+
+ deps = [
+ ":genxml",
+ "$mesa_build_root/include:c_compat",
+ "$mesa_build_root/src/util",
+ ]
+}
+
+mesa_source_set("isl_gen9") {
+ configs = [ ":intel_config" ]
+
+ sources = [
+ "isl/isl_emit_depth_stencil.c",
+ "isl/isl_gen9.c",
+ "isl/isl_gen9.h",
+ "isl/isl_surface_state.c",
+ ]
+
+ defines = [ "GEN_VERSIONx10=90" ]
+
+ deps = [
+ ":genxml",
+ "$mesa_build_root/include:c_compat",
+ "$mesa_build_root/src/util",
+ ]
+}
+
+mesa_source_set("isl_gen10") {
+ configs = [ ":intel_config" ]
+
+ sources = [
+ "isl/isl_emit_depth_stencil.c",
+ "isl/isl_surface_state.c",
+ ]
+
+ defines = [ "GEN_VERSIONx10=100" ]
+
+ deps = [
+ ":genxml",
+ "$mesa_build_root/include:c_compat",
+ "$mesa_build_root/src/util",
+ ]
+}
+
+mesa_source_set("isl_gen11") {
+ configs = [ ":intel_config" ]
+
+ sources = [
+ "isl/isl_emit_depth_stencil.c",
+ "isl/isl_surface_state.c",
+ ]
+
+ defines = [ "GEN_VERSIONx10=110" ]
+
+ deps = [
+ ":genxml",
+ "$mesa_build_root/include:c_compat",
+ "$mesa_build_root/src/util",
+ ]
+}
+
+config("gen_public_config") {
+ include_dirs = [ "$target_gen_dir" ]
+}
+
+group("genxml") {
+ public_configs = [ ":gen_public_config" ]
+ deps = [
+ "genxml:gen_pack75_header",
+ "genxml:gen_pack7_header",
+ "genxml:gen_pack8_header",
+ "genxml:gen_pack9_header",
+ "genxml:gen_pack10_header",
+ "genxml:gen_pack11_header",
+ "genxml:gen_bits_header",
+ ]
+}
+
+action("gen_format_layout") {
+ output_name = "isl_format_layout.c"
+ script = "isl/gen_format_layout.py"
+
+ outputs = [
+ "$target_gen_dir/$output_name",
+ ]
+
+ inputs = [
+ "isl/isl_format_layout.csv",
+ ]
+
+ args = [ "--pythonpath", "$magma_python_path" ]
+ args += [ "--csv" ]
+ args += rebase_path(inputs, root_build_dir)
+ args += [
+ "--out",
+ rebase_path("$target_gen_dir") + "/$output_name",
+ ]
+}
diff --git a/src/intel/blorp/BUILD.gn b/src/intel/blorp/BUILD.gn
new file mode 100644
index 0000000..29aa68b
--- /dev/null
+++ b/src/intel/blorp/BUILD.gn
@@ -0,0 +1,51 @@
+# Copyright 2017 The Fuchsia Authors
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+import("../../../mesa.gni")
+
+config("local_config") {
+ include_dirs = [
+ "$mesa_build_root/src/mesa", # for program/
+ "$mesa_build_root/src", # for compiler/
+ ]
+}
+
+mesa_source_set("blorp") {
+ public_deps = [
+ "$mesa_build_root/src/compiler/nir",
+ ]
+
+ public_configs = [ ":local_config" ]
+
+ deps = [
+ "$mesa_build_root/include:c_compat",
+ "$mesa_build_root/src/intel/compiler",
+ "$mesa_build_root/src/util:headers",
+ ]
+
+ sources = [
+ "blorp.c",
+ "blorp_blit.c",
+ "blorp_clear.c",
+ "blorp_genX_exec.h",
+ "blorp_priv.h",
+ ]
+}
diff --git a/src/intel/common/BUILD.gn b/src/intel/common/BUILD.gn
new file mode 100644
index 0000000..3991715
--- /dev/null
+++ b/src/intel/common/BUILD.gn
@@ -0,0 +1,51 @@
+# Copyright 2017 The Fuchsia Authors
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+import("../../../mesa.gni")
+
+config("common_config") {
+ include_dirs = [
+ ".",
+ "..",
+ "$mesa_build_root/src/mapi",
+ ]
+}
+
+mesa_source_set("common") {
+ sources = [
+ "gen_debug.c",
+ "gen_debug.h",
+ "gen_l3_config.c",
+ "gen_l3_config.h",
+ "gen_sample_positions.h",
+ "gen_urb_config.c",
+ "intel_log.c",
+ "intel_log.h",
+ ]
+
+ public_configs = [ ":common_config" ]
+
+ include_dirs = [ "$mesa_build_root/src/mesa" ]
+
+ deps = [
+ "$mesa_build_root/src/util",
+ ]
+}
diff --git a/src/intel/common/gen_clflush.h b/src/intel/common/gen_clflush.h
index d39f158..806564f 100644
--- a/src/intel/common/gen_clflush.h
+++ b/src/intel/common/gen_clflush.h
@@ -30,8 +30,8 @@
static inline void
gen_clflush_range(void *start, size_t size)
{
- void *p = (void *) (((uintptr_t) start) & ~CACHELINE_MASK);
- void *end = start + size;
+ char *p = (char *) (((uintptr_t) start) & ~CACHELINE_MASK);
+ char *end = (char*) start + size;
while (p < end) {
__builtin_ia32_clflush(p);
@@ -61,7 +61,7 @@
* ("drm: Restore double clflush on the last partial cacheline")
* and https://bugs.freedesktop.org/show_bug.cgi?id=92845.
*/
- __builtin_ia32_clflush(start + size - 1);
+ __builtin_ia32_clflush((char*) start + size - 1);
__builtin_ia32_mfence();
}
diff --git a/src/intel/compiler/BUILD.gn b/src/intel/compiler/BUILD.gn
new file mode 100644
index 0000000..8059282
--- /dev/null
+++ b/src/intel/compiler/BUILD.gn
@@ -0,0 +1,164 @@
+# Copyright 2017 The Fuchsia Authors
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+import("../../../mesa.gni")
+
+config("compiler_config") {
+ include_dirs = [
+ ".",
+ "$mesa_build_root/src/mesa", # because brw_compiler.h includes main/mtypes.h
+ "$mesa_build_root/src/gallium/auxiliary", # because main/macros.h includes gallium/auxiliary/util/u_math.h
+ "$mesa_build_root/src/gallium/include", # because u_math.h includes pipe/p_compiler.h
+ "$mesa_build_root/src/intel", # because brw_compiler.h includes common/gen_device_info.h
+ ]
+}
+
+mesa_source_set("compiler") {
+ public_configs = [
+ ":compiler_config",
+ ]
+
+ deps = [
+ ":gen_brw_nir_trig_workarounds",
+ "$mesa_build_root/include:c_compat",
+ "$mesa_build_root/src/compiler",
+ "$mesa_build_root/src/compiler/glsl:ir_expression_operation",
+ "$mesa_build_root/src/compiler/nir",
+ "$mesa_build_root/src/intel:isl",
+ "$mesa_build_root/src/util",
+ ]
+
+ sources = [
+ "$target_gen_dir/brw_nir_trig_workarounds.c",
+ "brw_cfg.cpp",
+ "brw_cfg.h",
+ "brw_compiler.c",
+ "brw_compiler.h",
+ "brw_compile_sf.c",
+ "brw_dead_control_flow.cpp",
+ "brw_dead_control_flow.h",
+ "brw_disasm.c",
+ "brw_disasm_info.c",
+ "brw_eu.c",
+ "brw_eu.h",
+ "brw_eu_compact.c",
+ "brw_eu_emit.c",
+ "brw_eu_util.c",
+ "brw_eu_validate.c",
+ "brw_fs.cpp",
+ "brw_fs.h",
+ "brw_fs_bank_conflicts.cpp",
+ "brw_fs_builder.h",
+ "brw_fs_cmod_propagation.cpp",
+ "brw_fs_combine_constants.cpp",
+ "brw_fs_copy_propagation.cpp",
+ "brw_fs_cse.cpp",
+ "brw_fs_dead_code_eliminate.cpp",
+ "brw_fs_generator.cpp",
+ "brw_fs_live_variables.cpp",
+ "brw_fs_live_variables.h",
+ "brw_fs_lower_conversions.cpp",
+ "brw_fs_lower_pack.cpp",
+ "brw_fs_nir.cpp",
+ "brw_fs_reg_allocate.cpp",
+ "brw_fs_register_coalesce.cpp",
+ "brw_fs_saturate_propagation.cpp",
+ "brw_fs_sel_peephole.cpp",
+ "brw_fs_surface_builder.cpp",
+ "brw_fs_surface_builder.h",
+ "brw_fs_validate.cpp",
+ "brw_fs_visitor.cpp",
+ "brw_inst.h",
+ "brw_interpolation_map.c",
+ "brw_ir_allocator.h",
+ "brw_ir_fs.h",
+ "brw_ir_vec4.h",
+ "brw_nir.c",
+ "brw_nir.h",
+ "brw_nir_analyze_boolean_resolves.c",
+ "brw_nir_analyze_ubo_ranges.c",
+ "brw_nir_attribute_workarounds.c",
+ "brw_nir_lower_cs_intrinsics.c",
+ "brw_nir_opt_peephole_ffma.c",
+ "brw_nir_tcs_workarounds.c",
+ "brw_packed_float.c",
+ "brw_predicated_break.cpp",
+ "brw_reg.h",
+ "brw_reg_type.c",
+ "brw_reg_type.h",
+ "brw_schedule_instructions.cpp",
+ "brw_shader.cpp",
+ "brw_shader.h",
+ "brw_vec4.cpp",
+ "brw_vec4.h",
+ "brw_vec4_builder.h",
+ "brw_vec4_cmod_propagation.cpp",
+ "brw_vec4_copy_propagation.cpp",
+ "brw_vec4_cse.cpp",
+ "brw_vec4_dead_code_eliminate.cpp",
+ "brw_vec4_generator.cpp",
+ "brw_vec4_gs_nir.cpp",
+ "brw_vec4_gs_visitor.cpp",
+ "brw_vec4_gs_visitor.h",
+ "brw_vec4_live_variables.cpp",
+ "brw_vec4_live_variables.h",
+ "brw_vec4_nir.cpp",
+ "brw_vec4_reg_allocate.cpp",
+ "brw_vec4_surface_builder.cpp",
+ "brw_vec4_surface_builder.h",
+ "brw_vec4_tcs.cpp",
+ "brw_vec4_tcs.h",
+ "brw_vec4_tes.cpp",
+ "brw_vec4_tes.h",
+ "brw_vec4_visitor.cpp",
+ "brw_vec4_vs_visitor.cpp",
+ "brw_vue_map.c",
+ "brw_wm_iz.cpp",
+ "gen6_gs_visitor.cpp",
+ "gen6_gs_visitor.h",
+ ]
+}
+
+action("gen_brw_nir_trig_workarounds") {
+ output_name = "brw_nir_trig_workarounds.c"
+ script_name = "brw_nir_trig_workarounds.py"
+
+ script = "$mesa_build_root/scripts/gn_script_wrapper.py"
+
+ outputs = [
+ "$target_gen_dir/$output_name",
+ ]
+
+ inputs = [
+ "$mesa_build_root/src/compiler/nir/nir_algebraic.py",
+ ]
+
+ python_path = "$magma_python_path:" + rebase_path("$mesa_build_root") +
+ "/src/compiler/nir"
+
+ args = [
+ "$python_path",
+ rebase_path("$target_gen_dir") + "/$output_name",
+ rebase_path(".") + "/$script_name",
+ "--import-path",
+ "$python_path",
+ ]
+}
diff --git a/src/intel/compiler/brw_eu_validate.c b/src/intel/compiler/brw_eu_validate.c
index a25010b..852f701 100644
--- a/src/intel/compiler/brw_eu_validate.c
+++ b/src/intel/compiler/brw_eu_validate.c
@@ -26,8 +26,10 @@
* This file implements a pass that validates shader assembly.
*/
+#define _GNU_SOURCE // for memmem
#include "brw_eu.h"
+
/* We're going to do lots of string concatenation, so this should help. */
struct string {
char *str;
diff --git a/src/intel/compiler/brw_schedule_instructions.cpp b/src/intel/compiler/brw_schedule_instructions.cpp
index f817142..7b7a0d7 100644
--- a/src/intel/compiler/brw_schedule_instructions.cpp
+++ b/src/intel/compiler/brw_schedule_instructions.cpp
@@ -972,7 +972,11 @@
* After register allocation, reg_offsets are gone and we track individual
* GRF registers.
*/
- schedule_node *last_grf_write[grf_count * 16];
+ const uint32_t last_grf_write_size = sizeof(schedule_node*) * grf_count * 16;
+ /* This array can be larger than the default stack size on some platforms,
+ * so heap allocate instead.
+ */
+ schedule_node **last_grf_write = (schedule_node**) malloc(last_grf_write_size);
schedule_node *last_mrf_write[BRW_MAX_MRF(v->devinfo->gen)];
schedule_node *last_conditional_mod[8] = {};
schedule_node *last_accumulator_write = NULL;
@@ -983,7 +987,7 @@
*/
schedule_node *last_fixed_grf_write = NULL;
- memset(last_grf_write, 0, sizeof(last_grf_write));
+ memset(last_grf_write, 0, last_grf_write_size);
memset(last_mrf_write, 0, sizeof(last_mrf_write));
/* top-to-bottom dependencies: RAW and WAW. */
@@ -1110,7 +1114,7 @@
}
/* bottom-to-top dependencies: WAR */
- memset(last_grf_write, 0, sizeof(last_grf_write));
+ memset(last_grf_write, 0, last_grf_write_size);
memset(last_mrf_write, 0, sizeof(last_mrf_write));
memset(last_conditional_mod, 0, sizeof(last_conditional_mod));
last_accumulator_write = NULL;
@@ -1226,6 +1230,8 @@
last_accumulator_write = n;
}
}
+
+ free(last_grf_write);
}
void
diff --git a/src/intel/dev/BUILD.gn b/src/intel/dev/BUILD.gn
new file mode 100644
index 0000000..0804ab1
--- /dev/null
+++ b/src/intel/dev/BUILD.gn
@@ -0,0 +1,38 @@
+# Copyright 2018 The Fuchsia Authors
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+import("../../../mesa.gni")
+
+config("dev_config") {
+ include_dirs = [ "." ]
+}
+
+mesa_source_set("dev") {
+ sources = [
+ "gen_device_info.c",
+ "gen_device_info.h",
+ ]
+ public_configs = [ ":dev_config" ]
+ include_dirs = [ "$mesa_build_root/include/drm-uapi" ]
+ public_deps = [
+ "$mesa_build_root/src/util",
+ ]
+}
diff --git a/src/intel/genxml/BUILD.gn b/src/intel/genxml/BUILD.gn
new file mode 100644
index 0000000..fa903df
--- /dev/null
+++ b/src/intel/genxml/BUILD.gn
@@ -0,0 +1,214 @@
+# Copyright 2016 The Fuchsia Authors
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+import("../../../mesa.gni")
+
+action("gen_pack7_header") {
+ output_name = "gen7_pack.h"
+ script_name = "gen_pack_header.py"
+
+ script = "$mesa_build_root/scripts/gn_script_wrapper.py"
+
+ outputs = [
+ "$target_gen_dir/$output_name",
+ ]
+
+ sources = [
+ "gen7.xml",
+ ]
+
+ inputs = [
+ "$script_name",
+ ]
+
+ args = [
+ "$magma_python_path",
+ rebase_path("$target_gen_dir") + "/$output_name",
+ rebase_path(".") + "/$script_name",
+ rebase_path(".") + "/gen7.xml",
+ ]
+}
+
+action("gen_pack75_header") {
+ output_name = "gen75_pack.h"
+ script_name = "gen_pack_header.py"
+
+ script = "$mesa_build_root/scripts/gn_script_wrapper.py"
+
+ outputs = [
+ "$target_gen_dir/$output_name",
+ ]
+
+ sources = [
+ "gen75.xml",
+ ]
+
+ inputs = [
+ "$script_name",
+ ]
+
+ args = [
+ "$magma_python_path",
+ rebase_path("$target_gen_dir") + "/$output_name",
+ rebase_path(".") + "/$script_name",
+ rebase_path(".") + "/gen75.xml",
+ ]
+}
+
+action("gen_pack8_header") {
+ output_name = "gen8_pack.h"
+ script_name = "gen_pack_header.py"
+
+ script = "$mesa_build_root/scripts/gn_script_wrapper.py"
+
+ outputs = [
+ "$target_gen_dir/$output_name",
+ ]
+
+ sources = [
+ "gen8.xml",
+ ]
+
+ inputs = [
+ "$script_name",
+ ]
+
+ args = [
+ "$magma_python_path",
+ rebase_path("$target_gen_dir") + "/$output_name",
+ rebase_path(".") + "/$script_name",
+ rebase_path(".") + "/gen8.xml",
+ ]
+}
+
+action("gen_pack9_header") {
+ output_name = "gen9_pack.h"
+ script_name = "gen_pack_header.py"
+
+ script = "$mesa_build_root/scripts/gn_script_wrapper.py"
+
+ outputs = [
+ "$target_gen_dir/$output_name",
+ ]
+
+ sources = [
+ "gen9.xml",
+ ]
+
+ inputs = [
+ "$script_name",
+ ]
+
+ args = [
+ "$magma_python_path",
+ rebase_path("$target_gen_dir") + "/$output_name",
+ rebase_path(".") + "/$script_name",
+ rebase_path(".") + "/gen9.xml",
+ ]
+}
+
+action("gen_pack10_header") {
+ output_name = "gen10_pack.h"
+ script_name = "gen_pack_header.py"
+
+ script = "$mesa_build_root/scripts/gn_script_wrapper.py"
+
+ outputs = [
+ "$target_gen_dir/$output_name",
+ ]
+
+ sources = [
+ "gen10.xml",
+ ]
+
+ inputs = [
+ "$script_name",
+ ]
+
+ args = [
+ "$magma_python_path",
+ rebase_path("$target_gen_dir") + "/$output_name",
+ rebase_path(".") + "/$script_name",
+ rebase_path(".") + "/gen10.xml",
+ ]
+}
+
+action("gen_pack11_header") {
+ output_name = "gen11_pack.h"
+ script_name = "gen_pack_header.py"
+
+ script = "$mesa_build_root/scripts/gn_script_wrapper.py"
+
+ outputs = [
+ "$target_gen_dir/$output_name",
+ ]
+
+ sources = [
+ "gen11.xml",
+ ]
+
+ inputs = [
+ "$script_name",
+ ]
+
+ args = [
+ "$magma_python_path",
+ rebase_path("$target_gen_dir") + "/$output_name",
+ rebase_path(".") + "/$script_name",
+ rebase_path(".") + "/gen11.xml",
+ ]
+}
+
+action("gen_bits_header") {
+ output_name = "genX_bits.h"
+ script_name = "gen_bits_header.py"
+
+ script = "$mesa_build_root/scripts/gn_script_wrapper.py"
+
+ outputs = [
+ "$target_gen_dir/$output_name",
+ ]
+
+ sources = [
+ "gen7.xml",
+ "gen75.xml",
+ "gen8.xml",
+ "gen9.xml",
+ "gen10.xml",
+ "gen11.xml",
+ ]
+
+ inputs = [
+ "$script_name",
+ ]
+
+ args = [
+ "$magma_python_path",
+ rebase_path("$target_gen_dir") + "/$output_name",
+ rebase_path(".") + "/$script_name",
+ rebase_path(".") + "/gen7.xml",
+ rebase_path(".") + "/gen75.xml",
+ rebase_path(".") + "/gen8.xml",
+ rebase_path(".") + "/gen9.xml",
+ rebase_path(".") + "/gen10.xml",
+ rebase_path(".") + "/gen11.xml",
+ ]
+}
diff --git a/src/intel/isl/gen_format_layout.py b/src/intel/isl/gen_format_layout.py
old mode 100644
new mode 100755
index 1fa7c62..fe90a12
--- a/src/intel/isl/gen_format_layout.py
+++ b/src/intel/isl/gen_format_layout.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
# encoding=utf-8
# Copyright © 2016 Intel Corporation
@@ -26,6 +27,10 @@
import csv
import re
import textwrap
+import sys
+
+# --pythonpath must be the first argument
+sys.path.append(sys.argv[2])
from mako import template
@@ -231,6 +236,7 @@
def main():
"""Main function."""
parser = argparse.ArgumentParser()
+ parser.add_argument('--pythonpath')
parser.add_argument('--csv', action='store', help='The CSV file to parse.')
parser.add_argument(
'--out',
diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
index f39d8a7..f164ad8 100644
--- a/src/intel/isl/isl.c
+++ b/src/intel/isl/isl.c
@@ -1774,20 +1774,6 @@
#define isl_genX_call(dev, func, ...) \
switch (ISL_DEV_GEN(dev)) { \
- case 4: \
- /* G45 surface state is the same as gen5 */ \
- if (ISL_DEV_IS_G4X(dev)) { \
- isl_gen5_##func(__VA_ARGS__); \
- } else { \
- isl_gen4_##func(__VA_ARGS__); \
- } \
- break; \
- case 5: \
- isl_gen5_##func(__VA_ARGS__); \
- break; \
- case 6: \
- isl_gen6_##func(__VA_ARGS__); \
- break; \
case 7: \
if (ISL_DEV_IS_HASWELL(dev)) { \
isl_gen75_##func(__VA_ARGS__); \
diff --git a/src/intel/vulkan/BUILD.gn b/src/intel/vulkan/BUILD.gn
new file mode 100644
index 0000000..e121307
--- /dev/null
+++ b/src/intel/vulkan/BUILD.gn
@@ -0,0 +1,263 @@
+# Copyright 2016 The Fuchsia Authors
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+import("../../../mesa.gni")
+
+declare_args() {
+ use_mock_magma = false
+}
+
+config("vulkan_internal_config") {
+ include_dirs = [
+ ".",
+ "..", # because anv_private.h includes isl/isl.h
+ "$mesa_build_root/include/drm-uapi", # because anv_private.h includes i915_drm.h
+ "$mesa_build_root/src/compiler", # because anv_nir.h includes nir/nir.h
+ "$mesa_build_root/src", # because isl.h includes util/macros.h
+ "$mesa_build_root/src/vulkan/util", # because anv_private.h includes vk_alloc.h
+ "$root_gen_dir/third_party/mesa/src/intel/vulkan",
+ ]
+}
+
+shared_library("vulkan_intel") {
+ deps = [
+ ":vulkan_internal",
+ ]
+
+ if (use_mock_magma) {
+ deps += [ "$magma_build_root/tests/mock:magma_system" ]
+ } else {
+ deps += [ "//garnet/lib/magma/src/libmagma" ]
+ }
+
+ ldflags = [ "-static-libstdc++" ]
+}
+
+# Also used by testing targets
+mesa_source_set("vulkan_internal") {
+ public_deps = [
+ "$mesa_build_root/include:vulkan",
+ "$mesa_build_root/src/intel/compiler",
+ "$mesa_build_root/src/vulkan/wsi",
+ ]
+ cflags_cc = [ "-Wno-c++11-narrowing" ]
+
+ public_configs = [
+ ":vulkan_internal_config",
+ ]
+
+ deps = [
+ ":anv_entrypoints",
+ ":anv_extensions",
+ ":gen",
+ "$magma_build_root/include:magma_abi",
+ "$magma_build_root/src/magma_util",
+ "$magma_build_root/src/magma_util/platform:futex",
+ "$mesa_build_root/include:c_compat",
+ "$mesa_build_root/src/compiler/nir",
+ "$mesa_build_root/src/compiler/spirv",
+ "$mesa_build_root/src/intel:genxml",
+ "$mesa_build_root/src/intel:isl",
+ "$mesa_build_root/src/intel/blorp",
+ "$mesa_build_root/src/intel/common",
+ "$mesa_build_root/src/intel/dev",
+ "$mesa_build_root/src/magma",
+ "$mesa_build_root/src/util",
+ "$mesa_build_root/src/vulkan/util",
+ "$msd_intel_gen_build_root/include",
+ ]
+
+ sources = [
+ "$target_gen_dir/anv_entrypoints.c",
+ "$target_gen_dir/anv_entrypoints.h",
+ "$target_gen_dir/anv_extensions.c",
+ "$target_gen_dir/anv_extensions.h",
+ "anv_allocator.c",
+ "anv_batch_chain.c",
+ "anv_blorp.c",
+ "anv_cmd_buffer.c",
+ "anv_descriptor_set.c",
+ "anv_device.c",
+ "anv_dump.c",
+ "anv_formats.c",
+ "anv_genX.h",
+ "anv_image.c",
+ "anv_intel.c",
+ "anv_magma.cc",
+ "anv_nir.h",
+ "anv_nir_add_base_work_group_id.c",
+ "anv_nir_apply_pipeline_layout.c",
+ "anv_nir_lower_input_attachments.c",
+ "anv_nir_lower_multiview.c",
+ "anv_nir_lower_push_constants.c",
+ "anv_nir_lower_ycbcr_textures.c",
+ "anv_pass.c",
+ "anv_pipeline.c",
+ "anv_pipeline_cache.c",
+ "anv_platform.cc",
+ "anv_private.h",
+ "anv_queue.c",
+ "anv_util.c",
+ "anv_wsi.c",
+ "vk_format_info.h",
+ ]
+}
+
+group("gen") {
+ deps = [
+ ":gen10",
+ ":gen11",
+ ":gen7",
+ ":gen75",
+ ":gen8",
+ ":gen9",
+ ]
+}
+
+template("vulkan_gen8") {
+ mesa_source_set(target_name) {
+ defines = [ invoker.defines ]
+
+ configs = [
+ ":vulkan_internal_config",
+ ]
+
+ sources = [
+ "gen8_cmd_buffer.c",
+ "genX_blorp_exec.c",
+ "genX_cmd_buffer.c",
+ "genX_gpu_memcpy.c",
+ "genX_pipeline.c",
+ "genX_query.c",
+ "genX_state.c",
+ ]
+
+ deps = [
+ ":anv_entrypoints",
+ "$magma_build_root/include:magma_abi",
+ "$mesa_build_root/include:vulkan",
+ "$mesa_build_root/include:c_compat",
+ "$mesa_build_root/src/intel:genxml",
+ "$mesa_build_root/src/intel:isl",
+ "$mesa_build_root/src/intel/blorp",
+ "$mesa_build_root/src/vulkan/wsi",
+ ]
+ }
+}
+
+vulkan_gen8("gen8") {
+ defines = "GEN_VERSIONx10=80"
+}
+
+vulkan_gen8("gen9") {
+ defines = "GEN_VERSIONx10=90"
+}
+
+vulkan_gen8("gen10") {
+ defines = "GEN_VERSIONx10=100"
+}
+
+vulkan_gen8("gen11") {
+ defines = "GEN_VERSIONx10=110"
+}
+
+template("vulkan_gen7") {
+ mesa_source_set(target_name) {
+ defines = [ invoker.defines ]
+
+ configs = [
+ ":vulkan_internal_config",
+ ]
+
+ sources = [
+ "gen7_cmd_buffer.c",
+ "genX_blorp_exec.c",
+ "genX_cmd_buffer.c",
+ "genX_gpu_memcpy.c",
+ "genX_pipeline.c",
+ "genX_query.c",
+ "genX_state.c",
+ ]
+
+ deps = [
+ ":anv_entrypoints",
+ "$magma_build_root/include:magma_abi",
+ "$mesa_build_root/include:vulkan",
+ "$mesa_build_root/include:c_compat",
+ "$mesa_build_root/src/intel:genxml",
+ "$mesa_build_root/src/intel:isl",
+ "$mesa_build_root/src/intel/blorp",
+ "$mesa_build_root/src/vulkan/wsi",
+ ]
+ }
+}
+
+vulkan_gen7("gen7") {
+ defines = "GEN_VERSIONx10=70"
+}
+
+vulkan_gen7("gen75") {
+ defines = "GEN_VERSIONx10=75"
+}
+
+action("anv_entrypoints") {
+ outputs = [
+ "$target_gen_dir/anv_entrypoints.h",
+ "$target_gen_dir/anv_entrypoints.c",
+ ]
+
+ script = "anv_entrypoints_gen.py"
+
+ inputs = [
+ "$mesa_build_root/src/vulkan/registry/vk.xml",
+ ]
+
+ args = [
+ "--pythonpath",
+ rebase_path("$magma_python_path"),
+ "--xml",
+ rebase_path("$mesa_build_root") + "/src/vulkan/registry/vk.xml",
+ "--outdir",
+ rebase_path("$target_gen_dir"),
+ ]
+}
+
+action("anv_extensions") {
+ outputs = [
+ "$target_gen_dir/anv_extensions.c",
+ "$target_gen_dir/anv_extensions.h"
+ ]
+ script = "anv_extensions_gen.py"
+ inputs = [
+ "$mesa_build_root/src/vulkan/registry/vk.xml",
+ "anv_extensions.py",
+ ]
+ args = [
+ "--pythonpath",
+ rebase_path("$magma_python_path"),
+ "--out-c",
+ rebase_path("$target_gen_dir/anv_extensions.c"),
+ "--out-h",
+ rebase_path("$target_gen_dir/anv_extensions.h"),
+ "--xml",
+ rebase_path("$mesa_build_root") + "/src/vulkan/registry/vk.xml",
+ ]
+}
diff --git a/src/intel/vulkan/anv_allocator.c b/src/intel/vulkan/anv_allocator.c
index 67f2f73..7192776 100644
--- a/src/intel/vulkan/anv_allocator.c
+++ b/src/intel/vulkan/anv_allocator.c
@@ -25,8 +25,6 @@
#include <unistd.h>
#include <limits.h>
#include <assert.h>
-#include <linux/memfd.h>
-#include <sys/mman.h>
#include "anv_private.h"
@@ -104,18 +102,25 @@
struct anv_mmap_cleanup {
void *map;
size_t size;
- uint32_t gem_handle;
+ anv_buffer_handle_t gem_handle;
};
#define ANV_MMAP_CLEANUP_INIT ((struct anv_mmap_cleanup){0})
-#ifndef HAVE_MEMFD_CREATE
static inline int
-memfd_create(const char *name, unsigned int flags)
+futex_wake(uint32_t *addr, int count)
{
- return syscall(SYS_memfd_create, name, flags);
+ return anv_platform_futex_wake(addr, count);
}
-#endif
+
+/* Changed to return void because no caller is checking the return code;
+ * futex_wait must always be used in a loop. */
+static inline void
+futex_wait(uint32_t *addr, int32_t value, void* timeout)
+{
+ assert(timeout == NULL);
+ (void) anv_platform_futex_wait(addr, value);
+}
static inline uint32_t
ilog2_round_up(uint32_t value)
@@ -255,18 +260,10 @@
anv_bo_init(&pool->bo, 0, 0);
- pool->fd = memfd_create("block pool", MFD_CLOEXEC);
- if (pool->fd == -1)
- return vk_error(VK_ERROR_INITIALIZATION_FAILED);
-
- /* Just make it 2GB up-front. The Linux kernel won't actually back it
- * with pages until we either map and fault on one of them or we use
- * userptr and send a chunk of it off to the GPU.
- */
- if (ftruncate(pool->fd, BLOCK_POOL_MEMFD_SIZE) == -1) {
- result = vk_error(VK_ERROR_INITIALIZATION_FAILED);
- goto fail_fd;
- }
+ // Start with a large (2GB) size, assuming that the kernel won't commit pages
+ // until map+fault or commit.
+ pool->bo.gem_handle = anv_gem_create(device, BLOCK_POOL_MEMFD_SIZE);
+ assert(pool->bo.gem_handle);
if (!u_vector_init(&pool->mmap_cleanups,
round_to_power_of_two(sizeof(struct anv_mmap_cleanup)),
@@ -289,8 +286,6 @@
fail_mmap_cleanups:
u_vector_finish(&pool->mmap_cleanups);
fail_fd:
- close(pool->fd);
-
return result;
}
@@ -301,14 +296,12 @@
u_vector_foreach(cleanup, &pool->mmap_cleanups) {
if (cleanup->map)
- munmap(cleanup->map, cleanup->size);
+ anv_gem_munmap(pool->device, cleanup->gem_handle, cleanup->map, cleanup->size);
if (cleanup->gem_handle)
anv_gem_close(pool->device, cleanup->gem_handle);
}
u_vector_finish(&pool->mmap_cleanups);
-
- close(pool->fd);
}
#define PAGE_SIZE 4096
@@ -318,7 +311,6 @@
uint32_t center_bo_offset, uint32_t size)
{
void *map;
- uint32_t gem_handle;
struct anv_mmap_cleanup *cleanup;
/* Assert that we only ever grow the pool */
@@ -330,36 +322,31 @@
assert(size - center_bo_offset <=
BLOCK_POOL_MEMFD_SIZE - BLOCK_POOL_MEMFD_CENTER);
- cleanup = u_vector_add(&pool->mmap_cleanups);
- if (!cleanup)
- return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
-
- *cleanup = ANV_MMAP_CLEANUP_INIT;
-
- /* Just leak the old map until we destroy the pool. We can't munmap it
- * without races or imposing locking on the block allocate fast path. On
- * the whole the leaked maps adds up to less than the size of the
- * current map. MAP_POPULATE seems like the right thing to do, but we
- * should try to get some numbers.
+ /* Code below expects that map points to the start of the new used portion
+ * as defined by the new center_bo_offset. But we only map once for magma
+ * so we use math to adjust map appropriately.
*/
- map = mmap(NULL, size, PROT_READ | PROT_WRITE,
- MAP_SHARED | MAP_POPULATE, pool->fd,
- BLOCK_POOL_MEMFD_CENTER - center_bo_offset);
- if (map == MAP_FAILED)
- return vk_errorf(pool->device->instance, pool->device,
- VK_ERROR_MEMORY_MAP_FAILED, "mmap failed: %m");
+ if (pool->bo.map) {
+ map = (uint8_t*)pool->bo.map + pool->center_bo_offset - center_bo_offset;
+ } else {
+ cleanup = u_vector_add(&pool->mmap_cleanups);
+ if (!cleanup)
+ return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
- gem_handle = anv_gem_userptr(pool->device, map, size);
- if (gem_handle == 0) {
- munmap(map, size);
- return vk_errorf(pool->device->instance, pool->device,
- VK_ERROR_TOO_MANY_OBJECTS, "userptr failed: %m");
+ *cleanup = ANV_MMAP_CLEANUP_INIT;
+
+ map = anv_gem_mmap(pool->device, pool->bo.gem_handle, 0, BLOCK_POOL_MEMFD_SIZE, 0);
+ cleanup->map = map;
+ cleanup->size = size;
+ cleanup->gem_handle = pool->bo.gem_handle;
+
+ if (!map)
+ return vk_error(VK_ERROR_MEMORY_MAP_FAILED);
+
+ /* Pretend we mapped only the used portion */
+ map = (uint8_t*)map + BLOCK_POOL_MEMFD_CENTER - center_bo_offset;
}
- cleanup->map = map;
- cleanup->size = size;
- cleanup->gem_handle = gem_handle;
-
#if 0
/* Regular objects are created I915_CACHING_CACHED on LLC platforms and
* I915_CACHING_NONE on non-LLC platforms. However, userptr objects are
@@ -404,13 +391,14 @@
* the EXEC_OBJECT_SUPPORTS_48B_ADDRESS flag and the kernel does all of the
* hard work for us.
*/
- anv_bo_init(&pool->bo, gem_handle, size);
+ anv_bo_init(&pool->bo, pool->bo.gem_handle, size);
if (pool->bo_flags & EXEC_OBJECT_PINNED) {
pool->bo.offset = pool->start_address + BLOCK_POOL_MEMFD_CENTER -
center_bo_offset;
}
pool->bo.flags = pool->bo_flags;
pool->bo.map = map;
+ pool->bo.start_offset = BLOCK_POOL_MEMFD_CENTER - center_bo_offset;
return VK_SUCCESS;
}
@@ -984,7 +972,7 @@
while (link != NULL) {
struct bo_pool_bo_link link_copy = VG_NOACCESS_READ(link);
- anv_gem_munmap(link_copy.bo.map, link_copy.bo.size);
+ anv_gem_munmap(pool->device, link_copy.bo.gem_handle, link_copy.bo.map, link_copy.bo.size);
anv_vma_free(pool->device, &link_copy.bo);
anv_gem_close(pool->device, link_copy.bo.gem_handle);
link = link_copy.next;
@@ -1223,7 +1211,7 @@
}
static struct anv_cached_bo *
-anv_bo_cache_lookup_locked(struct anv_bo_cache *cache, uint32_t gem_handle)
+anv_bo_cache_lookup_locked(struct anv_bo_cache *cache, anv_buffer_handle_t gem_handle)
{
struct hash_entry *entry =
_mesa_hash_table_search(cache->bo_map,
@@ -1238,7 +1226,7 @@
}
UNUSED static struct anv_bo *
-anv_bo_cache_lookup(struct anv_bo_cache *cache, uint32_t gem_handle)
+anv_bo_cache_lookup(struct anv_bo_cache *cache, anv_buffer_handle_t gem_handle)
{
pthread_mutex_lock(&cache->mutex);
@@ -1305,23 +1293,17 @@
return VK_SUCCESS;
}
-VkResult
-anv_bo_cache_import(struct anv_device *device,
- struct anv_bo_cache *cache,
- int fd, uint64_t bo_flags,
- struct anv_bo **bo_out)
+VkResult anv_bo_cache_import_buffer_handle(struct anv_device* device,
+ struct anv_bo_cache* cache,
+ anv_buffer_handle_t gem_handle,
+ uint64_t bo_flags,
+ uint64_t import_size,
+ struct anv_bo** bo_out)
{
assert(bo_flags == (bo_flags & ANV_BO_CACHE_SUPPORTED_FLAGS));
assert(bo_flags & ANV_BO_EXTERNAL);
pthread_mutex_lock(&cache->mutex);
-
- uint32_t gem_handle = anv_gem_fd_to_handle(device, fd);
- if (!gem_handle) {
- pthread_mutex_unlock(&cache->mutex);
- return vk_error(VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR);
- }
-
struct anv_cached_bo *bo = anv_bo_cache_lookup_locked(cache, gem_handle);
if (bo) {
/* We have to be careful how we combine flags so that it makes sense.
@@ -1368,7 +1350,7 @@
__sync_fetch_and_add(&bo->refcount, 1);
} else {
- off_t size = lseek(fd, 0, SEEK_END);
+ off_t size = import_size;
if (size == (off_t)-1) {
anv_gem_close(device, gem_handle);
pthread_mutex_unlock(&cache->mutex);
@@ -1407,6 +1389,21 @@
}
VkResult
+anv_bo_cache_import(struct anv_device* device,
+ struct anv_bo_cache* cache,
+ int fd, uint64_t bo_flags,
+ struct anv_bo** bo_out)
+{
+ anv_buffer_handle_t gem_handle = anv_gem_fd_to_handle(device, fd);
+ if (!gem_handle) {
+ return vk_error(VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR);
+ }
+
+ return anv_bo_cache_import_buffer_handle(device, cache, gem_handle, bo_flags,
+ lseek(fd, 0, SEEK_END), bo_out);
+}
+
+VkResult
anv_bo_cache_export(struct anv_device *device,
struct anv_bo_cache *cache,
struct anv_bo *bo_in, int *fd_out)
@@ -1482,7 +1479,7 @@
_mesa_hash_table_remove(cache->bo_map, entry);
if (bo->bo.map)
- anv_gem_munmap(bo->bo.map, bo->bo.size);
+ anv_gem_munmap(device, bo->bo.gem_handle, bo->bo.map, bo->bo.size);
anv_vma_free(device, &bo->bo);
diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c
index e08e07a..5e21a38 100644
--- a/src/intel/vulkan/anv_batch_chain.c
+++ b/src/intel/vulkan/anv_batch_chain.c
@@ -175,7 +175,7 @@
index = list->num_relocs++;
list->reloc_bos[index] = target_bo;
entry = &list->relocs[index];
- entry->target_handle = target_bo->gem_handle;
+ entry->target_handle = 0; // Set in anv_cmd_buffer_process_relocs
entry->delta = delta;
entry->offset = offset;
entry->presumed_offset = target_bo->offset;
@@ -1098,8 +1098,8 @@
obj->alignment = 0;
obj->offset = bo->offset;
obj->flags = (bo->flags & ~ANV_BO_FLAG_MASK) | extra_flags;
- obj->rsvd1 = 0;
- obj->rsvd2 = 0;
+ obj->rsvd1 = bo->start_offset;
+ obj->rsvd2 = bo->size;
}
if (relocs != NULL) {
@@ -1162,7 +1162,7 @@
static VkResult
anv_execbuf_add_syncobj(struct anv_execbuf *exec,
- uint32_t handle, uint32_t flags,
+ anv_syncobj_handle_t handle, uint32_t flags,
const VkAllocationCallbacks *alloc)
{
assert(flags != 0);
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 50d16b8..de6dfdf 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -25,10 +25,10 @@
#include <stdbool.h>
#include <string.h>
#include <sys/mman.h>
-#include <sys/sysinfo.h>
+#include <sys/stat.h>
#include <unistd.h>
+#include <dirent.h>
#include <fcntl.h>
-#include <xf86drm.h>
#include <drm_fourcc.h>
#include "anv_private.h"
@@ -62,10 +62,11 @@
anv_compute_heap_size(int fd, uint64_t gtt_size, uint64_t *heap_size)
{
/* Query the total ram from the system */
- struct sysinfo info;
- sysinfo(&info);
+ // struct sysinfo info;
+ // sysinfo(&info);
- uint64_t total_ram = (uint64_t)info.totalram * (uint64_t)info.mem_unit;
+ // uint64_t total_ram = (uint64_t)info.totalram * (uint64_t)info.mem_unit;
+ uint64_t total_ram = 8ull * 1024ull * 1024ull * 1024ull;
/* We don't want to burn too much ram with the GPU. If the user has 4GiB
* or less, we use at most half. If they have more than 4GiB, we use 3/4.
@@ -219,22 +220,20 @@
static VkResult
anv_physical_device_init_uuids(struct anv_physical_device *device)
{
- const struct build_id_note *note =
- build_id_find_nhdr_for_addr(anv_physical_device_init_uuids);
- if (!note) {
- return vk_errorf(device->instance, device,
- VK_ERROR_INITIALIZATION_FAILED,
- "Failed to find build-id");
- }
+ //TODO(MA-319)
+ // const struct build_id_note *note = build_id_find_nhdr("libvulkan_intel.so");
+ // if (!note) {
+ // return vk_errorf(VK_ERROR_INITIALIZATION_FAILED,
+ // "Failed to find build-id");
+ // }
- unsigned build_id_len = build_id_length(note);
- if (build_id_len < 20) {
- return vk_errorf(device->instance, device,
- VK_ERROR_INITIALIZATION_FAILED,
- "build-id too short. It needs to be a SHA");
- }
+ // unsigned build_id_len = build_id_length(note);
+ // if (build_id_len < 20) {
+ // return vk_errorf(VK_ERROR_INITIALIZATION_FAILED,
+ // "build-id too short. It needs to be a SHA");
+ // }
- memcpy(device->driver_build_sha1, build_id_data(note), 20);
+ //memcpy(device->driver_build_sha1, build_id_data(note), 20);
struct mesa_sha1 sha1_ctx;
uint8_t sha1[20];
@@ -244,7 +243,7 @@
* invalid. It needs both a driver build and the PCI ID of the device.
*/
_mesa_sha1_init(&sha1_ctx);
- _mesa_sha1_update(&sha1_ctx, build_id_data(note), build_id_len);
+ // _mesa_sha1_update(&sha1_ctx, build_id_data(note), build_id_len);
_mesa_sha1_update(&sha1_ctx, &device->chipset_id,
sizeof(device->chipset_id));
_mesa_sha1_final(&sha1_ctx, sha1);
@@ -255,7 +254,7 @@
* share memory need to also check the device UUID (below) so all this
* needs to be is the build-id.
*/
- memcpy(device->driver_uuid, build_id_data(note), VK_UUID_SIZE);
+ //memcpy(device->driver_uuid, build_id_data(note), VK_UUID_SIZE);
/* The device UUID uniquely identifies the given device within the machine.
* Since we never have more than one device, this doesn't need to be a real
@@ -317,7 +316,7 @@
brw_process_intel_debug_variable();
- fd = open(path, O_RDWR | O_CLOEXEC);
+ fd = open(path, O_RDONLY);
if (fd < 0)
return vk_error(VK_ERROR_INCOMPATIBLE_DRIVER);
@@ -441,7 +440,9 @@
* many platforms, but otherwise, things will just work.
*/
if (device->subslice_total < 1 || device->eu_total < 1) {
- intel_logw("Kernel 4.1 required to properly query GPU properties");
+ intel_logw("WARNING: Unknown subslice/eu totals for device 0x%x\n",
+ device->chipset_id);
+ assert(false);
}
} else if (device->info.gen == 7) {
device->subslice_total = 1 << (device->info.gt - 1);
@@ -697,31 +698,33 @@
static VkResult
anv_enumerate_devices(struct anv_instance *instance)
{
- /* TODO: Check for more devices ? */
- drmDevicePtr devices[8];
VkResult result = VK_ERROR_INCOMPATIBLE_DRIVER;
- int max_devices;
instance->physicalDeviceCount = 0;
- max_devices = drmGetDevices2(0, devices, ARRAY_SIZE(devices));
- if (max_devices < 1)
+ struct dirent* de;
+ const char DEV_GPU[] = "/dev/class/gpu";
+ DIR* dir = opendir(DEV_GPU);
+ if (!dir) {
+ printf("Error opening %s\n", DEV_GPU);
return VK_ERROR_INCOMPATIBLE_DRIVER;
+ }
- for (unsigned i = 0; i < (unsigned)max_devices; i++) {
- if (devices[i]->available_nodes & 1 << DRM_NODE_RENDER &&
- devices[i]->bustype == DRM_BUS_PCI &&
- devices[i]->deviceinfo.pci->vendor_id == 0x8086) {
+ while ((de = readdir(dir)) != NULL) {
+ // extra +1 ensures space for null termination
+ char name[sizeof(DEV_GPU) + sizeof('/') + (NAME_MAX + 1) + 1];
+ snprintf(name, sizeof(name), "%s/%s", DEV_GPU, de->d_name);
- result = anv_physical_device_init(&instance->physicalDevice,
- instance,
- devices[i]->nodes[DRM_NODE_PRIMARY],
- devices[i]->nodes[DRM_NODE_RENDER]);
+ struct stat path_stat;
+ stat(name, &path_stat);
+ if (!S_ISDIR(path_stat.st_mode)) {
+ result = anv_physical_device_init(&instance->physicalDevice, instance,
+ name, name);
if (result != VK_ERROR_INCOMPATIBLE_DRIVER)
break;
}
}
- drmFreeDevices(devices, max_devices);
+ closedir(dir);
if (result == VK_SUCCESS)
instance->physicalDeviceCount = 1;
@@ -1474,7 +1477,7 @@
if (!device->info.has_llc)
gen_clflush_range(map, batch.next - map);
- anv_gem_munmap(map, device->trivial_batch_bo.size);
+ anv_gem_munmap(device, device->trivial_batch_bo.gem_handle, map, device->trivial_batch_bo.size);
}
VkResult anv_EnumerateDeviceExtensionProperties(
@@ -1569,7 +1572,7 @@
hiz_clear.f32[0] = ANV_HZ_FC_VAL;
memcpy(map, hiz_clear.u32, sizeof(hiz_clear.u32));
- anv_gem_munmap(map, device->hiz_clear_bo.size);
+ anv_gem_munmap(device, device->hiz_clear_bo.gem_handle, map, device->hiz_clear_bo.size);
}
VkResult anv_CreateDevice(
@@ -1651,12 +1654,17 @@
device->alloc = physical_device->instance->alloc;
/* XXX(chadv): Can we dup() physicalDevice->fd here? */
- device->fd = open(physical_device->path, O_RDWR | O_CLOEXEC);
+ device->fd = open(physical_device->path, O_RDONLY);
if (device->fd == -1) {
result = vk_error(VK_ERROR_INITIALIZATION_FAILED);
goto fail_device;
}
+ if (anv_gem_connect(device) != 0) {
+ result = vk_error(VK_ERROR_INITIALIZATION_FAILED);
+ goto fail_device;
+ }
+
device->context_id = anv_gem_create_context(device);
if (device->context_id == -1) {
result = vk_error(VK_ERROR_INITIALIZATION_FAILED);
@@ -1841,7 +1849,7 @@
fail_workaround_bo:
anv_queue_finish(&device->queue);
anv_scratch_pool_finish(device, &device->scratch_pool);
- anv_gem_munmap(device->workaround_bo.map, device->workaround_bo.size);
+ anv_gem_munmap(device, device->workaround_bo.gem_handle, device->workaround_bo.map, device->workaround_bo.size);
anv_gem_close(device, device->workaround_bo.gem_handle);
fail_binding_table_pool:
if (physical_device->use_softpin)
@@ -1896,7 +1904,7 @@
anv_scratch_pool_finish(device, &device->scratch_pool);
- anv_gem_munmap(device->workaround_bo.map, device->workaround_bo.size);
+ anv_gem_munmap(device, device->workaround_bo.gem_handle, device->workaround_bo.map, device->workaround_bo.size);
anv_vma_free(device, &device->workaround_bo);
anv_gem_close(device, device->workaround_bo.gem_handle);
@@ -1919,6 +1927,7 @@
pthread_mutex_destroy(&device->mutex);
anv_gem_destroy_context(device, device->context_id);
+ anv_gem_disconnect(device);
close(device->fd);
@@ -2142,7 +2151,7 @@
VkResult
anv_bo_init_new(struct anv_bo *bo, struct anv_device *device, uint64_t size)
{
- uint32_t gem_handle = anv_gem_create(device, size);
+ anv_buffer_handle_t gem_handle = anv_gem_create(device, size);
if (!gem_handle)
return vk_error(VK_ERROR_OUT_OF_DEVICE_MEMORY);
@@ -2206,6 +2215,11 @@
const VkImportMemoryFdInfoKHR *fd_info =
vk_find_struct_const(pAllocateInfo->pNext, IMPORT_MEMORY_FD_INFO_KHR);
+#if VK_USE_PLATFORM_MAGMA_KHR
+ const VkImportMemoryFuchsiaHandleInfoKHR *fuchsia_info =
+ vk_find_struct_const(pAllocateInfo->pNext, IMPORT_MEMORY_FUCHSIA_HANDLE_INFO_KHR);
+#endif // VK_USE_PLATFORM_MAGMA_KHR
+
/* The Vulkan spec permits handleType to be 0, in which case the struct is
* ignored.
*/
@@ -2253,6 +2267,43 @@
* If the import fails, we leave the file descriptor open.
*/
close(fd_info->fd);
+
+#if VK_USE_PLATFORM_MAGMA_KHR
+ } else if (fuchsia_info && fuchsia_info->handleType) {
+ assert(fuchsia_info->handleType ==
+ VK_EXTERNAL_MEMORY_HANDLE_TYPE_FUCHSIA_VMO_BIT_KHR);
+
+ VkDeviceSize aligned_alloc_size =
+ align_u64(pAllocateInfo->allocationSize, 4096);
+
+ // The anv_buffer_handle_t isn't a unique handle per object, so the cache
+ // lookup in the import will always fail.
+ // TODO(MA-320) - get a unique id for this object and use that as the cache key;
+ // then clients will be able to import a buffer more than once.
+ anv_buffer_handle_t buffer;
+ uint64_t import_size;
+ int status = anv_gem_import_fuchsia_buffer(
+ device, fuchsia_info->handle, &buffer, &import_size);
+ if (status != 0)
+ return vk_error(VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR);
+ if (import_size < aligned_alloc_size) {
+ result = vk_errorf(device->instance, device,
+ VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR,
+ "aligned allocationSize too large for "
+ "VK_EXTERNAL_MEMORY_HANDLE_TYPE_FUCHSIA_BIT_KHR: "
+ "%"PRIu64"B > %"PRIu64"B",
+ aligned_alloc_size, import_size);
+ anv_gem_close(device, buffer);
+ goto fail;
+ }
+
+ VkResult result = anv_bo_cache_import_buffer_handle(
+ device, &device->bo_cache, buffer, bo_flags | ANV_BO_EXTERNAL,
+ aligned_alloc_size, &mem->bo);
+ if (result != VK_SUCCESS)
+ goto fail;
+#endif // VK_USE_PLATFORM_MAGMA_KHR
+
} else {
const VkExportMemoryAllocateInfoKHR *fd_info =
vk_find_struct_const(pAllocateInfo->pNext, EXPORT_MEMORY_ALLOCATE_INFO_KHR);
@@ -2429,11 +2480,12 @@
VkDeviceMemory _memory)
{
ANV_FROM_HANDLE(anv_device_memory, mem, _memory);
+ ANV_FROM_HANDLE(anv_device, device, _device);
if (mem == NULL)
return;
- anv_gem_munmap(mem->map, mem->map_size);
+ anv_gem_munmap(device, mem->bo->gem_handle, mem->map, mem->map_size);
mem->map = NULL;
mem->map_size = 0;
diff --git a/src/intel/vulkan/anv_entrypoints_gen.py b/src/intel/vulkan/anv_entrypoints_gen.py
old mode 100644
new mode 100755
index e6cd9bb..2471636
--- a/src/intel/vulkan/anv_entrypoints_gen.py
+++ b/src/intel/vulkan/anv_entrypoints_gen.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
# coding=utf-8
#
# Copyright © 2015, 2017 Intel Corporation
@@ -26,6 +27,10 @@
import math
import os
import xml.etree.cElementTree as et
+import sys
+
+# --pythonpath must be the first argument
+sys.path.append(sys.argv[2])
from collections import OrderedDict, namedtuple
from mako.template import Template
@@ -516,6 +521,8 @@
if platform.upper() == 'XLIB_XRANDR':
ext = '_EXT'
define = 'VK_USE_PLATFORM_' + platform.upper() + ext
+ if 'protect' in extension.attrib:
+ define = extension.attrib['protect']
for entrypoint in extension.findall('./require/command'):
fullname = entrypoint.attrib['name']
@@ -526,6 +533,7 @@
def main():
parser = argparse.ArgumentParser()
+ parser.add_argument('--pythonpath')
parser.add_argument('--outdir', help='Where to write the files.',
required=True)
parser.add_argument('--xml',
diff --git a/src/intel/vulkan/anv_extensions.py b/src/intel/vulkan/anv_extensions.py
old mode 100644
new mode 100755
index 7da7888..4d56497
--- a/src/intel/vulkan/anv_extensions.py
+++ b/src/intel/vulkan/anv_extensions.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
COPYRIGHT = """\
/*
* Copyright 2017 Intel Corporation
@@ -28,6 +29,10 @@
import copy
import re
import xml.etree.cElementTree as et
+import sys
+
+# --pythonpath must be the first argument
+sys.path.append(sys.argv[2])
def _bool_to_c_expr(b):
if b is True:
@@ -82,14 +87,13 @@
Extension('VK_KHR_external_fence', 1,
'device->has_syncobj_wait'),
Extension('VK_KHR_external_fence_capabilities', 1, True),
- Extension('VK_KHR_external_fence_fd', 1,
- 'device->has_syncobj_wait'),
+ Extension('VK_KHR_external_fence_fd', 1, False),
Extension('VK_KHR_external_memory', 1, True),
Extension('VK_KHR_external_memory_capabilities', 1, True),
- Extension('VK_KHR_external_memory_fd', 1, True),
+ Extension('VK_KHR_external_memory_fd', 1, False),
Extension('VK_KHR_external_semaphore', 1, True),
Extension('VK_KHR_external_semaphore_capabilities', 1, True),
- Extension('VK_KHR_external_semaphore_fd', 1, True),
+ Extension('VK_KHR_external_semaphore_fd', 1, False),
Extension('VK_KHR_get_display_properties2', 1, 'VK_USE_PLATFORM_DISPLAY_KHR'),
Extension('VK_KHR_get_memory_requirements2', 1, True),
Extension('VK_KHR_get_physical_device_properties2', 1, True),
@@ -125,6 +129,9 @@
Extension('VK_EXT_shader_stencil_export', 1, 'device->info.gen >= 9'),
Extension('VK_EXT_vertex_attribute_divisor', 3, True),
Extension('VK_EXT_post_depth_coverage', 1, 'device->info.gen >= 9'),
+ Extension('VK_KHR_external_memory_fuchsia', 1, 'VK_USE_PLATFORM_MAGMA_KHR'),
+ Extension('VK_KHR_external_semaphore_fuchsia', 1, 'VK_USE_PLATFORM_MAGMA_KHR'),
+ Extension('VK_GOOGLE_image_usage_scanout', 1, 'VK_USE_PLATFORM_MAGMA_KHR'),
]
class VkVersion:
diff --git a/src/intel/vulkan/anv_extensions_gen.py b/src/intel/vulkan/anv_extensions_gen.py
old mode 100644
new mode 100755
index a140c26..454eedf
--- a/src/intel/vulkan/anv_extensions_gen.py
+++ b/src/intel/vulkan/anv_extensions_gen.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
COPYRIGHT = """\
/*
* Copyright 2017 Intel Corporation
@@ -26,6 +27,10 @@
import argparse
import xml.etree.cElementTree as et
+import sys
+
+# --pythonpath must be the first argument
+sys.path.append(sys.argv[2])
from mako.template import Template
@@ -184,6 +189,7 @@
if __name__ == '__main__':
parser = argparse.ArgumentParser()
+ parser.add_argument('--pythonpath')
parser.add_argument('--out-c', help='Output C file.')
parser.add_argument('--out-h', help='Output H file.')
parser.add_argument('--xml',
diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c
index 815b320..9501e2f 100644
--- a/src/intel/vulkan/anv_formats.c
+++ b/src/intel/vulkan/anv_formats.c
@@ -934,7 +934,18 @@
VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT,
};
-VkResult anv_GetPhysicalDeviceImageFormatProperties2(
+static const VkExternalMemoryPropertiesKHR fuchsia_vmo_props = {
+ /* If we can handle external, then we can both import and export it. */
+ .externalMemoryFeatures = VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_KHR |
+ VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_KHR,
+ /* For the moment, let's not support mixing and matching */
+ .exportFromImportedHandleTypes =
+ VK_EXTERNAL_MEMORY_HANDLE_TYPE_FUCHSIA_VMO_BIT_KHR,
+ .compatibleHandleTypes =
+ VK_EXTERNAL_MEMORY_HANDLE_TYPE_FUCHSIA_VMO_BIT_KHR,
+};
+
+VkResult anv_GetPhysicalDeviceImageFormatProperties2KHR(
VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceImageFormatInfo2* base_info,
VkImageFormatProperties2* base_props)
@@ -985,11 +996,16 @@
*/
if (external_info && external_info->handleType != 0) {
switch (external_info->handleType) {
- case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT:
- case VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT:
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_FUCHSIA_VMO_BIT_KHR:
if (external_props)
- external_props->externalMemoryProperties = prime_fd_props;
+ external_props->externalMemoryProperties = fuchsia_vmo_props;
break;
+ // Fuchsia: not supported
+ // case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR:
+ // case VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT:
+ // if (external_props)
+ // external_props->externalMemoryProperties = prime_fd_props;
+ // break;
default:
/* From the Vulkan 1.0.42 spec:
*
@@ -1068,10 +1084,14 @@
goto unsupported;
switch (pExternalBufferInfo->handleType) {
- case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT:
- case VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT:
- pExternalBufferProperties->externalMemoryProperties = prime_fd_props;
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_FUCHSIA_VMO_BIT_KHR:
+ pExternalBufferProperties->externalMemoryProperties = fuchsia_vmo_props;
return;
+ // Fuchsia: not supported
+ // case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR:
+ // case VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT:
+ // pExternalBufferProperties->externalMemoryProperties = prime_fd_props;
+ // return;
default:
goto unsupported;
}
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index 28d7096..c63c72b 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -103,7 +103,11 @@
default:
unreachable("bad VkImageTiling");
case VK_IMAGE_TILING_OPTIMAL:
- flags = ISL_TILING_ANY_MASK;
+ if (base_info->usage & VK_IMAGE_USAGE_SCANOUT_BIT_GOOGLE) {
+ flags = ISL_TILING_X_BIT;
+ } else {
+ flags = ISL_TILING_ANY_MASK;
+ }
break;
case VK_IMAGE_TILING_LINEAR:
flags = ISL_TILING_LINEAR_BIT;
@@ -1186,6 +1190,9 @@
}
state_inout->clear_address = clear_address;
+ uint32_t mocs = (view_usage == ISL_SURF_USAGE_RENDER_TARGET_BIT) &&
+ (image->usage & VK_IMAGE_USAGE_SCANOUT_BIT_GOOGLE) ?
+ device->uncached_mocs : anv_mocs_for_bo(device, state_inout->address.bo);
isl_surf_fill_state(&device->isl_dev, state_inout->state.map,
.surf = isl_surf,
.view = &view,
@@ -1196,8 +1203,7 @@
.aux_address = anv_address_physical(aux_address),
.clear_address = anv_address_physical(clear_address),
.use_clear_address = !anv_address_is_null(clear_address),
- .mocs = anv_mocs_for_bo(device,
- state_inout->address.bo),
+ .mocs = mocs,
.x_offset_sa = tile_x_sa,
.y_offset_sa = tile_y_sa);
@@ -1272,7 +1278,8 @@
VK_IMAGE_USAGE_STORAGE_BIT |
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT |
VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT |
- VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT));
+ VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT |
+ VK_IMAGE_USAGE_SCANOUT_BIT_GOOGLE));
switch (image->type) {
default:
diff --git a/src/intel/vulkan/anv_magma.cc b/src/intel/vulkan/anv_magma.cc
new file mode 100644
index 0000000..982f58b
--- /dev/null
+++ b/src/intel/vulkan/anv_magma.cc
@@ -0,0 +1,527 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "anv_magma.h"
+#include "drm_command_buffer.h"
+#include "msd_intel_gen_query.h"
+#include <chrono>
+
+int anv_gem_connect(anv_device* device)
+{
+ magma_connection_t* connection = magma_create_connection(device->fd, 0);
+ if (!connection)
+ return DRET_MSG(-1, "magma_system_open failed");
+
+ device->connection = new Connection(connection);
+
+ DLOG("opened a magma system connection");
+ return 0;
+}
+
+void anv_gem_disconnect(anv_device* device)
+{
+ delete static_cast<Connection*>(device->connection);
+ DLOG("closed the magma system connection");
+}
+
+// Return handle, or 0 on failure. Gem handles are never 0.
+anv_buffer_handle_t anv_gem_create(anv_device* device, size_t size)
+{
+ magma_buffer_t buffer;
+ uint64_t magma_size = size;
+ if (magma_create_buffer(magma_connection(device), magma_size, &magma_size, &buffer) != 0) {
+ DLOG("magma_system_alloc failed size 0x%zx", magma_size);
+ return 0;
+ }
+ DLOG("magma_system_alloc size 0x%zx returning buffer 0x%lx", magma_size, buffer);
+
+ DASSERT(buffer != 0);
+ return buffer;
+}
+
+void anv_gem_close(anv_device* device, anv_buffer_handle_t handle)
+{
+ DLOG("anv_gem_close handle 0x%lx", handle);
+ magma_release_buffer(magma_connection(device), handle);
+}
+
+void* anv_gem_mmap(anv_device* device, anv_buffer_handle_t handle, uint64_t offset, uint64_t size,
+ uint32_t flags)
+{
+ DASSERT(flags == 0);
+ void* addr;
+ magma_status_t status = magma_map(magma_connection(device), handle, &addr);
+ if (status != MAGMA_STATUS_OK) {
+ DLOG("magma_system_map failed: status %d", status);
+ return MAP_FAILED;
+ }
+ DLOG("magma_system_map handle 0x%lx size 0x%zx returning %p", handle, size, addr);
+ return reinterpret_cast<uint8_t*>(addr) + offset;
+}
+
+void anv_gem_munmap(anv_device* device, anv_buffer_handle_t gem_handle, void* addr, uint64_t size)
+{
+ if (!addr)
+ return;
+
+ if (magma_unmap(magma_connection(device), gem_handle) != 0) {
+ DLOG("magma_system_unmap failed");
+ return;
+ }
+
+ DLOG("magma_system_unmap handle 0x%lx", gem_handle);
+}
+
+uint32_t anv_gem_userptr(anv_device* device, void* mem, size_t size)
+{
+ DLOG("anv_gem_userptr - STUB");
+ DASSERT(false);
+ return 0;
+}
+
+int anv_gem_set_caching(anv_device* device, anv_buffer_handle_t gem_handle, uint32_t caching)
+{
+ DLOG("anv_get_set_caching - STUB");
+ return 0;
+}
+
+int anv_gem_set_domain(anv_device* device, anv_buffer_handle_t gem_handle, uint32_t read_domains,
+ uint32_t write_domain)
+{
+ DLOG("anv_gem_set_domain - STUB");
+ return 0;
+}
+
+/**
+ * On error, \a timeout_ns holds the remaining time.
+ */
+int anv_gem_wait(anv_device* device, anv_buffer_handle_t handle, int64_t* timeout_ns)
+{
+ DLOG("anv_gem_wait buffer_id %lu timeout_ns %lu\n", magma_get_buffer_id(handle), *timeout_ns);
+
+ magma::InflightList* inflight_list =
+ static_cast<Connection*>(device->connection)->inflight_list();
+
+ auto start = std::chrono::high_resolution_clock::now();
+
+ while (inflight_list->is_inflight(magma_get_buffer_id(handle)) &&
+ std::chrono::duration_cast<std::chrono::nanoseconds>(
+ std::chrono::high_resolution_clock::now() - start)
+ .count() < *timeout_ns) {
+
+ if (inflight_list->WaitForCompletion(magma::ns_to_ms(*timeout_ns))) {
+ inflight_list->ServiceCompletions(magma_connection(device));
+ }
+ }
+
+ return 0;
+}
+
+/**
+ * Returns 0, 1, or negative to indicate error
+ */
+int anv_gem_busy(anv_device* device, anv_buffer_handle_t handle)
+{
+ DLOG("anv_gem_busy\n");
+
+ magma::InflightList* inflight_list =
+ static_cast<Connection*>(device->connection)->inflight_list();
+
+ inflight_list->ServiceCompletions(magma_connection(device));
+
+ return inflight_list->is_inflight(magma_get_buffer_id(handle)) ? 1 : 0;
+}
+
+bool anv_gem_supports_48b_addresses(int fd)
+{
+ uint64_t gtt_size;
+ magma_status_t status = magma_query(fd, kMsdIntelGenQueryGttSize, >t_size);
+ if (status != MAGMA_STATUS_OK)
+ return DRETF(false, "magma_query failed: %d", status);
+ return gtt_size >= 1ul << 48;
+}
+
+int anv_gem_get_context_param(int fd, int context, uint32_t param, uint64_t* value)
+{
+ magma_status_t status;
+ switch (param) {
+ case I915_CONTEXT_PARAM_GTT_SIZE:
+ status = magma_query(fd, kMsdIntelGenQueryGttSize, value);
+ if (status != MAGMA_STATUS_OK)
+ return DRET_MSG(-1, "magma_query failed: %d", status);
+ return 0;
+ default:
+ return DRET_MSG(-1, "anv_gem_get_context_param: unhandled param 0x%x", param);
+ }
+}
+
+int anv_gem_execbuffer(anv_device* device, drm_i915_gem_execbuffer2* execbuf)
+{
+ DLOG("anv_gem_execbuffer");
+
+ if (execbuf->buffer_count == 0)
+ return 0;
+
+ uint32_t syncobj_count = execbuf->num_cliprects;
+
+ uint64_t required_size = DrmCommandBuffer::RequiredSize(execbuf, syncobj_count);
+
+ uint64_t cmd_buf_id;
+ magma_status_t status =
+ magma_create_command_buffer(magma_connection(device), required_size, &cmd_buf_id);
+ if (status != MAGMA_STATUS_OK)
+ return DRET_MSG(-1, "magma_alloc_command_buffer failed size 0x%" PRIx64 " : %d",
+ required_size, status);
+
+ void* cmd_buf_data;
+ status = magma_map(magma_connection(device), cmd_buf_id, &cmd_buf_data);
+ if (status != MAGMA_STATUS_OK) {
+ magma_release_command_buffer(magma_connection(device), cmd_buf_id);
+ return DRET_MSG(-1, "magma_system_map failed: %d", status);
+ }
+
+ std::vector<uint64_t> wait_semaphore_ids;
+ std::vector<uint64_t> signal_semaphore_ids;
+
+ for (uint32_t i = 0; i < syncobj_count; i++) {
+ auto& syncobj = reinterpret_cast<drm_i915_gem_exec_fence*>(execbuf->cliprects_ptr)[i];
+ if (syncobj.flags & I915_EXEC_FENCE_WAIT) {
+ wait_semaphore_ids.push_back(magma_get_semaphore_id(syncobj.handle));
+ } else if (syncobj.flags & I915_EXEC_FENCE_SIGNAL) {
+ signal_semaphore_ids.push_back(magma_get_semaphore_id(syncobj.handle));
+ } else {
+ return DRET_MSG(-1, "syncobj not wait or signal");
+ }
+ }
+
+ if (!DrmCommandBuffer::Translate(execbuf, std::move(wait_semaphore_ids),
+ std::move(signal_semaphore_ids), cmd_buf_data)) {
+ status = magma_unmap(magma_connection(device), cmd_buf_id);
+ DASSERT(status == MAGMA_STATUS_OK);
+ magma_release_command_buffer(magma_connection(device), cmd_buf_id);
+ return DRET_MSG(-1, "DrmCommandBuffer::Translate failed");
+ }
+
+ status = magma_unmap(magma_connection(device), cmd_buf_id);
+ DASSERT(status == MAGMA_STATUS_OK);
+
+ magma_submit_command_buffer(magma_connection(device), cmd_buf_id, device->context_id);
+
+ magma::InflightList* inflight_list =
+ static_cast<Connection*>(device->connection)->inflight_list();
+
+ for (uint32_t i = 0; i < execbuf->buffer_count; i++) {
+ inflight_list->add(magma_get_buffer_id(
+ reinterpret_cast<drm_i915_gem_exec_object2*>(execbuf->buffers_ptr)[i].handle));
+ }
+
+ inflight_list->ServiceCompletions(magma_connection(device));
+
+ return 0;
+}
+
+int anv_gem_set_tiling(anv_device* device, anv_buffer_handle_t gem_handle, uint32_t stride,
+ uint32_t tiling)
+{
+ DLOG("anv_gem_set_tiling - STUB");
+ return 0;
+}
+
+int anv_gem_get_param(int fd, uint32_t param)
+{
+ magma_status_t status = MAGMA_STATUS_OK;
+ uint64_t value;
+
+ switch (param) {
+ case I915_PARAM_CHIPSET_ID:
+ status = magma_query(fd, MAGMA_QUERY_DEVICE_ID, &value);
+ break;
+ case I915_PARAM_SUBSLICE_TOTAL:
+ status = magma_query(fd, kMsdIntelGenQuerySubsliceAndEuTotal, &value);
+ value >>= 32;
+ break;
+ case I915_PARAM_EU_TOTAL:
+ status = magma_query(fd, kMsdIntelGenQuerySubsliceAndEuTotal, &value);
+ value = static_cast<uint32_t>(value);
+ break;
+ case I915_PARAM_HAS_WAIT_TIMEOUT:
+ case I915_PARAM_HAS_EXECBUF2:
+ value = 1;
+ break;
+ case I915_PARAM_HAS_EXEC_FENCE_ARRAY: // Used for semaphores
+ value = 1;
+ break;
+ default:
+ status = MAGMA_STATUS_INVALID_ARGS;
+ }
+
+ if (status != MAGMA_STATUS_OK)
+ value = 0;
+
+ uint32_t result = static_cast<uint32_t>(value);
+ DASSERT(result == value);
+ DLOG("anv_gem_get_param(%u, %u) returning %d", fd, param, result);
+ return result;
+}
+
+bool anv_gem_get_bit6_swizzle(int fd, uint32_t tiling)
+{
+ DLOG("anv_gem_get_bit6_swizzle - STUB");
+ return 0;
+}
+
+int anv_gem_create_context(anv_device* device)
+{
+ uint32_t context_id;
+ magma_create_context(magma_connection(device), &context_id);
+ DLOG("magma_system_create_context returned context_id %u", context_id);
+
+ return static_cast<int>(context_id);
+}
+
+int anv_gem_destroy_context(anv_device* device, int context_id)
+{
+ magma_release_context(magma_connection(device), context_id);
+ return 0;
+}
+
+int anv_gem_get_aperture(int fd, uint64_t* size)
+{
+ DLOG("anv_gem_get_aperture - STUB");
+ return 0;
+}
+
+int anv_gem_handle_to_fd(anv_device* device, anv_buffer_handle_t gem_handle)
+{
+ DASSERT(false);
+ return -1;
+}
+
+anv_buffer_handle_t anv_gem_fd_to_handle(anv_device* device, int fd)
+{
+ DASSERT(false);
+ return 0;
+}
+
+int anv_gem_gpu_get_reset_stats(anv_device* device, uint32_t* active, uint32_t* pending)
+{
+ DLOG("anv_gem_gpu_get_reset_stats - STUB");
+ *active = 0;
+ *pending = 0;
+ return 0;
+}
+
+int anv_gem_import_fuchsia_buffer(anv_device* device, uint32_t handle,
+ anv_buffer_handle_t* buffer_out, uint64_t* size_out)
+{
+ magma_status_t status = magma_import(magma_connection(device), handle, buffer_out);
+ if (status != MAGMA_STATUS_OK)
+ return DRET_MSG(-EINVAL, "magma_import failed: %d", status);
+
+ *size_out = magma_get_buffer_size(*buffer_out);
+ return 0;
+}
+
+#if VK_USE_PLATFORM_MAGMA_KHR
+VkResult anv_GetMemoryFuchsiaHandleKHR(VkDevice vk_device,
+ const VkMemoryGetFuchsiaHandleInfoKHR* pGetFuchsiaHandleInfo,
+ uint32_t* pHandle)
+{
+ ANV_FROM_HANDLE(anv_device, device, vk_device);
+ ANV_FROM_HANDLE(anv_device_memory, memory, pGetFuchsiaHandleInfo->memory);
+
+ assert(pGetFuchsiaHandleInfo->sType == VK_STRUCTURE_TYPE_MEMORY_GET_FUCHSIA_HANDLE_INFO_KHR);
+ assert(pGetFuchsiaHandleInfo->handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_FUCHSIA_VMO_BIT_KHR);
+
+ auto result = magma_export(magma_connection(device), memory->bo->gem_handle, pHandle);
+ DASSERT(result == MAGMA_STATUS_OK);
+
+ return VK_SUCCESS;
+}
+
+VkResult anv_GetMemoryFuchsiaHandlePropertiesKHR(
+ VkDevice vk_device, VkExternalMemoryHandleTypeFlagBitsKHR handleType, uint32_t handle,
+ VkMemoryFuchsiaHandlePropertiesKHR* pMemoryFuchsiaHandleProperties)
+{
+ ANV_FROM_HANDLE(anv_device, device, vk_device);
+
+ assert(handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_FUCHSIA_VMO_BIT_KHR);
+ assert(pMemoryFuchsiaHandleProperties->sType ==
+ VK_STRUCTURE_TYPE_MEMORY_FUCHSIA_HANDLE_PROPERTIES_KHR);
+
+ struct anv_physical_device* pdevice = &device->instance->physicalDevice;
+ // All memory types supported
+ pMemoryFuchsiaHandleProperties->memoryTypeBits = (1ull << pdevice->memory.type_count) - 1;
+
+ return VK_SUCCESS;
+}
+
+/* Similar to anv_ImportSemaphoreFdKHR */
+VkResult anv_ImportSemaphoreFuchsiaHandleKHR(VkDevice vk_device,
+ const VkImportSemaphoreFuchsiaHandleInfoKHR* info)
+{
+ assert(info->sType == VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FUCHSIA_HANDLE_INFO_KHR);
+ assert(info->handleType == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_FUCHSIA_FENCE_BIT_KHR);
+
+ ANV_FROM_HANDLE(anv_device, device, vk_device);
+ ANV_FROM_HANDLE(anv_semaphore, semaphore, info->semaphore);
+
+ magma_semaphore_t magma_semaphore;
+ magma_status_t status =
+ magma_import_semaphore(magma_connection(device), info->handle, &magma_semaphore);
+ if (status != MAGMA_STATUS_OK)
+ return vk_error(VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR);
+
+ anv_semaphore_impl new_impl = {.type = ANV_SEMAPHORE_TYPE_DRM_SYNCOBJ};
+ new_impl.syncobj = magma_semaphore;
+
+ if (info->flags & VK_SEMAPHORE_IMPORT_TEMPORARY_BIT_KHR) {
+ anv_semaphore_impl_cleanup(device, &semaphore->temporary);
+ semaphore->temporary = new_impl;
+ } else {
+ anv_semaphore_impl_cleanup(device, &semaphore->permanent);
+ semaphore->permanent = new_impl;
+ }
+
+ return VK_SUCCESS;
+}
+
+/* Similar to anv_GetSemaphoreFdKHR */
+VkResult anv_GetSemaphoreFuchsiaHandleKHR(VkDevice vk_device,
+ const VkSemaphoreGetFuchsiaHandleInfoKHR* info,
+ uint32_t* pFuchsiaHandle)
+{
+ ANV_FROM_HANDLE(anv_device, device, vk_device);
+ ANV_FROM_HANDLE(anv_semaphore, semaphore, info->semaphore);
+
+ assert(info->sType == VK_STRUCTURE_TYPE_SEMAPHORE_GET_FUCHSIA_HANDLE_INFO_KHR);
+
+ if (info->handleType != VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_FUCHSIA_FENCE_BIT_KHR)
+ return VK_SUCCESS;
+
+ anv_semaphore_impl* impl = semaphore->temporary.type != ANV_SEMAPHORE_TYPE_NONE
+ ? &semaphore->temporary
+ : &semaphore->permanent;
+
+ uint32_t handle;
+ magma_status_t status =
+ magma_export_semaphore(magma_connection(device), impl->syncobj, &handle);
+ if (status != MAGMA_STATUS_OK)
+ return vk_error(VK_ERROR_TOO_MANY_OBJECTS);
+
+ /* From the Vulkan 1.0.53 spec:
+ *
+ * "Export operations have the same transference as the specified handle
+ * type’s import operations. [...] If the semaphore was using a
+ * temporarily imported payload, the semaphore’s prior permanent payload
+ * will be restored.
+ */
+ anv_semaphore_reset_temporary(device, semaphore);
+
+ *pFuchsiaHandle = handle;
+ return VK_SUCCESS;
+}
+#endif // VK_USE_PLATFORM_MAGMA_KHR
+
+bool anv_gem_supports_syncobj_wait(int fd) { return true; }
+
+anv_syncobj_handle_t anv_gem_syncobj_create(anv_device* device, uint32_t flags)
+{
+ magma_semaphore_t semaphore;
+ magma_status_t status = magma_create_semaphore(magma_connection(device), &semaphore);
+ if (status != MAGMA_STATUS_OK) {
+ DLOG("magma_create_semaphore failed: %d", status);
+ return 0;
+ }
+ if (flags & DRM_SYNCOBJ_CREATE_SIGNALED)
+ magma_signal_semaphore(semaphore);
+ return semaphore;
+}
+
+void anv_gem_syncobj_destroy(anv_device* device, anv_syncobj_handle_t semaphore)
+{
+ magma_release_semaphore(magma_connection(device), semaphore);
+}
+
+void anv_gem_syncobj_reset(anv_device* device, anv_syncobj_handle_t fence)
+{
+ magma_reset_semaphore(fence);
+}
+
+static uint64_t gettime_ns(void)
+{
+ struct timespec current;
+ clock_gettime(CLOCK_MONOTONIC, ¤t);
+#define NSEC_PER_SEC 1000000000
+ return (uint64_t)current.tv_sec * NSEC_PER_SEC + current.tv_nsec;
+#undef NSEC_PER_SEC
+}
+
+static int64_t anv_get_relative_timeout(uint64_t abs_timeout)
+{
+ uint64_t now = gettime_ns();
+
+ if (abs_timeout < now)
+ return 0;
+ return abs_timeout - now;
+}
+
+int anv_gem_syncobj_wait(anv_device* device, anv_syncobj_handle_t* fences, uint32_t fence_count,
+ int64_t abs_timeout_ns, bool wait_all)
+{
+ int64_t timeout_ns = anv_get_relative_timeout(abs_timeout_ns);
+ magma_status_t status =
+ magma_wait_semaphores(fences, fence_count, magma::ns_to_ms(timeout_ns), wait_all);
+ switch (status) {
+ case MAGMA_STATUS_OK:
+ break;
+ case MAGMA_STATUS_TIMED_OUT:
+ errno = ETIME;
+ // fall through
+ default:
+ return -1;
+ }
+ return 0;
+}
+
+anv_syncobj_handle_t anv_gem_syncobj_fd_to_handle(struct anv_device* device, int fd)
+{
+ DASSERT(false);
+ return 0;
+}
+
+int anv_gem_syncobj_handle_to_fd(struct anv_device* device, anv_syncobj_handle_t handle)
+{
+ DASSERT(false);
+ return -1;
+}
+
+int anv_gem_syncobj_export_sync_file(struct anv_device* device, anv_syncobj_handle_t handle)
+{
+ DASSERT(false);
+ return -1;
+}
+
+int anv_gem_syncobj_import_sync_file(struct anv_device* device, anv_syncobj_handle_t handle, int fd)
+{
+ DASSERT(false);
+ return -1;
+}
+
+int anv_gem_sync_file_merge(anv_device* device, int fd1, int fd2)
+{
+ DASSERT(false);
+ return -1;
+}
+
+int anv_gem_set_context_param(int fd, int context, uint32_t param, uint64_t value)
+{
+ DASSERT(false);
+ return -1;
+}
+
+bool anv_gem_has_context_priority(int fd)
+{
+ return false;
+}
diff --git a/src/intel/vulkan/anv_magma.h b/src/intel/vulkan/anv_magma.h
new file mode 100644
index 0000000..ebdd8d0
--- /dev/null
+++ b/src/intel/vulkan/anv_magma.h
@@ -0,0 +1,41 @@
+// Copyright 2018 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ANV_MAGMA_H
+#define ANV_MAGMA_H
+
+#include "magma.h"
+#include "magma_util/dlog.h"
+#include "magma_util/inflight_list.h"
+#include "magma_util/macros.h"
+// clang-format off
+#include "anv_private.h"
+// clang-format on
+
+class Connection : public anv_connection {
+public:
+ Connection(magma_connection_t* magma_connection)
+ : magma_connection_(magma_connection), inflight_list_(magma_connection)
+ {
+ }
+
+ ~Connection() { magma_release_connection(magma_connection_); }
+
+ magma_connection_t* magma_connection() { return magma_connection_; }
+
+ magma::InflightList* inflight_list() { return &inflight_list_; }
+
+private:
+ magma_connection_t* magma_connection_;
+ magma::InflightList inflight_list_;
+};
+
+static magma_connection_t* magma_connection(anv_device* device)
+{
+ DASSERT(device);
+ DASSERT(device->connection);
+ return static_cast<Connection*>(device->connection)->magma_connection();
+}
+
+#endif // ANV_MAGMA_H
diff --git a/src/intel/vulkan/anv_platform.cc b/src/intel/vulkan/anv_platform.cc
new file mode 100644
index 0000000..b279cf5
--- /dev/null
+++ b/src/intel/vulkan/anv_platform.cc
@@ -0,0 +1,30 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "magma_util/dlog.h"
+#include "magma_util/macros.h"
+#include "platform_futex.h"
+#include <errno.h>
+
+extern "C" {
+
+int anv_platform_futex_wake(uint32_t* addr, int count)
+{
+ if (!magma::PlatformFutex::Wake(addr, count))
+ return DRET_MSG(-1, "Wake failed");
+ return 0;
+}
+
+int anv_platform_futex_wait(uint32_t* addr, int32_t value)
+{
+ magma::PlatformFutex::WaitResult result;
+ if (!magma::PlatformFutex::WaitForever(addr, value, &result))
+ return DRET_MSG(-EINVAL, "WaitForever failed");
+ if (result == magma::PlatformFutex::WaitResult::RETRY)
+ return -EAGAIN;
+ assert(result == magma::PlatformFutex::WaitResult::AWOKE);
+ return 0;
+}
+
+} // extern "C"
\ No newline at end of file
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 1e7c87c..f5ec764 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -31,6 +31,7 @@
#include <assert.h>
#include <stdint.h>
#include <i915_drm.h>
+#include <sys/mman.h> // for MAP_FAILED
#ifdef HAVE_VALGRIND
#include <valgrind.h>
@@ -77,6 +78,10 @@
#include <vulkan/vk_icd.h>
#include <vulkan/vk_android_native_buffer.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "anv_entrypoints.h"
#include "anv_extensions.h"
#include "isl/isl.h"
@@ -515,7 +520,7 @@
const VkAllocationCallbacks *alloc,
VkSystemAllocationScope scope)
{
- void *ptr = vk_alloc(alloc, ma->size, ma->align, scope);
+ uint8_t *ptr = (uint8_t*) vk_alloc(alloc, ma->size, ma->align, scope);
if (!ptr)
return NULL;
@@ -555,12 +560,15 @@
return anv_multialloc_alloc(ma, alloc ? alloc : parent_alloc, scope);
}
+typedef uintptr_t anv_buffer_handle_t;
+typedef uintptr_t anv_syncobj_handle_t;
+
/* Extra ANV-defined BO flags which won't be passed to the kernel */
#define ANV_BO_EXTERNAL (1ull << 31)
#define ANV_BO_FLAG_MASK (1ull << 31)
struct anv_bo {
- uint32_t gem_handle;
+ anv_buffer_handle_t gem_handle;
/* Index into the current validation list. This is used by the
* validation list building alrogithm to track which buffers are already
@@ -576,13 +584,18 @@
uint64_t size;
void *map;
-
+
/** Flags to pass to the kernel through drm_i915_exec_object2::flags */
uint32_t flags;
+
+ /* Since vulkan sub-allocates from large buffer pools, track the offset
+ * where this buffer starts within the system buffer.
+ */
+ uint64_t start_offset;
};
static inline void
-anv_bo_init(struct anv_bo *bo, uint32_t gem_handle, uint64_t size)
+anv_bo_init(struct anv_bo *bo, anv_buffer_handle_t gem_handle, uint64_t size)
{
bo->gem_handle = gem_handle;
bo->index = 0;
@@ -590,6 +603,7 @@
bo->size = size;
bo->map = NULL;
bo->flags = 0;
+ bo->start_offset = 0;
}
/* Represents a lock-free linked list of "free" things. This is used by
@@ -647,7 +661,6 @@
* In particular, map == bo.map + center_offset
*/
void *map;
- int fd;
/**
* Array of mmaps and gem handles owned by the block pool, reclaimed when
@@ -807,6 +820,9 @@
struct anv_bo_cache *cache,
int fd, uint64_t bo_flags,
struct anv_bo **bo);
+VkResult anv_bo_cache_import_buffer_handle(struct anv_device* device, struct anv_bo_cache* cache,
+ anv_buffer_handle_t gem_handle, uint64_t bo_flags,
+ uint64_t import_size, struct anv_bo** bo_out);
VkResult anv_bo_cache_export(struct anv_device *device,
struct anv_bo_cache *cache,
struct anv_bo *bo_in, int *fd_out);
@@ -838,7 +854,7 @@
struct anv_instance * instance;
uint32_t chipset_id;
bool no_hw;
- char path[20];
+ char path[64];
const char * name;
struct gen_device_info info;
/** Amount of "GPU memory" we want to advertise
@@ -970,6 +986,11 @@
uint32_t prog_data_size,
const struct anv_pipeline_bind_map *bind_map);
+/* May be extended by the anv_gem implementation */
+struct anv_connection {
+ uint32_t unused;
+};
+
struct anv_device {
VK_LOADER_DATA _loader_data;
@@ -1017,10 +1038,13 @@
uint32_t default_mocs;
uint32_t external_mocs;
+ uint32_t uncached_mocs;
pthread_mutex_t mutex;
pthread_cond_t queue_submit;
bool lost;
+
+ struct anv_connection* connection;
};
static inline struct anv_state_pool *
@@ -1064,28 +1088,33 @@
gen_flush_range(state.map, state.alloc_size);
}
+/* anv_semaphore defined below */
+struct anv_semaphore;
+typedef struct anv_semaphore* anv_semaphore_t;
+
void anv_device_init_blorp(struct anv_device *device);
void anv_device_finish_blorp(struct anv_device *device);
-VkResult anv_device_execbuf(struct anv_device *device,
- struct drm_i915_gem_execbuffer2 *execbuf,
- struct anv_bo **execbuf_bos);
+VkResult anv_device_execbuf(struct anv_device* device, struct drm_i915_gem_execbuffer2* execbuf,
+ struct anv_bo** execbuf_bos);
VkResult anv_device_query_status(struct anv_device *device);
VkResult anv_device_bo_busy(struct anv_device *device, struct anv_bo *bo);
VkResult anv_device_wait(struct anv_device *device, struct anv_bo *bo,
- int64_t timeout);
+ int64_t timeout);
+
+int anv_gem_connect(struct anv_device* device);
+void anv_gem_disconnect(struct anv_device* device);
-void* anv_gem_mmap(struct anv_device *device,
- uint32_t gem_handle, uint64_t offset, uint64_t size, uint32_t flags);
-void anv_gem_munmap(void *p, uint64_t size);
-uint32_t anv_gem_create(struct anv_device *device, uint64_t size);
-void anv_gem_close(struct anv_device *device, uint32_t gem_handle);
+void* anv_gem_mmap(struct anv_device* device, anv_buffer_handle_t gem_handle, uint64_t offset,
+ uint64_t size, uint32_t flags);
+void anv_gem_munmap(struct anv_device* device, anv_buffer_handle_t gem_handle, void *p, uint64_t size);
+anv_buffer_handle_t anv_gem_create(struct anv_device* device, uint64_t size);
+void anv_gem_close(struct anv_device* device, anv_buffer_handle_t gem_handle);
uint32_t anv_gem_userptr(struct anv_device *device, void *mem, size_t size);
-int anv_gem_busy(struct anv_device *device, uint32_t gem_handle);
-int anv_gem_wait(struct anv_device *device, uint32_t gem_handle, int64_t *timeout_ns);
-int anv_gem_execbuffer(struct anv_device *device,
- struct drm_i915_gem_execbuffer2 *execbuf);
-int anv_gem_set_tiling(struct anv_device *device, uint32_t gem_handle,
+int anv_gem_busy(struct anv_device *device, anv_buffer_handle_t gem_handle);
+int anv_gem_wait(struct anv_device* device, anv_buffer_handle_t gem_handle, int64_t* timeout_ns);
+int anv_gem_execbuffer(struct anv_device* device, struct drm_i915_gem_execbuffer2* execbuf);
+int anv_gem_set_tiling(struct anv_device* device, anv_buffer_handle_t gem_handle,
uint32_t stride, uint32_t tiling);
int anv_gem_create_context(struct anv_device *device);
bool anv_gem_has_context_priority(int fd);
@@ -1100,26 +1129,30 @@
int anv_gem_get_aperture(int fd, uint64_t *size);
int anv_gem_gpu_get_reset_stats(struct anv_device *device,
uint32_t *active, uint32_t *pending);
-int anv_gem_handle_to_fd(struct anv_device *device, uint32_t gem_handle);
-uint32_t anv_gem_fd_to_handle(struct anv_device *device, int fd);
-int anv_gem_set_caching(struct anv_device *device, uint32_t gem_handle, uint32_t caching);
+int anv_gem_handle_to_fd(struct anv_device *device, anv_buffer_handle_t gem_handle);
+anv_buffer_handle_t anv_gem_fd_to_handle(struct anv_device *device, int fd);
+int anv_gem_set_caching(struct anv_device *device, anv_buffer_handle_t gem_handle, uint32_t caching);
int anv_gem_set_domain(struct anv_device *device, uint32_t gem_handle,
uint32_t read_domains, uint32_t write_domain);
int anv_gem_sync_file_merge(struct anv_device *device, int fd1, int fd2);
-uint32_t anv_gem_syncobj_create(struct anv_device *device, uint32_t flags);
-void anv_gem_syncobj_destroy(struct anv_device *device, uint32_t handle);
-int anv_gem_syncobj_handle_to_fd(struct anv_device *device, uint32_t handle);
-uint32_t anv_gem_syncobj_fd_to_handle(struct anv_device *device, int fd);
+anv_syncobj_handle_t anv_gem_syncobj_create(struct anv_device *device, uint32_t flags);
+void anv_gem_syncobj_destroy(struct anv_device *device, anv_syncobj_handle_t handle);
+int anv_gem_syncobj_handle_to_fd(struct anv_device *device, anv_syncobj_handle_t handle);
+anv_syncobj_handle_t anv_gem_syncobj_fd_to_handle(struct anv_device *device, int fd);
int anv_gem_syncobj_export_sync_file(struct anv_device *device,
- uint32_t handle);
+ anv_syncobj_handle_t handle);
int anv_gem_syncobj_import_sync_file(struct anv_device *device,
- uint32_t handle, int fd);
-void anv_gem_syncobj_reset(struct anv_device *device, uint32_t handle);
+ anv_syncobj_handle_t handle, int fd);
+void anv_gem_syncobj_reset(struct anv_device *device, anv_syncobj_handle_t handle);
bool anv_gem_supports_syncobj_wait(int fd);
int anv_gem_syncobj_wait(struct anv_device *device,
- uint32_t *handles, uint32_t num_handles,
+ anv_syncobj_handle_t *handles, uint32_t num_handles,
int64_t abs_timeout_ns, bool wait_all);
+int anv_platform_futex_wake(uint32_t *addr, int count);
+int anv_platform_futex_wait(uint32_t *addr, int32_t value);
+int anv_gem_import_fuchsia_buffer(struct anv_device *device, uint32_t handle, anv_buffer_handle_t* buffer_out, uint64_t* size_out);
+
bool anv_vma_alloc(struct anv_device *device, struct anv_bo *bo);
void anv_vma_free(struct anv_device *device, struct anv_bo *bo);
@@ -1606,7 +1639,7 @@
anv_descriptor_set_write_template(struct anv_descriptor_set *set,
struct anv_device *device,
struct anv_state_stream *alloc_stream,
- const struct anv_descriptor_update_template *template,
+ const struct anv_descriptor_update_template *update_template,
const void *data);
VkResult
@@ -1739,10 +1772,10 @@
ANV_PIPE_TEXTURE_CACHE_INVALIDATE_BIT | \
ANV_PIPE_INSTRUCTION_CACHE_INVALIDATE_BIT)
-static inline enum anv_pipe_bits
+static inline uint32_t
anv_pipe_flush_bits_for_access_flags(VkAccessFlags flags)
{
- enum anv_pipe_bits pipe_bits = 0;
+ uint32_t pipe_bits = 0;
unsigned b;
for_each_bit(b, flags) {
@@ -1771,10 +1804,10 @@
return pipe_bits;
}
-static inline enum anv_pipe_bits
+static inline uint32_t
anv_pipe_invalidate_bits_for_access_flags(VkAccessFlags flags)
{
- enum anv_pipe_bits pipe_bits = 0;
+ uint32_t pipe_bits = 0;
unsigned b;
for_each_bit(b, flags) {
@@ -2123,8 +2156,8 @@
void anv_cmd_buffer_add_secondary(struct anv_cmd_buffer *primary,
struct anv_cmd_buffer *secondary);
void anv_cmd_buffer_prepare_execbuf(struct anv_cmd_buffer *cmd_buffer);
-VkResult anv_cmd_buffer_execbuf(struct anv_device *device,
- struct anv_cmd_buffer *cmd_buffer,
+VkResult anv_cmd_buffer_execbuf(struct anv_device* device,
+ struct anv_cmd_buffer* cmd_buffer,
const VkSemaphore *in_semaphores,
uint32_t num_in_semaphores,
const VkSemaphore *out_semaphores,
@@ -2230,7 +2263,7 @@
} bo;
/** DRM syncobj handle for syncobj-based fences */
- uint32_t syncobj;
+ anv_syncobj_handle_t syncobj;
/** WSI fence */
struct wsi_fence *fence_wsi;
@@ -2288,7 +2321,7 @@
* Unlike GEM BOs, DRM sync objects aren't deduplicated by the kernel on
* import so we don't need to bother with a userspace cache.
*/
- uint32_t syncobj;
+ anv_syncobj_handle_t syncobj;
};
};
@@ -2312,6 +2345,8 @@
void anv_semaphore_reset_temporary(struct anv_device *device,
struct anv_semaphore *semaphore);
+void anv_semaphore_impl_cleanup(struct anv_device *device,
+ struct anv_semaphore_impl *impl);
struct anv_shader_module {
unsigned char sha1[20];
@@ -2319,17 +2354,23 @@
char data[0];
};
+#ifdef __cplusplus
+#define ENUM_FROM_INT(type, val) static_cast<type>(val)
+#else
+#define ENUM_FROM_INT(type, val) (val)
+#endif
+
static inline gl_shader_stage
vk_to_mesa_shader_stage(VkShaderStageFlagBits vk_stage)
{
assert(__builtin_popcount(vk_stage) == 1);
- return ffs(vk_stage) - 1;
+ return ENUM_FROM_INT(gl_shader_stage, ffs(vk_stage) - 1);
}
static inline VkShaderStageFlagBits
mesa_to_vk_shader_stage(gl_shader_stage mesa_stage)
{
- return (1 << mesa_stage);
+ return ENUM_FROM_INT(VkShaderStageFlagBits, 1 << mesa_stage);
}
#define ANV_STAGE_MASK ((1 << MESA_SHADER_STAGES) - 1)
@@ -2612,7 +2653,7 @@
anv_get_isl_format(const struct gen_device_info *devinfo, VkFormat vk_format,
VkImageAspectFlags aspect, VkImageTiling tiling)
{
- return anv_get_format_plane(devinfo, vk_format, aspect, tiling).isl_format;
+ return anv_get_format_plane(devinfo, vk_format, (VkImageAspectFlagBits)aspect, tiling).isl_format;
}
static inline struct isl_swizzle
@@ -3369,4 +3410,8 @@
# undef genX
#endif
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif /* ANV_PRIVATE_H */
diff --git a/src/intel/vulkan/anv_queue.c b/src/intel/vulkan/anv_queue.c
index f7fb137..7284c18 100644
--- a/src/intel/vulkan/anv_queue.c
+++ b/src/intel/vulkan/anv_queue.c
@@ -86,7 +86,7 @@
exec2_objects[0].offset = bo.offset;
exec2_objects[0].flags = bo.flags;
exec2_objects[0].rsvd1 = 0;
- exec2_objects[0].rsvd2 = 0;
+ exec2_objects[0].rsvd2 = bo.size;
execbuf.buffers_ptr = (uintptr_t) exec2_objects;
execbuf.buffer_count = 1;
@@ -491,7 +491,7 @@
bool waitAll,
uint64_t abs_timeout_ns)
{
- uint32_t *syncobjs = vk_zalloc(&device->alloc,
+ anv_syncobj_handle_t *syncobjs = vk_zalloc(&device->alloc,
sizeof(*syncobjs) * fenceCount, 8,
VK_SYSTEM_ALLOCATION_SCOPE_COMMAND);
if (!syncobjs)
@@ -953,14 +953,17 @@
VkExternalSemaphoreHandleTypeFlagsKHR handleTypes =
export ? export->handleTypes : 0;
+ // Fuchsia: we always need a syncobj.
+ handleTypes |= VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_FUCHSIA_FENCE_BIT_KHR;
+
if (handleTypes == 0) {
/* The DRM execbuffer ioctl always execute in-oder so long as you stay
* on the same ring. Since we don't expose the blit engine as a DMA
* queue, a dummy no-op semaphore is a perfectly valid implementation.
*/
semaphore->permanent.type = ANV_SEMAPHORE_TYPE_DUMMY;
- } else if (handleTypes & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT) {
- assert(handleTypes == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT);
+ } else if ((handleTypes & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR) || (handleTypes & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_FUCHSIA_FENCE_BIT_KHR)) {
+ assert((handleTypes == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR) || (handleTypes == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_FUCHSIA_FENCE_BIT_KHR));
if (device->instance->physicalDevice.has_syncobj) {
semaphore->permanent.type = ANV_SEMAPHORE_TYPE_DRM_SYNCOBJ;
semaphore->permanent.syncobj = anv_gem_syncobj_create(device, 0);
@@ -1001,7 +1004,7 @@
return VK_SUCCESS;
}
-static void
+void
anv_semaphore_impl_cleanup(struct anv_device *device,
struct anv_semaphore_impl *impl)
{
@@ -1087,6 +1090,16 @@
}
break;
+ case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_FUCHSIA_FENCE_BIT_KHR:
+ pExternalSemaphoreProperties->exportFromImportedHandleTypes =
+ VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_FUCHSIA_FENCE_BIT_KHR;
+ pExternalSemaphoreProperties->compatibleHandleTypes =
+ VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_FUCHSIA_FENCE_BIT_KHR;
+ pExternalSemaphoreProperties->externalSemaphoreFeatures =
+ VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT_KHR |
+ VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT_KHR;
+ return;
+
default:
break;
}
@@ -1239,8 +1252,7 @@
* temporarily imported payload, the semaphore’s prior permanent payload
* will be restored.
*/
- if (impl == &semaphore->temporary)
- anv_semaphore_impl_cleanup(device, impl);
+ anv_semaphore_reset_temporary(device, semaphore);
return VK_SUCCESS;
}
diff --git a/src/intel/vulkan/genX_query.c b/src/intel/vulkan/genX_query.c
index 9b1d73b..9da4d9d 100644
--- a/src/intel/vulkan/genX_query.c
+++ b/src/intel/vulkan/genX_query.c
@@ -133,7 +133,7 @@
if (!pool)
return;
- anv_gem_munmap(pool->bo.map, pool->bo.size);
+ anv_gem_munmap(device, pool->bo.gem_handle, pool->bo.map, pool->bo.size);
anv_vma_free(device, &pool->bo);
anv_gem_close(device, pool->bo.gem_handle);
vk_free2(&device->alloc, pAllocator, pool);
diff --git a/src/intel/vulkan/genX_state.c b/src/intel/vulkan/genX_state.c
index d5d5e43..78f15f0 100644
--- a/src/intel/vulkan/genX_state.c
+++ b/src/intel/vulkan/genX_state.c
@@ -99,6 +99,7 @@
#else
device->external_mocs = device->default_mocs;
#endif
+ device->uncached_mocs = 0;
struct anv_batch batch;
diff --git a/src/intel/vulkan/tests/BUILD.gn b/src/intel/vulkan/tests/BUILD.gn
new file mode 100644
index 0000000..64b2239
--- /dev/null
+++ b/src/intel/vulkan/tests/BUILD.gn
@@ -0,0 +1,95 @@
+# Copyright 2016 The Fuchsia Authors
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+import("../../../../mesa.gni")
+
+group("tests") {
+ public_deps = [
+ ":block_pool_no_free",
+ ":state_pool",
+ ":state_pool_free_list_only",
+ ":state_pool_no_free",
+ ]
+}
+
+executable("block_pool_no_free") {
+ sources = [
+ "block_pool_no_free.c",
+ ]
+
+ configs += [ "$mesa_build_root/src:common_config" ]
+
+ deps = [
+ "$magma_build_root/include:magma_abi",
+ "$magma_build_root/tests/mock:magma_system",
+ "$mesa_build_root/include:c_compat",
+ "$mesa_build_root/include:vulkan",
+ "..:vulkan_internal",
+ ]
+}
+
+executable("state_pool") {
+ sources = [
+ "state_pool.c",
+ ]
+
+ configs += [ "$mesa_build_root/src:common_config" ]
+
+ deps = [
+ "$magma_build_root/include:magma_abi",
+ "$magma_build_root/tests/mock:magma_system",
+ "$mesa_build_root/include:c_compat",
+ "$mesa_build_root/include:vulkan",
+ "..:vulkan_internal",
+ ]
+}
+
+executable("state_pool_free_list_only") {
+ sources = [
+ "state_pool_free_list_only.c",
+ ]
+
+ configs += [ "$mesa_build_root/src:common_config" ]
+
+ deps = [
+ "$magma_build_root/include:magma_abi",
+ "$magma_build_root/tests/mock:magma_system",
+ "$mesa_build_root/include:c_compat",
+ "$mesa_build_root/include:vulkan",
+ "..:vulkan_internal",
+ ]
+}
+
+executable("state_pool_no_free") {
+ sources = [
+ "state_pool_no_free.c",
+ ]
+
+ configs += [ "$mesa_build_root/src:common_config" ]
+
+ deps = [
+ "$magma_build_root/include:magma_abi",
+ "$magma_build_root/tests/mock:magma_system",
+ "$mesa_build_root/include:c_compat",
+ "$mesa_build_root/include:vulkan",
+ "..:vulkan_internal",
+ ]
+}
diff --git a/src/intel/vulkan/tests/block_pool_no_free.c b/src/intel/vulkan/tests/block_pool_no_free.c
index 17006dd3..0589d78 100644
--- a/src/intel/vulkan/tests/block_pool_no_free.c
+++ b/src/intel/vulkan/tests/block_pool_no_free.c
@@ -115,6 +115,8 @@
};
struct anv_block_pool pool;
+ anv_gem_connect(&device);
+
pthread_mutex_init(&device.mutex, NULL);
anv_block_pool_init(&pool, &device, 4096, 4096, 0);
@@ -140,6 +142,8 @@
anv_block_pool_finish(&pool);
pthread_mutex_destroy(&device.mutex);
+
+ anv_gem_disconnect(&device);
}
int main(int argc, char **argv)
diff --git a/src/intel/vulkan/tests/state_pool.c b/src/intel/vulkan/tests/state_pool.c
index cb0e403..3f06519 100644
--- a/src/intel/vulkan/tests/state_pool.c
+++ b/src/intel/vulkan/tests/state_pool.c
@@ -40,6 +40,7 @@
};
struct anv_state_pool state_pool;
+ anv_gem_connect(&device);
pthread_mutex_init(&device.mutex, NULL);
for (unsigned i = 0; i < NUM_RUNS; i++) {
@@ -54,4 +55,5 @@
}
pthread_mutex_destroy(&device.mutex);
+ anv_gem_disconnect(&device);
}
diff --git a/src/intel/vulkan/tests/state_pool_free_list_only.c b/src/intel/vulkan/tests/state_pool_free_list_only.c
index 3ea9e75..7dd39a5 100644
--- a/src/intel/vulkan/tests/state_pool_free_list_only.c
+++ b/src/intel/vulkan/tests/state_pool_free_list_only.c
@@ -39,6 +39,8 @@
};
struct anv_state_pool state_pool;
+ anv_gem_connect(&device);
+
pthread_mutex_init(&device.mutex, NULL);
anv_state_pool_init(&state_pool, &device, 4096, 4096, 0);
@@ -49,7 +51,7 @@
* actually ever resize anything.
*/
{
- struct anv_state states[NUM_THREADS * STATES_PER_THREAD];
+ struct anv_state* states = malloc(sizeof(struct anv_state) * NUM_THREADS * STATES_PER_THREAD);
for (unsigned i = 0; i < NUM_THREADS * STATES_PER_THREAD; i++) {
states[i] = anv_state_pool_alloc(&state_pool, 16, 16);
assert(states[i].offset != 0);
@@ -57,10 +59,14 @@
for (unsigned i = 0; i < NUM_THREADS * STATES_PER_THREAD; i++)
anv_state_pool_free(&state_pool, states[i]);
+
+ free(states);
}
run_state_pool_test(&state_pool);
anv_state_pool_finish(&state_pool);
pthread_mutex_destroy(&device.mutex);
+
+ anv_gem_disconnect(&device);
}
diff --git a/src/intel/vulkan/tests/state_pool_no_free.c b/src/intel/vulkan/tests/state_pool_no_free.c
index 404c8b0..1ff1960 100644
--- a/src/intel/vulkan/tests/state_pool_no_free.c
+++ b/src/intel/vulkan/tests/state_pool_no_free.c
@@ -60,6 +60,8 @@
};
struct anv_state_pool state_pool;
+ anv_gem_connect(&device);
+
pthread_mutex_init(&device.mutex, NULL);
anv_state_pool_init(&state_pool, &device, 4096, 64, 0);
@@ -108,6 +110,8 @@
anv_state_pool_finish(&state_pool);
pthread_mutex_destroy(&device.mutex);
+
+ anv_gem_disconnect(&device);
}
int main(int argc, char **argv)
diff --git a/src/magma/BUILD.gn b/src/magma/BUILD.gn
new file mode 100644
index 0000000..f03fa62
--- /dev/null
+++ b/src/magma/BUILD.gn
@@ -0,0 +1,43 @@
+# Copyright 2016 The Fuchsia Authors
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+import("../../mesa.gni")
+
+config("magma_config") {
+ include_dirs = [
+ ".",
+ "$mesa_build_root/include/drm-uapi",
+ ]
+}
+
+mesa_source_set("magma") {
+ public_configs = [ ":magma_config" ]
+
+ sources = [
+ "drm_command_buffer.cc",
+ "drm_command_buffer.h",
+ ]
+
+ deps = [
+ "$magma_build_root/include:magma_abi",
+ "$magma_build_root/src/magma_util",
+ ]
+}
diff --git a/src/magma/drm_command_buffer.cc b/src/magma/drm_command_buffer.cc
new file mode 100644
index 0000000..6c78afb
--- /dev/null
+++ b/src/magma/drm_command_buffer.cc
@@ -0,0 +1,100 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "drm_command_buffer.h"
+#include "magma.h"
+#include "magma_util/dlog.h"
+#include "magma_util/macros.h"
+
+uint64_t DrmCommandBuffer::RequiredSize(drm_i915_gem_execbuffer2* execbuf,
+ uint32_t semaphore_count)
+{
+ auto execobjects = reinterpret_cast<drm_i915_gem_exec_object2*>(execbuf->buffers_ptr);
+
+ const uint32_t num_resources = execbuf->buffer_count;
+
+ uint32_t num_relocations = 0;
+ for (uint32_t res_index = 0; res_index < num_resources; res_index++) {
+ num_relocations += execobjects[res_index].relocation_count;
+ }
+
+ return sizeof(magma_system_command_buffer) +
+ semaphore_count * sizeof(uint64_t) +
+ sizeof(magma_system_exec_resource) * num_resources +
+ sizeof(magma_system_relocation_entry) * num_relocations;
+}
+
+bool DrmCommandBuffer::Translate(drm_i915_gem_execbuffer2* execbuf,
+ std::vector<uint64_t> wait_semaphore_ids,
+ std::vector<uint64_t> signal_semaphore_ids,
+ void* command_buffer_out)
+{
+ DASSERT((execbuf->flags & I915_EXEC_HANDLE_LUT) != 0);
+
+ auto execobjects = reinterpret_cast<drm_i915_gem_exec_object2*>(execbuf->buffers_ptr);
+ const uint32_t num_resources = execbuf->buffer_count;
+
+ magma_system_command_buffer* command_buffer =
+ reinterpret_cast<magma_system_command_buffer*>(command_buffer_out);
+ uint64_t* dst_wait_semaphore_ids = reinterpret_cast<uint64_t*>(command_buffer + 1);
+ uint64_t* dst_signal_semaphore_ids =
+ reinterpret_cast<uint64_t*>(dst_wait_semaphore_ids + wait_semaphore_ids.size());
+ magma_system_exec_resource* exec_resources = reinterpret_cast<magma_system_exec_resource*>(
+ dst_signal_semaphore_ids + signal_semaphore_ids.size());
+ magma_system_relocation_entry* relocation_entries =
+ reinterpret_cast<magma_system_relocation_entry*>(exec_resources + num_resources);
+
+ for (uint32_t i = 0; i < wait_semaphore_ids.size(); i++) {
+ dst_wait_semaphore_ids[i] = wait_semaphore_ids[i];
+ }
+ for (uint32_t i = 0; i < signal_semaphore_ids.size(); i++) {
+ dst_signal_semaphore_ids[i] = signal_semaphore_ids[i];
+ }
+
+ uint32_t res_reloc_base = 0;
+
+ for (uint32_t res_index = 0; res_index < num_resources; res_index++) {
+ auto dst_res = &exec_resources[res_index];
+ auto src_res = &execobjects[res_index];
+ auto src_res_relocs = reinterpret_cast<drm_i915_gem_relocation_entry*>(src_res->relocs_ptr);
+
+ DLOG("translating res_index %u handle 0x%" PRIx64 " start_offset 0x%" PRIx64
+ " length 0x%" PRIx64,
+ res_index, src_res->handle, src_res->rsvd1, src_res->rsvd2);
+
+ uint32_t num_relocations = dst_res->num_relocations = src_res->relocation_count;
+
+ auto relocations = &relocation_entries[res_reloc_base];
+ dst_res->buffer_id = magma_get_buffer_id(src_res->handle);
+ dst_res->offset = src_res->rsvd1;
+ dst_res->length = src_res->rsvd2;
+
+ for (uint32_t reloc_index = 0; reloc_index < dst_res->num_relocations; reloc_index++) {
+ auto dst_reloc = &relocations[reloc_index];
+ auto src_reloc = &src_res_relocs[reloc_index];
+
+ DLOG("translating reloc_index %u: target_handle 0x%x", reloc_index,
+ src_reloc->target_handle);
+
+ // anvil sends indices for target_handles
+ uint32_t target_index = src_reloc->target_handle;
+ if (target_index >= num_resources)
+ return DRETF(false, "invalid target index %u", src_reloc->target_handle);
+
+ dst_reloc->offset = src_reloc->offset; // offset in the batch buffer;
+ dst_reloc->target_resource_index = src_reloc->target_handle;
+ dst_reloc->target_offset = src_reloc->delta; // offset in the target buffer
+ }
+
+ res_reloc_base += num_relocations;
+ }
+
+ command_buffer->num_resources = num_resources;
+ command_buffer->batch_buffer_resource_index = num_resources - 1; // by drm convention
+ command_buffer->batch_start_offset = execbuf->batch_start_offset;
+ command_buffer->wait_semaphore_count = wait_semaphore_ids.size();
+ command_buffer->signal_semaphore_count = signal_semaphore_ids.size();
+
+ return true;
+}
diff --git a/src/magma/drm_command_buffer.h b/src/magma/drm_command_buffer.h
new file mode 100644
index 0000000..87b718a
--- /dev/null
+++ b/src/magma/drm_command_buffer.h
@@ -0,0 +1,28 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef DRM_COMMAND_BUFFER_H
+#define DRM_COMMAND_BUFFER_H
+
+#include "i915_drm.h"
+#include <vector>
+
+class DrmCommandBuffer {
+public:
+ // Returns the number of bytes needed for the magma_system_command_buffer
+ // and the associated data structures for |execbuf| with |semaphore_count| semaphores.
+ static uint64_t RequiredSize(drm_i915_gem_execbuffer2* execbuf, uint32_t semaphore_count);
+
+ // Writes the magma_system_command_buffer and associated data structures
+ // into |command_buffer_out|. |command_buffer_out| must point to a buffer
+ // that is sufficiently large, see RequiredSize.
+ static bool Translate(drm_i915_gem_execbuffer2* execbuf,
+ std::vector<uint64_t> wait_semaphore_ids,
+ std::vector<uint64_t> signal_semaphore_ids, void* command_buffer_out);
+
+private:
+ DrmCommandBuffer() {}
+};
+
+#endif // DRM_COMMAND_BUFFER_H
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index d718728..a9e37dd 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -41,7 +41,6 @@
#include "main/glheader.h"
#include "main/menums.h"
#include "main/config.h"
-#include "glapi/glapi.h"
#include "math/m_matrix.h" /* GLmatrix */
#include "compiler/shader_enums.h"
#include "compiler/shader_info.h"
diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c
index 2c5bd77..39fb134 100644
--- a/src/mesa/main/version.c
+++ b/src/mesa/main/version.c
@@ -28,7 +28,6 @@
#include "imports.h"
#include "mtypes.h"
#include "version.h"
-#include "git_sha1.h"
/**
* Scans 'string' to see if it ends with 'ending'.
diff --git a/src/mesa/vbo/vbo_context.h b/src/mesa/vbo/vbo_context.h
new file mode 100644
index 0000000..d7ebb6a
--- /dev/null
+++ b/src/mesa/vbo/vbo_context.h
@@ -0,0 +1,251 @@
+/*
+ * mesa 3-D graphics library
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is 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 Software.
+ *
+ * THE SOFTWARE IS 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 SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file vbo_context.h
+ * \brief VBO builder module datatypes and definitions.
+ * \author Keith Whitwell
+ */
+
+
+/**
+ * \mainpage The VBO builder module
+ *
+ * This module hooks into the GL dispatch table and catches all vertex
+ * building and drawing commands, such as glVertex3f, glBegin and
+ * glDrawArrays. The module stores all incoming vertex data as arrays
+ * in GL vertex buffer objects (VBOs), and translates all drawing
+ * commands into calls to a driver supplied DrawPrimitives() callback.
+ *
+ * The module captures both immediate mode and display list drawing,
+ * and manages the allocation, reference counting and deallocation of
+ * vertex buffer objects itself.
+ *
+ * The DrawPrimitives() callback can be either implemented by the
+ * driver itself or hooked to the tnl module's _tnl_draw_primitives()
+ * function for hardware without tnl capablilties or during fallbacks.
+ */
+
+
+#ifndef _VBO_CONTEXT_H
+#define _VBO_CONTEXT_H
+
+#include "vbo.h"
+#include "vbo_attrib.h"
+#include "vbo_exec.h"
+#include "vbo_save.h"
+
+#include "main/api_arrayelt.h"
+#include "main/macros.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct vbo_context {
+ struct gl_vertex_array currval[VBO_ATTRIB_MAX];
+
+ /** Map VERT_ATTRIB_x to VBO_ATTRIB_y */
+ GLubyte map_vp_none[VERT_ATTRIB_MAX];
+ GLubyte map_vp_arb[VERT_ATTRIB_MAX];
+
+ struct vbo_exec_context exec;
+ struct vbo_save_context save;
+
+ /* Callback into the driver. This must always succeed, the driver
+ * is responsible for initiating any fallback actions required:
+ */
+ vbo_draw_func draw_prims;
+
+ /* Optional callback for indirect draws. This allows multidraws to not be
+ * broken up, as well as for the actual count to be passed in as a separate
+ * indirect parameter.
+ */
+ vbo_indirect_draw_func draw_indirect_prims;
+};
+
+
+static inline struct vbo_context *vbo_context(struct gl_context *ctx)
+{
+ return ctx->vbo_context;
+}
+
+
+static inline void
+vbo_exec_invalidate_state(struct gl_context *ctx)
+{
+ struct vbo_context *vbo = vbo_context(ctx);
+ struct vbo_exec_context *exec = &vbo->exec;
+
+ if (ctx->NewState & (_NEW_PROGRAM | _NEW_ARRAY)) {
+ if (!exec->validating)
+ exec->array.recalculate_inputs = GL_TRUE;
+
+ _ae_invalidate_state(ctx);
+ }
+
+ if (ctx->NewState & _NEW_EVAL)
+ exec->eval.recalculate_maps = GL_TRUE;
+}
+
+
+/**
+ * Return VP_x token to indicate whether we're running fixed-function
+ * vertex transformation, an NV vertex program or ARB vertex program/shader.
+ */
+static inline enum vp_mode
+get_program_mode( struct gl_context *ctx )
+{
+ if (!ctx->VertexProgram._Current)
+ return VP_NONE;
+ else if (ctx->VertexProgram._Current == ctx->VertexProgram._TnlProgram)
+ return VP_NONE;
+ else
+ return VP_ARB;
+}
+
+
+/**
+ * This is called by glBegin, glDrawArrays and glDrawElements (and
+ * variations of those calls). When we transition from immediate mode
+ * drawing to array drawing we need to invalidate the array state.
+ *
+ * glBegin/End builds vertex arrays. Those arrays may look identical
+ * to glDrawArrays arrays except that the position of the elements may
+ * be different. For example, arrays of (position3v, normal3f) vs. arrays
+ * of (normal3f, position3f). So we need to make sure we notify drivers
+ * that arrays may be changing.
+ */
+static inline void
+vbo_draw_method(struct vbo_context *vbo, gl_draw_method method)
+{
+ struct gl_context *ctx = vbo->exec.ctx;
+
+ if (ctx->Array.DrawMethod != method) {
+ switch (method) {
+ case DRAW_ARRAYS:
+ ctx->Array._DrawArrays = vbo->exec.array.inputs;
+ break;
+ case DRAW_BEGIN_END:
+ ctx->Array._DrawArrays = vbo->exec.vtx.inputs;
+ break;
+ case DRAW_DISPLAY_LIST:
+ ctx->Array._DrawArrays = vbo->save.inputs;
+ break;
+ default:
+ assert(0);
+ }
+
+ ctx->NewDriverState |= ctx->DriverFlags.NewArray;
+ ctx->Array.DrawMethod = method;
+ }
+}
+
+/**
+ * Return if format is integer. The immediate mode commands only emit floats
+ * for non-integer types, thus everything else is integer.
+ */
+static inline GLboolean
+vbo_attrtype_to_integer_flag(GLenum format)
+{
+ switch (format) {
+ case GL_FLOAT:
+ case GL_DOUBLE:
+ return GL_FALSE;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ case GL_UNSIGNED_INT64_ARB:
+ return GL_TRUE;
+ default:
+ assert(0);
+ return GL_FALSE;
+ }
+}
+
+static inline GLboolean
+vbo_attrtype_to_double_flag(GLenum format)
+{
+ switch (format) {
+ case GL_FLOAT:
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ return GL_FALSE;
+ case GL_UNSIGNED_INT64_ARB:
+ case GL_DOUBLE:
+ return GL_TRUE;
+ default:
+ assert(0);
+ return GL_FALSE;
+ }
+}
+
+/**
+ * Return default component values for the given format.
+ * The return type is an array of fi_types, because that's how we declare
+ * the vertex storage : floats , integers or unsigned integers.
+ */
+static inline const fi_type *
+vbo_get_default_vals_as_union(GLenum format)
+{
+ static const GLfloat default_float[4] = { 0, 0, 0, 1 };
+ static const GLint default_int[4] = { 0, 0, 0, 1 };
+
+ switch (format) {
+ case GL_FLOAT:
+ return (fi_type *)default_float;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ return (fi_type *)default_int;
+ default:
+ assert(0);
+ return NULL;
+ }
+}
+
+
+/**
+ * Compute the max number of vertices which can be stored in
+ * a vertex buffer, given the current vertex size, and the amount
+ * of space already used.
+ */
+static inline unsigned
+vbo_compute_max_verts(const struct vbo_exec_context *exec)
+{
+ unsigned n = (VBO_VERT_BUFFER_SIZE - exec->vtx.buffer_used) /
+ (exec->vtx.vertex_size * sizeof(GLfloat));
+ if (n == 0)
+ return 0;
+ /* Subtract one so we're always sure to have room for an extra
+ * vertex for GL_LINE_LOOP -> GL_LINE_STRIP conversion.
+ */
+ n--;
+ return n;
+}
+
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif
diff --git a/src/util/BUILD.gn b/src/util/BUILD.gn
new file mode 100644
index 0000000..d4b33e9
--- /dev/null
+++ b/src/util/BUILD.gn
@@ -0,0 +1,132 @@
+# Copyright 2016 The Fuchsia Authors
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+import("../../mesa.gni")
+
+config("util_public_config") {
+ include_dirs = [
+ "$mesa_build_root/src",
+ "$mesa_build_root/src/gallium/auxiliary/",
+ "$mesa_build_root/src/gallium/include/",
+ ]
+}
+
+mesa_source_set("headers") {
+ public_configs = [ ":util_public_config" ]
+
+ sources = [
+ "bitset.h",
+ "debug.h",
+ "format_srgb.h",
+ "half_float.h",
+ "hash_table.h",
+ "list.h",
+ "macros.h",
+ "mesa-sha1.h",
+ "ralloc.h",
+ "register_allocate.h",
+ "rgtc.h",
+ "rounding.h",
+ "set.h",
+ "simple_list.h",
+ "sha1/sha1.h",
+ "strndup.h",
+ "strtod.h",
+ "texcompress_rgtc_tmp.h",
+ "u_atomic.h",
+ "u_vector.h",
+ "vma.h",
+ ]
+}
+
+mesa_source_set("util") {
+ include_dirs = [
+ "$mesa_build_root/src/util",
+ "$mesa_build_root/src/mesa/",
+ "$mesa_build_root/src/mapi/",
+ "$mesa_build_root/src/gallium/auxiliary/",
+ ]
+
+ public_deps = [
+ ":gen",
+ ":headers",
+ "$mesa_build_root/include:c_compat",
+ ]
+
+ public_configs = [
+ ":util_public_config",
+ ]
+
+ sources = [
+ "debug.c",
+ "half_float.c",
+ "hash_table.c",
+ "mesa-sha1.c",
+ "ralloc.c",
+ "register_allocate.c",
+ "rgtc.c",
+ "set.c",
+ "sha1/sha1.c",
+ "strtod.c",
+ "u_vector.c",
+ "vma.c",
+ ]
+}
+
+action("format_srgb") {
+ output_name = "format_srgb.c"
+ script_name = "format_srgb.py"
+
+ script = "$mesa_build_root/scripts/gn_script_wrapper.py"
+
+ outputs = [
+ "$target_gen_dir/$output_name",
+ ]
+
+ inputs = [
+ script_name,
+ ]
+
+ args = [
+ "$magma_python_path",
+ rebase_path(target_gen_dir) + "/$output_name",
+ rebase_path(".") + "/$script_name",
+ ]
+}
+
+config("gen_public_config") {
+ include_dirs = [ target_gen_dir ]
+}
+
+mesa_source_set("gen") {
+ public_configs = [ ":gen_public_config" ]
+
+ deps = [
+ ":format_srgb",
+ "$mesa_build_root/include:c_compat",
+ ]
+
+ include_dirs = [ "." ]
+
+ sources = [
+ "$target_gen_dir/format_srgb.c",
+ ]
+}
diff --git a/src/vulkan/registry/vk.xml b/src/vulkan/registry/vk.xml
index 9cd1c72..d70e259 100644
--- a/src/vulkan/registry/vk.xml
+++ b/src/vulkan/registry/vk.xml
@@ -55,6 +55,7 @@
<platform name="vi" protect="VK_USE_PLATFORM_VI_NN" comment="Nintendo Vi"/>
<platform name="ios" protect="VK_USE_PLATFORM_IOS_MVK" comment="Apple IOS"/>
<platform name="macos" protect="VK_USE_PLATFORM_MACOS_MVK" comment="Apple MacOS"/>
+ <platform name="fuchsia" protect="VK_USE_PLATFORM_FUCHSIA" comment="Fuchsia"/>
</platforms>
<tags comment="Vulkan vendor/author tags for extensions and layers">
@@ -99,13 +100,14 @@
<type category="include" name="wayland-client.h"/>
<type category="include" name="windows.h"/>
<type category="include" name="xcb/xcb.h"/>
+ <type category="include" name="zircon/types.h"/>
<comment>
In the current header structure, each platform's interfaces
are confined to a platform-specific header (vulkan_xlib.h,
vulkan_win32.h, etc.). These headers are not self-contained,
and should not include native headers (X11/Xlib.h,
windows.h, etc.). Code should either include vulkan.h after
- defining the appropriate VK_USE_PLATFORM_platform_KHR
+ defining the appropriate VK_USE_PLATFORM_platform
macros, or include the required native headers prior to
explicitly including the corresponding platform header.
@@ -133,6 +135,7 @@
<type requires="xcb/xcb.h" name="xcb_connection_t"/>
<type requires="xcb/xcb.h" name="xcb_visualid_t"/>
<type requires="xcb/xcb.h" name="xcb_window_t"/>
+ <type requires="zircon/types.h" name="zx_handle_t"/>
<type category="define">#define <name>VK_MAKE_VERSION</name>(major, minor, patch) \
(((major) << 22) | ((minor) << 12) | (patch))</type>
@@ -147,7 +150,7 @@
<type category="define">// Vulkan 1.1 version number
#define <name>VK_API_VERSION_1_1</name> <type>VK_MAKE_VERSION</type>(1, 1, 0)// Patch version should always be set to 0</type>
<type category="define">// Version of this file
-#define <name>VK_HEADER_VERSION</name> 84</type>
+#define <name>VK_HEADER_VERSION</name> 89</type>
<type category="define">
#define <name>VK_DEFINE_HANDLE</name>(object) typedef struct object##_T* object;</type>
@@ -179,6 +182,7 @@
<type requires="vk_platform" name="char"/>
<type requires="vk_platform" name="float"/>
<type requires="vk_platform" name="uint8_t"/>
+ <type requires="vk_platform" name="uint16_t"/>
<type requires="vk_platform" name="uint32_t"/>
<type requires="vk_platform" name="uint64_t"/>
<type requires="vk_platform" name="int32_t"/>
@@ -247,6 +251,9 @@
<type requires="VkSubgroupFeatureFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkSubgroupFeatureFlags</name>;</type>
<type requires="VkIndirectCommandsLayoutUsageFlagBitsNVX" category="bitmask">typedef <type>VkFlags</type> <name>VkIndirectCommandsLayoutUsageFlagsNVX</name>;</type>
<type requires="VkObjectEntryUsageFlagBitsNVX" category="bitmask">typedef <type>VkFlags</type> <name>VkObjectEntryUsageFlagsNVX</name>;</type>
+ <type requires="VkGeometryFlagBitsNVX" category="bitmask">typedef <type>VkFlags</type> <name>VkGeometryFlagsNVX</name>;</type>
+ <type requires="VkGeometryInstanceFlagBitsNVX" category="bitmask">typedef <type>VkFlags</type> <name>VkGeometryInstanceFlagsNVX</name>;</type>
+ <type requires="VkBuildAccelerationStructureFlagBitsNVX" category="bitmask">typedef <type>VkFlags</type> <name>VkBuildAccelerationStructureFlagsNVX</name>;</type>
<type category="bitmask">typedef <type>VkFlags</type> <name>VkDescriptorUpdateTemplateCreateFlags</name>;</type>
<type category="bitmask" name="VkDescriptorUpdateTemplateCreateFlagsKHR" alias="VkDescriptorUpdateTemplateCreateFlags"/>
@@ -267,6 +274,7 @@
<type category="bitmask">typedef <type>VkFlags</type> <name>VkXcbSurfaceCreateFlagsKHR</name>;</type>
<type category="bitmask">typedef <type>VkFlags</type> <name>VkIOSSurfaceCreateFlagsMVK</name>;</type>
<type category="bitmask">typedef <type>VkFlags</type> <name>VkMacOSSurfaceCreateFlagsMVK</name>;</type>
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkImagePipeSurfaceCreateFlagsFUCHSIA</name>;</type>
<type requires="VkPeerMemoryFeatureFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkPeerMemoryFeatureFlags</name>;</type>
<type category="bitmask" name="VkPeerMemoryFeatureFlagsKHR" alias="VkPeerMemoryFeatureFlags"/>
<type requires="VkMemoryAllocateFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkMemoryAllocateFlags</name>;</type>
@@ -307,6 +315,8 @@
<type category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineRasterizationConservativeStateCreateFlagsEXT</name>;</type>
<type requires="VkDescriptorBindingFlagBitsEXT" category="bitmask">typedef <type>VkFlags</type> <name>VkDescriptorBindingFlagsEXT</name>;</type>
<type requires="VkConditionalRenderingFlagBitsEXT" category="bitmask">typedef <type>VkFlags</type> <name>VkConditionalRenderingFlagsEXT</name>;</type>
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineRasterizationStateStreamCreateFlagsEXT</name>;</type>
+
<comment>Types which can be void pointers or class pointers, selected at compile time</comment>
<type category="handle"><type>VK_DEFINE_HANDLE</type>(<name>VkInstance</name>)</type>
@@ -341,6 +351,7 @@
<type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkSamplerYcbcrConversion</name>)</type>
<type category="handle" name="VkSamplerYcbcrConversionKHR" alias="VkSamplerYcbcrConversion"/>
<type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkValidationCacheEXT</name>)</type>
+ <type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkAccelerationStructureNVX</name>)</type>
<comment>WSI extensions</comment>
<type category="handle"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkDisplayKHR</name>)</type>
@@ -457,7 +468,14 @@
<type name="VkValidationCacheHeaderVersionEXT" category="enum"/>
<type name="VkShaderInfoTypeAMD" category="enum"/>
<type name="VkQueueGlobalPriorityEXT" category="enum"/>
+ <type name="VkTimeDomainEXT" category="enum"/>
<type name="VkConservativeRasterizationModeEXT" category="enum"/>
+ <type name="VkGeometryFlagBitsNVX" category="enum"/>
+ <type name="VkGeometryInstanceFlagBitsNVX" category="enum"/>
+ <type name="VkBuildAccelerationStructureFlagBitsNVX" category="enum"/>
+ <type name="VkCopyAccelerationStructureModeNVX" category="enum"/>
+ <type name="VkAccelerationStructureTypeNVX" category="enum"/>
+ <type name="VkGeometryTypeNVX" category="enum"/>
<comment>WSI extensions</comment>
<type name="VkColorSpaceKHR" category="enum"/>
@@ -513,8 +531,11 @@
<comment>Enumerated types in the header, but not used by the API</comment>
<type name="VkVendorId" category="enum"/>
+ <type name="VkDriverIdKHR" category="enum"/>
+ <type name="VkShadingRatePaletteEntryNV" category="enum"/>
+ <type name="VkCoarseSampleOrderTypeNV" category="enum"/>
- <comment>The PFN_vk*Function types are used by VkAllocationCallbacks below</comment>
+ <comment>The PFN_vk*Function types are used by VkAllocationCallbacks below</comment>
<type category="funcpointer">typedef void (VKAPI_PTR *<name>PFN_vkInternalAllocationNotification</name>)(
<type>void</type>* pUserData,
<type>size_t</type> size,
@@ -557,7 +578,7 @@
<comment>The PFN_vkDebugUtilsMessengerCallbackEXT type are used by the VK_EXT_debug_utils extension</comment>
<type category="funcpointer" requires="VkDebugUtilsMessengerCallbackDataEXT">typedef VkBool32 (VKAPI_PTR *<name>PFN_vkDebugUtilsMessengerCallbackEXT</name>)(
<type>VkDebugUtilsMessageSeverityFlagBitsEXT</type> messageSeverity,
- <type>VkDebugUtilsMessageTypeFlagsEXT</type> messageType,
+ <type>VkDebugUtilsMessageTypeFlagsEXT</type> messageTypes,
const <type>VkDebugUtilsMessengerCallbackDataEXT</type>* pCallbackData,
<type>void</type>* pUserData);</type>
@@ -1112,7 +1133,7 @@
<member values="VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
<member>const <type>void</type>* <name>pNext</name></member>
<member optional="true"><type>VkPipelineDynamicStateCreateFlags</type> <name>flags</name></member>
- <member><type>uint32_t</type> <name>dynamicStateCount</name></member>
+ <member optional="true"><type>uint32_t</type> <name>dynamicStateCount</name></member>
<member len="dynamicStateCount">const <type>VkDynamicState</type>* <name>pDynamicStates</name></member>
</type>
<type category="struct" name="VkStencilOpState">
@@ -1144,8 +1165,8 @@
<member optional="true"><type>VkPipelineCreateFlags</type> <name>flags</name><comment>Pipeline creation flags</comment></member>
<member><type>uint32_t</type> <name>stageCount</name></member>
<member len="stageCount">const <type>VkPipelineShaderStageCreateInfo</type>* <name>pStages</name><comment>One entry for each active shader stage</comment></member>
- <member>const <type>VkPipelineVertexInputStateCreateInfo</type>* <name>pVertexInputState</name></member>
- <member>const <type>VkPipelineInputAssemblyStateCreateInfo</type>* <name>pInputAssemblyState</name></member>
+ <member noautovalidity="true" optional="true">const <type>VkPipelineVertexInputStateCreateInfo</type>* <name>pVertexInputState</name></member>
+ <member noautovalidity="true" optional="true">const <type>VkPipelineInputAssemblyStateCreateInfo</type>* <name>pInputAssemblyState</name></member>
<member noautovalidity="true" optional="true">const <type>VkPipelineTessellationStateCreateInfo</type>* <name>pTessellationState</name></member>
<member noautovalidity="true" optional="true">const <type>VkPipelineViewportStateCreateInfo</type>* <name>pViewportState</name></member>
<member>const <type>VkPipelineRasterizationStateCreateInfo</type>* <name>pRasterizationState</name></member>
@@ -1664,6 +1685,12 @@
<member noautovalidity="true"><type>xcb_connection_t</type>* <name>connection</name></member>
<member><type>xcb_window_t</type> <name>window</name></member>
</type>
+ <type category="struct" name="VkImagePipeSurfaceCreateInfoFUCHSIA">
+ <member values="VK_STRUCTURE_TYPE_IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member optional="true"><type>VkImagePipeSurfaceCreateFlagsFUCHSIA</type> <name>flags</name></member>
+ <member><type>zx_handle_t</type> <name>imagePipeHandle</name></member>
+ </type>
<type category="struct" name="VkSurfaceFormatKHR" returnedonly="true">
<member><type>VkFormat</type> <name>format</name><comment>Supported pair of rendering format</comment></member>
<member><type>VkColorSpaceKHR</type> <name>colorSpace</name><comment>and color space for the surface</comment></member>
@@ -1960,6 +1987,20 @@
<member><type>void</type>* <name>pNext</name></member>
<member><type>uint32_t</type> <name>maxPushDescriptors</name></member>
</type>
+ <type category="struct" name="VkConformanceVersionKHR">
+ <member><type>uint8_t</type> <name>major</name></member>
+ <member><type>uint8_t</type> <name>minor</name></member>
+ <member><type>uint8_t</type> <name>subminor</name></member>
+ <member><type>uint8_t</type> <name>patch</name></member>
+ </type>
+ <type category="struct" name="VkPhysicalDeviceDriverPropertiesKHR" structextends="VkPhysicalDeviceProperties2" returnedonly="true">
+ <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member>
+ <member><type>VkDriverIdKHR</type> <name>driverID</name></member>
+ <member><type>char</type> <name>driverName</name>[<enum>VK_MAX_DRIVER_NAME_SIZE_KHR</enum>]</member>
+ <member><type>char</type> <name>driverInfo</name>[<enum>VK_MAX_DRIVER_INFO_SIZE_KHR</enum>]</member>
+ <member><type>VkConformanceVersionKHR</type> <name>conformanceVersion</name></member>
+ </type>
<type category="struct" name="VkPresentRegionsKHR" structextends="VkPresentInfoKHR">
<member values="VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR"><type>VkStructureType</type> <name>sType</name></member>
<member>const <type>void</type>* <name>pNext</name></member>
@@ -2056,6 +2097,12 @@
<member><type>DWORD</type> <name>dwAccess</name></member>
<member><type>LPCWSTR</type> <name>name</name></member>
</type>
+ <type category="struct" name="VkImportMemoryFuchsiaHandleInfoKHR" structextends="VkMemoryAllocateInfo">
+ <member values="VK_STRUCTURE_TYPE_IMPORT_MEMORY_FUCHSIA_HANDLE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member optional="true"><type>VkExternalMemoryHandleTypeFlagBits</type> <name>handleType</name></member>
+ <member optional="true"><type>uint32_t</type> <name>handle</name></member>
+ </type>
<type category="struct" name="VkMemoryWin32HandlePropertiesKHR" returnedonly="true">
<member values="VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR"><type>VkStructureType</type> <name>sType</name></member>
<member><type>void</type>* <name>pNext</name></member>
@@ -2084,6 +2131,17 @@
<member><type>VkDeviceMemory</type> <name>memory</name></member>
<member><type>VkExternalMemoryHandleTypeFlagBits</type> <name>handleType</name></member>
</type>
+ <type category="struct" name="VkMemoryFuchsiaHandlePropertiesKHR" returnedonly="true">
+ <member values="VK_STRUCTURE_TYPE_MEMORY_FUCHSIA_HANDLE_PROPERTIES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member>
+ <member><type>uint32_t</type> <name>memoryTypeBits</name></member>
+ </type>
+ <type category="struct" name="VkMemoryGetFuchsiaHandleInfoKHR">
+ <member values="VK_STRUCTURE_TYPE_MEMORY_GET_FUCHSIA_HANDLE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member><type>VkDeviceMemory</type> <name>memory</name></member>
+ <member><type>VkExternalMemoryHandleTypeFlagBits</type> <name>handleType</name></member>
+ </type>
<type category="struct" name="VkWin32KeyedMutexAcquireReleaseInfoKHR" structextends="VkSubmitInfo">
<member values="VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
<member>const <type>void</type>* <name>pNext</name></member>
@@ -2159,6 +2217,20 @@
<member><type>VkSemaphore</type> <name>semaphore</name></member>
<member><type>VkExternalSemaphoreHandleTypeFlagBits</type> <name>handleType</name></member>
</type>
+ <type category="struct" name="VkImportSemaphoreFuchsiaHandleInfoKHR">
+ <member values="VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FUCHSIA_HANDLE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member externsync="true"><type>VkSemaphore</type> <name>semaphore</name></member>
+ <member optional="true"><type>VkSemaphoreImportFlags</type> <name>flags</name></member>
+ <member><type>VkExternalSemaphoreHandleTypeFlagBits</type> <name>handleType</name></member>
+ <member><type>uint32_t</type> <name>handle</name></member>
+ </type>
+ <type category="struct" name="VkSemaphoreGetFuchsiaHandleInfoKHR">
+ <member values="VK_STRUCTURE_TYPE_SEMAPHORE_GET_FUCHSIA_HANDLE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member><type>VkSemaphore</type> <name>semaphore</name></member>
+ <member><type>VkExternalSemaphoreHandleTypeFlagBits</type> <name>handleType</name></member>
+ </type>
<type category="struct" name="VkPhysicalDeviceExternalFenceInfo">
<member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO"><type>VkStructureType</type> <name>sType</name></member>
<member>const <type>void</type>* <name>pNext</name></member>
@@ -2749,10 +2821,10 @@
</type>
<type category="struct" name="VkSampleLocationsInfoEXT" structextends="VkImageMemoryBarrier">
<member values="VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
- <member>const <type>void</type>* <name>pNext</name></member>
- <member><type>VkSampleCountFlagBits</type> <name>sampleLocationsPerPixel</name></member>
- <member><type>VkExtent2D</type> <name>sampleLocationGridSize</name></member>
- <member><type>uint32_t</type> <name>sampleLocationsCount</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member optional="true"><type>VkSampleCountFlagBits</type> <name>sampleLocationsPerPixel</name></member>
+ <member><type>VkExtent2D</type> <name>sampleLocationGridSize</name></member>
+ <member optional="true"><type>uint32_t</type> <name>sampleLocationsCount</name></member>
<member len="sampleLocationsCount">const <type>VkSampleLocationEXT</type>* <name>pSampleLocations</name></member>
</type>
<type category="struct" name="VkAttachmentSampleLocationsEXT">
@@ -2833,7 +2905,7 @@
<member><type>uint32_t</type> <name>maxDescriptorSetInlineUniformBlocks</name></member>
<member><type>uint32_t</type> <name>maxDescriptorSetUpdateAfterBindInlineUniformBlocks</name></member>
</type>
- <type category="struct" name="VkWriteDescriptorSetInlineUniformBlockEXT">
+ <type category="struct" name="VkWriteDescriptorSetInlineUniformBlockEXT" structextends="VkWriteDescriptorSet">
<member values="VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT"><type>VkStructureType</type> <name>sType</name></member>
<member>const <type>void</type>* <name>pNext</name></member>
<member><type>uint32_t</type> <name>dataSize</name></member>
@@ -2853,7 +2925,7 @@
<member><type>uint32_t</type> <name>coverageModulationTableCount</name></member>
<member noautovalidity="true" optional="true" len="coverageModulationTableCount">const <type>float</type>* <name>pCoverageModulationTable</name></member>
</type>
- <type category="struct" name="VkImageFormatListCreateInfoKHR" structextends="VkImageCreateInfo">
+ <type category="struct" name="VkImageFormatListCreateInfoKHR" structextends="VkImageCreateInfo,VkPhysicalDeviceImageFormatInfo2">
<member values="VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
<member>const <type>void</type>* <name>pNext</name></member>
<member optional="true"><type>uint32_t</type> <name>viewFormatCount</name></member>
@@ -2992,6 +3064,11 @@
<member><type>VkBool32</type> <name>fullyCoveredFragmentShaderInputVariable</name><comment>true if the implementation supports the FullyCoveredEXT SPIR-V builtin fragment shader input variable</comment></member>
<member><type>VkBool32</type> <name>conservativeRasterizationPostDepthCoverage</name><comment>true if the implementation supports both conservative rasterization and post depth coverage sample coverage mask</comment></member>
</type>
+ <type category="struct" name="VkCalibratedTimestampInfoEXT">
+ <member values="VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member><type>VkTimeDomainEXT</type> <name>timeDomain</name></member>
+ </type>
<type category="struct" name="VkPhysicalDeviceShaderCorePropertiesAMD" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
<member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD"><type>VkStructureType</type> <name>sType</name></member>
<member><type>void</type>* <name>pNext</name><comment>Pointer to next structure</comment></member>
@@ -3072,7 +3149,7 @@
<member values="VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
<member>const <type>void</type>* <name>pNext</name></member>
<member optional="true"><type>uint32_t</type> <name>bindingCount</name></member>
- <member len="bindingCount">const <type>VkDescriptorBindingFlagsEXT</type>* <name>pBindingFlags</name></member>
+ <member len="bindingCount" optional="true">const <type>VkDescriptorBindingFlagsEXT</type>* <name>pBindingFlags</name></member>
</type>
<type category="struct" name="VkDescriptorSetVariableDescriptorCountAllocateInfoEXT" structextends="VkDescriptorSetAllocateInfo">
<member values="VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
@@ -3169,6 +3246,14 @@
<member><type>void</type>* <name>pNext</name></member>
<member><type>uint32_t</type> <name>maxVertexAttribDivisor</name><comment>max value of vertex attribute divisor</comment></member>
</type>
+ <type category="struct" name="VkPhysicalDevicePCIBusInfoPropertiesEXT" structextends="VkPhysicalDeviceProperties2" returnedonly="true">
+ <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member>
+ <member><type>uint16_t</type> <name>pciDomain</name></member>
+ <member><type>uint8_t</type> <name>pciBus</name></member>
+ <member><type>uint8_t</type> <name>pciDevice</name></member>
+ <member><type>uint8_t</type> <name>pciFunction</name></member>
+ </type>
<type category="struct" name="VkImportAndroidHardwareBufferInfoANDROID" structextends="VkMemoryAllocateInfo">
<member values="VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID"><type>VkStructureType</type> <name>sType</name></member>
<member>const <type>void</type>* <name>pNext</name></member>
@@ -3231,6 +3316,12 @@
<member><type>VkBool32</type> <name>vulkanMemoryModel</name></member>
<member><type>VkBool32</type> <name>vulkanMemoryModelDeviceScope</name></member>
</type>
+ <type category="struct" name="VkPhysicalDeviceShaderAtomicInt64FeaturesKHR" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member>
+ <member><type>VkBool32</type> <name>shaderBufferInt64Atomics</name></member>
+ <member><type>VkBool32</type> <name>shaderSharedInt64Atomics</name></member>
+ </type>
<type category="struct" name="VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
<member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
<member noautovalidity="true"><type>void</type>* <name>pNext</name></member>
@@ -3258,6 +3349,263 @@
<member noautovalidity="true"><type>void</type>* <name>pNext</name></member>
<member><type>VkBool32</type> <name>decodeModeSharedExponent</name></member>
</type>
+ <type category="struct" name="VkPhysicalDeviceTransformFeedbackFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member>
+ <member><type>VkBool32</type> <name>transformFeedback</name></member>
+ <member><type>VkBool32</type> <name>geometryStreams</name></member>
+ </type>
+ <type category="struct" name="VkPhysicalDeviceTransformFeedbackPropertiesEXT" structextends="VkPhysicalDeviceProperties2" returnedonly="true">
+ <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member>
+ <member><type>uint32_t</type> <name>maxTransformFeedbackStreams</name></member>
+ <member><type>uint32_t</type> <name>maxTransformFeedbackBuffers</name></member>
+ <member><type>VkDeviceSize</type> <name>maxTransformFeedbackBufferSize</name></member>
+ <member><type>uint32_t</type> <name>maxTransformFeedbackStreamDataSize</name></member>
+ <member><type>uint32_t</type> <name>maxTransformFeedbackBufferDataSize</name></member>
+ <member><type>uint32_t</type> <name>maxTransformFeedbackBufferDataStride</name></member>
+ <member><type>VkBool32</type> <name>transformFeedbackQueries</name></member>
+ <member><type>VkBool32</type> <name>transformFeedbackStreamsLinesTriangles</name></member>
+ <member><type>VkBool32</type> <name>transformFeedbackRasterizationStreamSelect</name></member>
+ <member><type>VkBool32</type> <name>transformFeedbackDraw</name></member>
+ </type>
+ <type category="struct" name="VkPipelineRasterizationStateStreamCreateInfoEXT" structextends="VkPipelineRasterizationStateCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member optional="true"><type>VkPipelineRasterizationStateStreamCreateFlagsEXT</type> <name>flags</name></member>
+ <member><type>uint32_t</type> <name>rasterizationStream</name></member>
+ </type>
+ <type category="struct" name="VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV"><type>VkStructureType</type><name>sType</name></member>
+ <member noautovalidity="true"><type>void</type>* <name>pNext</name></member>
+ <member><type>VkBool32</type> <name>representativeFragmentTest</name></member>
+ </type>
+ <type category="struct" name="VkPipelineRepresentativeFragmentTestStateCreateInfoNV" structextends="VkGraphicsPipelineCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member><type>VkBool32</type> <name>representativeFragmentTestEnable</name></member>
+ </type>
+ <type category="struct" name="VkPhysicalDeviceExclusiveScissorFeaturesNV" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member>
+ <member><type>VkBool32</type> <name>exclusiveScissor</name></member>
+ </type>
+ <type category="struct" name="VkPipelineViewportExclusiveScissorStateCreateInfoNV" structextends="VkPipelineViewportStateCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member optional="true"><type>uint32_t</type> <name>exclusiveScissorCount</name></member>
+ <member len="exclusiveScissorCount" optional="true">const <type>VkRect2D</type>* <name>pExclusiveScissors</name></member>
+ </type>
+ <type category="struct" name="VkPhysicalDeviceCornerSampledImageFeaturesNV" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member>
+ <member><type>VkBool32</type> <name>cornerSampledImage</name></member>
+ </type>
+ <type category="struct" name="VkPhysicalDeviceComputeShaderDerivativesFeaturesNV" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member>
+ <member><type>VkBool32</type> <name>computeDerivativeGroupQuads</name></member>
+ <member><type>VkBool32</type> <name>computeDerivativeGroupLinear</name></member>
+ </type>
+ <type category="struct" name="VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member>
+ <member><type>VkBool32</type> <name>fragmentShaderBarycentric</name></member>
+ </type>
+ <type category="struct" name="VkPhysicalDeviceShaderImageFootprintFeaturesNV" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member>
+ <member><type>VkBool32</type> <name>imageFootprint</name></member>
+ </type>
+ <type category="struct" name="VkShadingRatePaletteNV">
+ <member><type>uint32_t</type> <name>shadingRatePaletteEntryCount</name></member>
+ <member len="shadingRatePaletteEntryCount">const <type>VkShadingRatePaletteEntryNV</type>* <name>pShadingRatePaletteEntries</name></member>
+ </type>
+ <type category="struct" name="VkPipelineViewportShadingRateImageStateCreateInfoNV" structextends="VkPipelineViewportStateCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member><type>VkBool32</type> <name>shadingRateImageEnable</name></member>
+ <member optional="true"><type>uint32_t</type> <name>viewportCount</name></member>
+ <member len="viewportCount" optional="true">const <type>VkShadingRatePaletteNV</type>* <name>pShadingRatePalettes</name></member>
+ </type>
+ <type category="struct" name="VkPhysicalDeviceShadingRateImageFeaturesNV" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member>
+ <member><type>VkBool32</type> <name>shadingRateImage</name></member>
+ <member><type>VkBool32</type> <name>shadingRateCoarseSampleOrder</name></member>
+ </type>
+ <type category="struct" name="VkPhysicalDeviceShadingRateImagePropertiesNV" structextends="VkPhysicalDeviceProperties" returnedonly="true">
+ <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member>
+ <member><type>VkExtent2D</type> <name>shadingRateTexelSize</name></member>
+ <member><type>uint32_t</type> <name>shadingRatePaletteSize</name></member>
+ <member><type>uint32_t</type> <name>shadingRateMaxCoarseSamples</name></member>
+ </type>
+ <type category="struct" name="VkCoarseSampleLocationNV">
+ <member><type>uint32_t</type> <name>pixelX</name></member>
+ <member><type>uint32_t</type> <name>pixelY</name></member>
+ <member><type>uint32_t</type> <name>sample</name></member>
+ </type>
+ <type category="struct" name="VkCoarseSampleOrderCustomNV">
+ <member><type>VkShadingRatePaletteEntryNV</type> <name>shadingRate</name></member>
+ <member><type>uint32_t</type> <name>sampleCount</name></member>
+ <member><type>uint32_t</type> <name>sampleLocationCount</name></member>
+ <member len="sampleLocationCount">const <type>VkCoarseSampleLocationNV</type>* <name>pSampleLocations</name></member>
+ </type>
+ <type category="struct" name="VkPipelineViewportCoarseSampleOrderStateCreateInfoNV" structextends="VkPipelineViewportStateCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member><type>VkCoarseSampleOrderTypeNV</type> <name>sampleOrderType</name></member>
+ <member optional="true"><type>uint32_t</type> <name>customSampleOrderCount</name></member>
+ <member len="customSampleOrderCount">const <type>VkCoarseSampleOrderCustomNV</type>* <name>pCustomSampleOrders</name></member>
+ </type>
+ <type category="struct" name="VkPhysicalDeviceMeshShaderFeaturesNV" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member>
+ <member><type>VkBool32</type> <name>taskShader</name></member>
+ <member><type>VkBool32</type> <name>meshShader</name></member>
+ </type>
+ <type category="struct" name="VkPhysicalDeviceMeshShaderPropertiesNV" structextends="VkPhysicalDeviceProperties2">
+ <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member>
+ <member><type>uint32_t</type> <name>maxDrawMeshTasksCount</name></member>
+ <member><type>uint32_t</type> <name>maxTaskWorkGroupInvocations</name></member>
+ <member><type>uint32_t</type> <name>maxTaskWorkGroupSize</name>[3]</member>
+ <member><type>uint32_t</type> <name>maxTaskTotalMemorySize</name></member>
+ <member><type>uint32_t</type> <name>maxTaskOutputCount</name></member>
+ <member><type>uint32_t</type> <name>maxMeshWorkGroupInvocations</name></member>
+ <member><type>uint32_t</type> <name>maxMeshWorkGroupSize</name>[3]</member>
+ <member><type>uint32_t</type> <name>maxMeshTotalMemorySize</name></member>
+ <member><type>uint32_t</type> <name>maxMeshOutputVertices</name></member>
+ <member><type>uint32_t</type> <name>maxMeshOutputPrimitives</name></member>
+ <member><type>uint32_t</type> <name>maxMeshMultiviewViewCount</name></member>
+ <member><type>uint32_t</type> <name>meshOutputPerVertexGranularity</name></member>
+ <member><type>uint32_t</type> <name>meshOutputPerPrimitiveGranularity</name></member>
+ </type>
+ <type category="struct" name="VkDrawMeshTasksIndirectCommandNV">
+ <member><type>uint32_t</type> <name>taskCount</name></member>
+ <member><type>uint32_t</type> <name>firstTask</name></member>
+ </type>
+ <type category="struct" name="VkRaytracingPipelineCreateInfoNVX">
+ <member values="VK_STRUCTURE_TYPE_RAYTRACING_PIPELINE_CREATE_INFO_NVX"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member optional="true"><type>VkPipelineCreateFlags</type> <name>flags</name><comment>Pipeline creation flags</comment></member>
+ <member><type>uint32_t</type> <name>stageCount</name></member>
+ <member len="stageCount">const <type>VkPipelineShaderStageCreateInfo</type>* <name>pStages</name><comment>One entry for each active shader stage</comment></member>
+ <member len="stageCount">const <type>uint32_t</type>* <name>pGroupNumbers</name><comment>One entry for each stage used as the query index and for grouping</comment></member>
+ <member><type>uint32_t</type> <name>maxRecursionDepth</name></member>
+ <member><type>VkPipelineLayout</type> <name>layout</name><comment>Interface layout of the pipeline</comment></member>
+ <member noautovalidity="true" optional="true"><type>VkPipeline</type> <name>basePipelineHandle</name><comment>If VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is nonzero, it specifies the handle of the base pipeline this is a derivative of</comment></member>
+ <member><type>int32_t</type> <name>basePipelineIndex</name><comment>If VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is not -1, it specifies an index into pCreateInfos of the base pipeline this is a derivative of</comment></member>
+ </type>
+ <type category="struct" name="VkGeometryTrianglesNVX">
+ <member values="VK_STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NVX"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member optional="true"><type>VkBuffer</type> <name>vertexData</name></member>
+ <member><type>VkDeviceSize</type> <name>vertexOffset</name></member>
+ <member><type>uint32_t</type> <name>vertexCount</name></member>
+ <member><type>VkDeviceSize</type> <name>vertexStride</name></member>
+ <member><type>VkFormat</type> <name>vertexFormat</name><comment>VK_FORMAT_R32G32B32_SFLOAT, VK_FORMAT_R32G32B32A32_SFLOAT, VK_FORMAT_R16G16B16_SFLOAT, or VK_FORMAT_R16G16B16A16_SFLOAT</comment></member>
+ <member optional="true"><type>VkBuffer</type> <name>indexData</name></member>
+ <member><type>VkDeviceSize</type> <name>indexOffset</name></member>
+ <member><type>uint32_t</type> <name>indexCount</name></member>
+ <member><type>VkIndexType</type> <name>indexType</name></member>
+ <member optional="true"><type>VkBuffer</type> <name>transformData</name><comment>Optional reference to array of floats representing a 3x4 row major affine transformation matrix.</comment></member>
+ <member><type>VkDeviceSize</type> <name>transformOffset</name></member>
+ </type>
+ <type category="struct" name="VkGeometryAABBNVX">
+ <member values="VK_STRUCTURE_TYPE_GEOMETRY_AABB_NVX"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member optional="true"><type>VkBuffer</type> <name>aabbData</name></member>
+ <member><type>uint32_t</type> <name>numAABBs</name></member>
+ <member><type>uint32_t</type> <name>stride</name><comment>Stride in bytes between AABBs</comment></member>
+ <member><type>VkDeviceSize</type> <name>offset</name><comment>Offset in bytes of the first AABB in aabbData</comment></member>
+ </type>
+ <type category="struct" name="VkGeometryDataNVX">
+ <member><type>VkGeometryTrianglesNVX</type> <name>triangles</name></member>
+ <member><type>VkGeometryAABBNVX</type> <name>aabbs</name></member>
+ </type>
+ <type category="struct" name="VkGeometryNVX">
+ <member values="VK_STRUCTURE_TYPE_GEOMETRY_NVX"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member><type>VkGeometryTypeNVX</type> <name>geometryType</name></member>
+ <member><type>VkGeometryDataNVX</type> <name>geometry</name></member>
+ <member optional="true"><type>VkGeometryFlagsNVX</type> <name>flags</name></member>
+ </type>
+ <type category="struct" name="VkAccelerationStructureCreateInfoNVX">
+ <member values="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NVX"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member><type>VkAccelerationStructureTypeNVX</type> <name>type</name></member>
+ <member optional="true"><type>VkBuildAccelerationStructureFlagsNVX</type><name>flags</name></member>
+ <member><type>VkDeviceSize</type> <name>compactedSize</name></member>
+ <member optional="true"><type>uint32_t</type> <name>instanceCount</name></member>
+ <member optional="true"><type>uint32_t</type> <name>geometryCount</name></member>
+ <member len="geometryCount">const <type>VkGeometryNVX</type>* <name>pGeometries</name></member>
+ </type>
+ <type category="struct" name="VkBindAccelerationStructureMemoryInfoNVX">
+ <member values="VK_STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NVX"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member><type>VkAccelerationStructureNVX</type> <name>accelerationStructure</name></member>
+ <member><type>VkDeviceMemory</type> <name>memory</name></member>
+ <member><type>VkDeviceSize</type> <name>memoryOffset</name></member>
+ <member optional="true"><type>uint32_t</type> <name>deviceIndexCount</name></member>
+ <member len="deviceIndexCount">const <type>uint32_t</type>* <name>pDeviceIndices</name></member>
+ </type>
+ <type category="struct" name="VkDescriptorAccelerationStructureInfoNVX" structextends="VkWriteDescriptorSet">
+ <member values="VK_STRUCTURE_TYPE_DESCRIPTOR_ACCELERATION_STRUCTURE_INFO_NVX"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member><type>uint32_t</type> <name>accelerationStructureCount</name></member>
+ <member len="accelerationStructureCount">const <type>VkAccelerationStructureNVX</type>* <name>pAccelerationStructures</name></member>
+ </type>
+ <type category="struct" name="VkAccelerationStructureMemoryRequirementsInfoNVX">
+ <member values="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NVX"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member><type>VkAccelerationStructureNVX</type> <name>accelerationStructure</name></member>
+ </type>
+ <type category="struct" name="VkPhysicalDeviceRaytracingPropertiesNVX" structextends="VkPhysicalDeviceProperties2">
+ <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAYTRACING_PROPERTIES_NVX"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member>
+ <member><type>uint32_t</type> <name>shaderHeaderSize</name></member>
+ <member><type>uint32_t</type> <name>maxRecursionDepth</name></member>
+ <member><type>uint32_t</type> <name>maxGeometryCount</name></member>
+ </type>
+ <type category="struct" name="VkDrmFormatModifierPropertiesListEXT" structextends="VkFormatProperties2">
+ <member values="VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member>
+ <member optional="true"><type>uint32_t</type> <name>drmFormatModifierCount</name></member>
+ <member optional="true,false" len="drmFormatModifierCount"><type>VkDrmFormatModifierPropertiesEXT</type>* <name>pDrmFormatModifierProperties</name></member>
+ </type>
+ <type category="struct" name="VkDrmFormatModifierPropertiesEXT" returnedonly="true">
+ <member><type>uint64_t</type> <name>drmFormatModifier</name></member>
+ <member><type>uint32_t</type> <name>drmFormatModifierPlaneCount</name></member>
+ <member><type>VkFormatFeatureFlags</type> <name>drmFormatModifierTilingFeatures</name></member>
+ </type>
+ <type category="struct" name="VkPhysicalDeviceImageDrmFormatModifierInfoEXT" structextends="VkPhysicalDeviceImageFormatInfo2">
+ <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member><type>uint64_t</type> <name>drmFormatModifier</name></member>
+ <member><type>VkSharingMode</type> <name>sharingMode</name></member>
+ <member optional="true"><type>uint32_t</type> <name>queueFamilyIndexCount</name></member>
+ <member noautovalidity="true" len="queueFamilyIndexCount">const <type>uint32_t</type>* <name>pQueueFamilyIndices</name></member>
+ </type>
+ <type category="struct" name="VkImageDrmFormatModifierListCreateInfoEXT" structextends="VkImageCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member><type>uint32_t</type> <name>drmFormatModifierCount</name></member>
+ <member len="drmFormatModifierCount">const <type>uint64_t</type>* <name>pDrmFormatModifiers</name></member>
+ </type>
+ <type category="struct" name="VkImageDrmFormatModifierExplicitCreateInfoEXT" structextends="VkImageCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_IMAGE_EXCPLICIT_DRM_FORMAT_MODIFIER_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member><type>uint64_t</type> <name>drmFormatModifier</name></member>
+ <member optional="false"><type>uint32_t</type> <name>drmFormatModifierPlaneCount</name></member>
+ <member len="drmFormatModifierPlaneCount">const <type>VkSubresourceLayout</type>* <name>pPlaneLayouts</name></member>
+ </type>
+ <type category="struct" name="VkImageDrmFormatModifierPropertiesEXT" returnedonly="true">
+ <member values="VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member>
+ <member><type>uint64_t</type> <name>drmFormatModifier</name></member>
+ </type>
</types>
<comment>Vulkan enumerant (token) definitions</comment>
@@ -3285,6 +3633,8 @@
<enum value="(~0U)" name="VK_SUBPASS_EXTERNAL"/>
<enum value="32" name="VK_MAX_DEVICE_GROUP_SIZE"/>
<enum name="VK_MAX_DEVICE_GROUP_SIZE_KHR" alias="VK_MAX_DEVICE_GROUP_SIZE"/>
+ <enum value="256" name="VK_MAX_DRIVER_NAME_SIZE_KHR"/>
+ <enum value="256" name="VK_MAX_DRIVER_INFO_SIZE_KHR"/>
</enums>
<comment>
@@ -3837,6 +4187,7 @@
<enum bitpos="2" name="VK_QUEUE_TRANSFER_BIT" comment="Queue supports transfer operations"/>
<enum bitpos="3" name="VK_QUEUE_SPARSE_BINDING_BIT" comment="Queue supports sparse resource memory management operations"/>
</enums>
+ <enums name="VkRenderPassCreateFlagBits" type="bitmask"></enums>
<enums name="VkDeviceQueueCreateFlagBits" type="bitmask"></enums>
<enums name="VkMemoryPropertyFlagBits" type="bitmask">
<enum bitpos="0" name="VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT" comment="If otherwise stated, then allocate memory on device"/>
@@ -4067,6 +4418,12 @@
<enum bitpos="7" name="VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR"/>
<enum bitpos="8" name="VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR"/>
</enums>
+ <enums name="VkTimeDomainEXT" type="enum">
+ <enum value="0" name="VK_TIME_DOMAIN_DEVICE_EXT"/>
+ <enum value="1" name="VK_TIME_DOMAIN_CLOCK_MONOTONIC_EXT"/>
+ <enum value="2" name="VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT"/>
+ <enum value="3" name="VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT"/>
+ </enums>
<enums name="VkDebugReportFlagBitsEXT" type="bitmask">
<enum bitpos="0" name="VK_DEBUG_REPORT_INFORMATION_BIT_EXT"/>
<enum bitpos="1" name="VK_DEBUG_REPORT_WARNING_BIT_EXT"/>
@@ -4343,9 +4700,72 @@
<enum value="0x10003" name="VK_VENDOR_ID_KAZAN" comment="Kazan Software Renderer"/>
<unused start="0x10004" comment="This is the next unused available Khronos vendor ID"/>
</enums>
+ <enums name="VkDriverIdKHR" type="enum">
+ <comment>Driver IDs are now represented as enums instead of the old
+ <driverids> tag, allowing them to be included in the
+ API headers.</comment>
+ <enum value="1" name="VK_DRIVER_ID_AMD_PROPRIETARY_KHR" comment="Advanced Micro Devices, Inc."/>
+ <enum value="2" name="VK_DRIVER_ID_AMD_OPEN_SOURCE_KHR" comment="Advanced Micro Devices, Inc."/>
+ <enum value="3" name="VK_DRIVER_ID_MESA_RADV_KHR" comment="Mesa open source project"/>
+ <enum value="4" name="VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR" comment="NVIDIA Corporation"/>
+ <enum value="5" name="VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS_KHR" comment="Intel Corporation"/>
+ <enum value="6" name="VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA_KHR" comment="Intel Corporation"/>
+ <enum value="7" name="VK_DRIVER_ID_IMAGINATION_PROPRIETARY_KHR" comment="Imagination Technologies"/>
+ <enum value="8" name="VK_DRIVER_ID_QUALCOMM_PROPRIETARY_KHR" comment="Qualcomm Technologies, Inc."/>
+ <enum value="9" name="VK_DRIVER_ID_ARM_PROPRIETARY_KHR" comment="Arm Limited"/>
+ </enums>
<enums name="VkConditionalRenderingFlagBitsEXT" type="bitmask">
<enum bitpos="0" name="VK_CONDITIONAL_RENDERING_INVERTED_BIT_EXT"/>
</enums>
+ <enums name="VkShadingRatePaletteEntryNV" type="enum">
+ <enum value="0" name="VK_SHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV"/>
+ <enum value="1" name="VK_SHADING_RATE_PALETTE_ENTRY_16_INVOCATIONS_PER_PIXEL_NV"/>
+ <enum value="2" name="VK_SHADING_RATE_PALETTE_ENTRY_8_INVOCATIONS_PER_PIXEL_NV"/>
+ <enum value="3" name="VK_SHADING_RATE_PALETTE_ENTRY_4_INVOCATIONS_PER_PIXEL_NV"/>
+ <enum value="4" name="VK_SHADING_RATE_PALETTE_ENTRY_2_INVOCATIONS_PER_PIXEL_NV"/>
+ <enum value="5" name="VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_PIXEL_NV"/>
+ <enum value="6" name="VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X1_PIXELS_NV"/>
+ <enum value="7" name="VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_1X2_PIXELS_NV"/>
+ <enum value="8" name="VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X2_PIXELS_NV"/>
+ <enum value="9" name="VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X2_PIXELS_NV"/>
+ <enum value="10" name="VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X4_PIXELS_NV"/>
+ <enum value="11" name="VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X4_PIXELS_NV"/>
+ </enums>
+ <enums name="VkCoarseSampleOrderTypeNV" type="enum">
+ <enum value="0" name="VK_COARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV"/>
+ <enum value="1" name="VK_COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV"/>
+ <enum value="2" name="VK_COARSE_SAMPLE_ORDER_TYPE_PIXEL_MAJOR_NV"/>
+ <enum value="3" name="VK_COARSE_SAMPLE_ORDER_TYPE_SAMPLE_MAJOR_NV"/>
+ </enums>
+ <enums name="VkGeometryInstanceFlagBitsNVX" type="bitmask">
+ <enum bitpos="0" name="VK_GEOMETRY_INSTANCE_TRIANGLE_CULL_DISABLE_BIT_NVX"/>
+ <enum bitpos="1" name="VK_GEOMETRY_INSTANCE_TRIANGLE_CULL_FLIP_WINDING_BIT_NVX"/>
+ <enum bitpos="2" name="VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_NVX"/>
+ <enum bitpos="3" name="VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_NVX"/>
+ </enums>
+ <enums name="VkGeometryFlagBitsNVX" type="bitmask">
+ <enum bitpos="0" name="VK_GEOMETRY_OPAQUE_BIT_NVX"/>
+ <enum bitpos="1" name="VK_GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_NVX"/>
+ </enums>
+ <enums name="VkBuildAccelerationStructureFlagBitsNVX" type="bitmask">
+ <enum bitpos="0" name="VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_NVX"/>
+ <enum bitpos="1" name="VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_NVX"/>
+ <enum bitpos="2" name="VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_NVX"/>
+ <enum bitpos="3" name="VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_NVX"/>
+ <enum bitpos="4" name="VK_BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_NVX"/>
+ </enums>
+ <enums name="VkCopyAccelerationStructureModeNVX" type="enum">
+ <enum value="0" name="VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_NVX"/>
+ <enum value="1" name="VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_NVX"/>
+ </enums>
+ <enums name="VkAccelerationStructureTypeNVX" type="enum">
+ <enum value="0" name="VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_NVX"/>
+ <enum value="1" name="VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_NVX"/>
+ </enums>
+ <enums name="VkGeometryTypeNVX" type="enum">
+ <enum value="0" name="VK_GEOMETRY_TYPE_TRIANGLES_NVX"/>
+ <enum value="1" name="VK_GEOMETRY_TYPE_AABBS_NVX"/>
+ </enums>
<commands comment="Vulkan command definitions">
<command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INITIALIZATION_FAILED,VK_ERROR_LAYER_NOT_PRESENT,VK_ERROR_EXTENSION_NOT_PRESENT,VK_ERROR_INCOMPATIBLE_DRIVER">
@@ -4468,7 +4888,7 @@
</command>
<command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST">
<proto><type>VkResult</type> <name>vkQueueWaitIdle</name></proto>
- <param><type>VkQueue</type> <name>queue</name></param>
+ <param externsync="true"><type>VkQueue</type> <name>queue</name></param>
</command>
<command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST">
<proto><type>VkResult</type> <name>vkDeviceWaitIdle</name></proto>
@@ -5510,6 +5930,13 @@
<param><type>xcb_connection_t</type>* <name>connection</name></param>
<param><type>xcb_visualid_t</type> <name>visual_id</name></param>
</command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkCreateImagePipeSurfaceFUCHSIA</name></proto>
+ <param><type>VkInstance</type> <name>instance</name></param>
+ <param>const <type>VkImagePipeSurfaceCreateInfoFUCHSIA</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkSurfaceKHR</type>* <name>pSurface</name></param>
+ </command>
<command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY">
<proto><type>VkResult</type> <name>vkCreateDebugReportCallbackEXT</name></proto>
<param><type>VkInstance</type> <name>instance</name></param>
@@ -5750,6 +6177,19 @@
<param><type>int</type> <name>fd</name></param>
<param><type>VkMemoryFdPropertiesKHR</type>* <name>pMemoryFdProperties</name></param>
</command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_OUT_OF_HOST_MEMORY">
+ <proto><type>VkResult</type> <name>vkGetMemoryFuchsiaHandleKHR</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkMemoryGetFuchsiaHandleInfoKHR</type>* <name>pGetFuchsiaHandleInfo</name></param>
+ <param><type>uint32_t</type>* <name>pFuchsiaHandle</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR">
+ <proto><type>VkResult</type> <name>vkGetMemoryFuchsiaHandlePropertiesKHR</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>VkExternalMemoryHandleTypeFlagBits</type> <name>handleType</name></param>
+ <param><type>uint32_t</type> <name>fuchsiaHandle</name></param>
+ <param><type>VkMemoryFuchsiaHandlePropertiesKHR</type>* <name>pMemoryFuchsiaHandleProperties</name></param>
+ </command>
<command>
<proto><type>void</type> <name>vkGetPhysicalDeviceExternalSemaphoreProperties</name></proto>
<param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
@@ -5779,6 +6219,17 @@
<param><type>VkDevice</type> <name>device</name></param>
<param>const <type>VkImportSemaphoreFdInfoKHR</type>* <name>pImportSemaphoreFdInfo</name></param>
</command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_OUT_OF_HOST_MEMORY">
+ <proto><type>VkResult</type> <name>vkGetSemaphoreFuchsiaHandleKHR</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkSemaphoreGetFuchsiaHandleInfoKHR</type>* <name>pGetFuchsiaHandleInfo</name></param>
+ <param><type>uint32_t</type>* <name>pFuchsiaHandle</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR">
+ <proto><type>VkResult</type> <name>vkImportSemaphoreFuchsiaHandleKHR</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkImportSemaphoreFuchsiaHandleInfoKHR</type>* <name>pImportSemaphoreFuchsiaHandleInfo</name></param>
+ </command>
<command>
<proto><type>void</type> <name>vkGetPhysicalDeviceExternalFenceProperties</name></proto>
<param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
@@ -6173,6 +6624,20 @@
<param optional="false,true"><type>size_t</type>* <name>pInfoSize</name></param>
<param optional="true" len="pInfoSize"><type>void</type>* <name>pInfo</name></param>
</command>
+ <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkGetPhysicalDeviceCalibrateableTimeDomainsEXT</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param optional="false,true"><type>uint32_t</type>* <name>pTimeDomainCount</name></param>
+ <param optional="true" len="pTimeDomainCount"><type>VkTimeDomainEXT</type>* <name>pTimeDomains</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkGetCalibratedTimestampsEXT</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>uint32_t</type> <name>timestampCount</name></param>
+ <param len="timestampCount">const <type>VkCalibratedTimestampInfoEXT</type>* <name>pTimestampInfos</name></param>
+ <param len="timestampCount"><type>uint64_t</type>* <name>pTimestamps</name></param>
+ <param><type>uint64_t</type>* <name>pMaxDeviation</name></param>
+ </command>
<command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
<proto><type>VkResult</type> <name>vkSetDebugUtilsObjectNameEXT</name></proto>
<param><type>VkDevice</type> <name>device</name></param>
@@ -6313,6 +6778,220 @@
<param optional="false,true"><type>uint32_t</type>* <name>pCheckpointDataCount</name></param>
<param optional="true" len="pCheckpointDataCount"><type>VkCheckpointDataNV</type>* <name>pCheckpointData</name></param>
</command>
+ <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdBindTransformFeedbackBuffersEXT</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>uint32_t</type> <name>firstBinding</name></param>
+ <param><type>uint32_t</type> <name>bindingCount</name></param>
+ <param len="bindingCount">const <type>VkBuffer</type>* <name>pBuffers</name></param>
+ <param len="bindingCount">const <type>VkDeviceSize</type>* <name>pOffsets</name></param>
+ <param optional="true" len="bindingCount">const <type>VkDeviceSize</type>* <name>pSizes</name></param>
+ </command>
+ <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdBeginTransformFeedbackEXT</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>uint32_t</type> <name>firstCounterBuffer</name></param>
+ <param optional="false"><type>uint32_t</type> <name>counterBufferCount</name></param>
+ <param optional="true" len="counterBufferCount">const <type>VkBuffer</type>* <name>pCounterBuffers</name></param>
+ <param optional="true" len="counterBufferCount">const <type>VkDeviceSize</type>* <name>pCounterBufferOffsets</name></param>
+ </command>
+ <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdEndTransformFeedbackEXT</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>uint32_t</type> <name>firstCounterBuffer</name></param>
+ <param optional="false"><type>uint32_t</type> <name>counterBufferCount</name></param>
+ <param optional="true" len="counterBufferCount">const <type>VkBuffer</type>* <name>pCounterBuffers</name></param>
+ <param optional="true" len="counterBufferCount">const <type>VkDeviceSize</type>* <name>pCounterBufferOffsets</name></param>
+ </command>
+ <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdBeginQueryIndexedEXT</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkQueryPool</type> <name>queryPool</name></param>
+ <param><type>uint32_t</type> <name>query</name></param>
+ <param optional="true"><type>VkQueryControlFlags</type> <name>flags</name></param>
+ <param><type>uint32_t</type> <name>index</name></param>
+ </command>
+ <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdEndQueryIndexedEXT</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkQueryPool</type> <name>queryPool</name></param>
+ <param><type>uint32_t</type> <name>query</name></param>
+ <param><type>uint32_t</type> <name>index</name></param>
+ </command>
+ <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary" pipeline="graphics">
+ <proto><type>void</type> <name>vkCmdDrawIndirectByteCountEXT</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>uint32_t</type> <name>instanceCount</name></param>
+ <param><type>uint32_t</type> <name>firstInstance</name></param>
+ <param><type>VkBuffer</type> <name>counterBuffer</name></param>
+ <param><type>VkDeviceSize</type> <name>counterBufferOffset</name></param>
+ <param><type>uint32_t</type> <name>counterOffset</name></param>
+ <param><type>uint32_t</type> <name>vertexStride</name></param>
+ </command>
+ <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdSetExclusiveScissorNV</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>uint32_t</type> <name>firstExclusiveScissor</name></param>
+ <param><type>uint32_t</type> <name>exclusiveScissorCount</name></param>
+ <param len="exclusiveScissorCount">const <type>VkRect2D</type>* <name>pExclusiveScissors</name></param>
+ </command>
+ <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdBindShadingRateImageNV</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkImageView</type> <name>imageView</name></param>
+ <param><type>VkImageLayout</type> <name>imageLayout</name></param>
+ </command>
+ <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdSetViewportShadingRatePaletteNV</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>uint32_t</type> <name>firstViewport</name></param>
+ <param><type>uint32_t</type> <name>viewportCount</name></param>
+ <param len="viewportCount">const <type>VkShadingRatePaletteNV</type>* <name>pShadingRatePalettes</name></param>
+ </command>
+ <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdSetCoarseSampleOrderNV</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkCoarseSampleOrderTypeNV</type> <name>sampleOrderType</name></param>
+ <param optional="true"><type>uint32_t</type> <name>customSampleOrderCount</name></param>
+ <param len="customSampleOrderCount">const <type>VkCoarseSampleOrderCustomNV</type>* <name>pCustomSampleOrders</name></param>
+ </command>
+ <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary" pipeline="graphics">
+ <proto><type>void</type> <name>vkCmdDrawMeshTasksNV</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>uint32_t</type> <name>taskCount</name></param>
+ <param><type>uint32_t</type> <name>firstTask</name></param>
+ </command>
+ <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary" pipeline="graphics">
+ <proto><type>void</type> <name>vkCmdDrawMeshTasksIndirectNV</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkBuffer</type> <name>buffer</name></param>
+ <param><type>VkDeviceSize</type> <name>offset</name></param>
+ <param><type>uint32_t</type> <name>drawCount</name></param>
+ <param><type>uint32_t</type> <name>stride</name></param>
+ </command>
+ <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary" pipeline="graphics">
+ <proto><type>void</type> <name>vkCmdDrawMeshTasksIndirectCountNV</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkBuffer</type> <name>buffer</name></param>
+ <param><type>VkDeviceSize</type> <name>offset</name></param>
+ <param><type>VkBuffer</type> <name>countBuffer</name></param>
+ <param><type>VkDeviceSize</type> <name>countBufferOffset</name></param>
+ <param><type>uint32_t</type> <name>maxDrawCount</name></param>
+ <param><type>uint32_t</type> <name>stride</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkCompileDeferredNVX</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>VkPipeline</type> <name>pipeline</name></param>
+ <param><type>uint32_t</type> <name>shader</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY">
+ <proto><type>VkResult</type> <name>vkCreateAccelerationStructureNVX</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkAccelerationStructureCreateInfoNVX</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkAccelerationStructureNVX</type>* <name>pAccelerationStructure</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkDestroyAccelerationStructureNVX</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>VkAccelerationStructureNVX</type> <name>accelerationStructure</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkGetAccelerationStructureMemoryRequirementsNVX</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkAccelerationStructureMemoryRequirementsInfoNVX</type>* <name>pInfo</name></param>
+ <param><type>VkMemoryRequirements2KHR</type>* <name>pMemoryRequirements</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkGetAccelerationStructureScratchMemoryRequirementsNVX</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkAccelerationStructureMemoryRequirementsInfoNVX</type>* <name>pInfo</name></param>
+ <param><type>VkMemoryRequirements2KHR</type>* <name>pMemoryRequirements</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkBindAccelerationStructureMemoryNVX</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>uint32_t</type> <name>bindInfoCount</name></param>
+ <param len="bindInfoCount">const <type>VkBindAccelerationStructureMemoryInfoNVX</type>* <name>pBindInfos</name></param>
+ </command>
+ <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdCopyAccelerationStructureNVX</name></proto>
+ <param><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkAccelerationStructureNVX</type> <name>dst</name></param>
+ <param><type>VkAccelerationStructureNVX</type> <name>src</name></param>
+ <param><type>VkCopyAccelerationStructureModeNVX</type> <name>mode</name></param>
+ </command>
+ <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdWriteAccelerationStructurePropertiesNVX</name></proto>
+ <param><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkAccelerationStructureNVX</type> <name>accelerationStructure</name></param>
+ <param><type>VkQueryType</type> <name>queryType</name></param>
+ <param><type>VkQueryPool</type> <name>queryPool</name></param>
+ <param><type>uint32_t</type> <name>query</name></param>
+ </command>
+ <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdBuildAccelerationStructureNVX</name></proto>
+ <param><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkAccelerationStructureTypeNVX</type> <name>type</name></param>
+ <param optional="true"><type>uint32_t</type> <name>instanceCount</name></param>
+ <param optional="true"><type>VkBuffer</type> <name>instanceData</name></param>
+ <param><type>VkDeviceSize</type> <name>instanceOffset</name></param>
+ <param optional="true"><type>uint32_t</type> <name>geometryCount</name></param>
+ <param len="geometryCount">const <type>VkGeometryNVX</type>* <name>pGeometries</name></param>
+ <param optional="true"><type>VkBuildAccelerationStructureFlagsNVX</type> <name>flags</name></param>
+ <param><type>VkBool32</type> <name>update</name></param>
+ <param><type>VkAccelerationStructureNVX</type> <name>dst</name></param>
+ <param optional="true"><type>VkAccelerationStructureNVX</type> <name>src</name></param>
+ <param><type>VkBuffer</type> <name>scratch</name></param>
+ <param><type>VkDeviceSize</type> <name>scratchOffset</name></param>
+ </command>
+ <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdTraceRaysNVX</name></proto>
+ <param><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkBuffer</type> <name>raygenShaderBindingTableBuffer</name></param>
+ <param><type>VkDeviceSize</type> <name>raygenShaderBindingOffset</name></param>
+ <param><type>VkBuffer</type> <name>missShaderBindingTableBuffer</name></param>
+ <param><type>VkDeviceSize</type> <name>missShaderBindingOffset</name></param>
+ <param><type>VkDeviceSize</type> <name>missShaderBindingStride</name></param>
+ <param><type>VkBuffer</type> <name>hitShaderBindingTableBuffer</name></param>
+ <param><type>VkDeviceSize</type> <name>hitShaderBindingOffset</name></param>
+ <param><type>VkDeviceSize</type> <name>hitShaderBindingStride</name></param>
+ <param><type>uint32_t</type> <name>width</name></param>
+ <param><type>uint32_t</type> <name>height</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkGetRaytracingShaderHandlesNVX</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>VkPipeline</type> <name>pipeline</name></param>
+ <param><type>uint32_t</type> <name>firstGroup</name></param>
+ <param><type>uint32_t</type> <name>groupCount</name></param>
+ <param><type>size_t</type> <name>dataSize</name></param>
+ <param len="dataSize"><type>void</type>* <name>pData</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkGetAccelerationStructureHandleNVX</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>VkAccelerationStructureNVX</type> <name>accelerationStructure</name></param>
+ <param><type>size_t</type> <name>dataSize</name></param>
+ <param len="dataSize"><type>void</type>* <name>pData</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INVALID_SHADER_NV">
+ <proto><type>VkResult</type> <name>vkCreateRaytracingPipelinesNVX</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param optional="true"><type>VkPipelineCache</type> <name>pipelineCache</name></param>
+ <param><type>uint32_t</type> <name>createInfoCount</name></param>
+ <param len="createInfoCount">const <type>VkRaytracingPipelineCreateInfoNVX</type>* <name>pCreateInfos</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param len="createInfoCount"><type>VkPipeline</type>* <name>pPipelines</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS">
+ <proto><type>VkResult</type> <name>vkGetImageDrmFormatModifierPropertiesEXT</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>VkImage</type> <name>image</name></param>
+ <param><type>VkImageDrmFormatModifierPropertiesEXT</type>* <name>pProperties</name></param>
+ </command>
</commands>
<feature api="vulkan" name="VK_VERSION_1_0" number="1.0" comment="Vulkan core API interface definitions">
@@ -6625,6 +7304,7 @@
<type name="VkBufferMemoryRequirementsInfo2"/>
<type name="VkImageMemoryRequirementsInfo2"/>
<type name="VkImageSparseMemoryRequirementsInfo2"/>
+ <type name="VkMemoryRequirements2KHR"/>
<type name="VkMemoryRequirements2"/>
<type name="VkSparseImageMemoryRequirements2"/>
<command name="vkGetImageMemoryRequirements2"/>
@@ -6994,7 +7674,7 @@
<command name="vkGetPhysicalDeviceWaylandPresentationSupportKHR"/>
</require>
</extension>
- <extension name="VK_KHR_mir_surface" number="8" type="instance" requires="VK_KHR_surface" platform="mir" author="KHR" contact="Jesse Hall @critsec,Ian Elliott @ianelliottus" supported="vulkan">
+ <extension name="VK_KHR_mir_surface" number="8" type="instance" requires="VK_KHR_surface" platform="mir" author="KHR" contact="Jesse Hall @critsec,Ian Elliott @ianelliottus" obsoletedby="" supported="vulkan">
<require>
<enum value="4" name="VK_KHR_MIR_SURFACE_SPEC_VERSION"/>
<enum value=""VK_KHR_mir_surface"" name="VK_KHR_MIR_SURFACE_EXTENSION_NAME"/>
@@ -7180,10 +7860,37 @@
<enum value=""VK_NV_extension_28"" name="VK_EXT_EXTENSION_28_EXTENSION_NAME"/>
</require>
</extension>
- <extension name="VK_NVX_extension_29" number="29" author="NVX" contact="Jeff Juliano @jjulianoatnv" supported="disabled">
+ <extension name="VK_EXT_transform_feedback" number="29" type="device" author="NV" contact="Piers Daniell @pdaniell-nv" supported="vulkan" requires="VK_KHR_get_physical_device_properties2">
<require>
- <enum value="0" name="VK_NVX_EXTENSION_29_SPEC_VERSION"/>
- <enum value=""VK_NVX_extension_29"" name="VK_NVX_EXTENSION_29_EXTENSION_NAME"/>
+ <enum value="1" name="VK_EXT_TRANSFORM_FEEDBACK_SPEC_VERSION"/>
+ <enum value=""VK_EXT_transform_feedback"" name="VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME"/>
+ <command name="vkCmdBindTransformFeedbackBuffersEXT"/>
+ <command name="vkCmdBeginTransformFeedbackEXT"/>
+ <command name="vkCmdEndTransformFeedbackEXT"/>
+ <command name="vkCmdBeginQueryIndexedEXT"/>
+ <command name="vkCmdEndQueryIndexedEXT"/>
+ <command name="vkCmdDrawIndirectByteCountEXT"/>
+
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT"/>
+ <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT"/>
+ <enum offset="2" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT"/>
+
+ <enum offset="4" extends="VkQueryType" name="VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT"/>
+
+ <enum bitpos="11" extends="VkBufferUsageFlagBits" name="VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT"/>
+ <enum bitpos="12" extends="VkBufferUsageFlagBits" name="VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT"/>
+
+ <enum bitpos="25" extends="VkAccessFlagBits" name="VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT"/>
+ <enum bitpos="26" extends="VkAccessFlagBits" name="VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT"/>
+ <enum bitpos="27" extends="VkAccessFlagBits" name="VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT"/>
+
+ <enum bitpos="24" extends="VkPipelineStageFlagBits" name="VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT"/>
+
+ <type name="VkPhysicalDeviceTransformFeedbackFeaturesEXT"/>
+ <type name="VkPhysicalDeviceTransformFeedbackPropertiesEXT"/>
+ <type name="VkPipelineRasterizationStateStreamCreateInfoEXT"/>
+
+ <type name="VkPipelineRasterizationStateStreamCreateFlagsEXT"/>
</require>
</extension>
<extension name="VK_NVX_extension_30" number="30" author="NVX" contact="Jeff Juliano @jjulianoatnv" supported="disabled">
@@ -7320,11 +8027,13 @@
<enum value=""VK_GOOGLE_extension_50"" name="VK_GOOGLE_EXTENSION_50_EXTENSION_NAME"/>
</require>
</extension>
- <extension name="VK_NVX_extension_51" number="51" author="NVX" contact="James Jones @cubanismo" supported="disabled">
+ <extension name="VK_NV_corner_sampled_image" number="51" author="NV" type="device" requires="VK_KHR_get_physical_device_properties2" contact="Daniel Koch @dgkoch" supported="vulkan">
<require>
- <enum value="0" name="VK_NVX_EXTENSION_51_SPEC_VERSION"/>
- <enum value=""VK_NVX_extension_51"" name="VK_NVX_EXTENSION_51_EXTENSION_NAME"/>
- <enum bitpos="13" extends="VkImageCreateFlagBits" name="VK_IMAGE_CREATE_RESERVED_13_BIT_NV"/>
+ <enum value="2" name="VK_NV_CORNER_SAMPLED_IMAGE_SPEC_VERSION"/>
+ <enum value=""VK_NV_corner_sampled_image"" name="VK_NV_CORNER_SAMPLED_IMAGE_EXTENSION_NAME"/>
+ <enum bitpos="13" extends="VkImageCreateFlagBits" name="VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV"/>
+ <type name="VkPhysicalDeviceCornerSampledImageFeaturesNV"/>
</require>
</extension>
<extension name="VK_NVX_extension_52" number="52" author="NVX" contact="James Jones @cubanismo" supported="disabled">
@@ -8699,10 +9408,38 @@
<type name="VkBindImageMemoryInfoKHR"/>
</require>
</extension>
- <extension name="VK_EXT_extension_159" number="159" author="EXT" contact="Chad Versace @chadversary" supported="disabled">
+ <extension name="VK_EXT_image_drm_format_modifier" number="159" type="device" requires="VK_KHR_bind_memory2,VK_KHR_get_physical_device_properties2,VK_KHR_image_format_list,VK_KHR_sampler_ycbcr_conversion" author="EXT" contact="Chad Versace @chadversary" supported="vulkan">
<require>
<enum value="0" name="VK_EXT_EXTENSION_159_SPEC_VERSION"/>
<enum value=""VK_EXT_extension_159"" name="VK_EXT_EXTENSION_159_EXTENSION_NAME"/>
+
+ <enum value="1" name="VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_SPEC_VERSION"/>
+ <enum value=""VK_EXT_image_drm_format_modifier"" name="VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME"/>
+
+ <enum offset="0" dir="-" extends="VkResult" name="VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT"/>
+
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT"/>
+ <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT"/>
+ <enum offset="2" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT"/>
+ <enum offset="3" extends="VkStructureType" name="VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT"/>
+ <enum offset="4" extends="VkStructureType" name="VK_STRUCTURE_TYPE_IMAGE_EXCPLICIT_DRM_FORMAT_MODIFIER_CREATE_INFO_EXT"/>
+ <enum offset="5" extends="VkStructureType" name="VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT"/>
+
+ <enum offset="0" extends="VkImageTiling" name="VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT"/>
+
+ <enum bitpos="7" extends="VkImageAspectFlagBits" name="VK_IMAGE_ASPECT_MEMORY_PLANE_0_BIT_EXT"/>
+ <enum bitpos="8" extends="VkImageAspectFlagBits" name="VK_IMAGE_ASPECT_MEMORY_PLANE_1_BIT_EXT"/>
+ <enum bitpos="9" extends="VkImageAspectFlagBits" name="VK_IMAGE_ASPECT_MEMORY_PLANE_2_BIT_EXT"/>
+ <enum bitpos="10" extends="VkImageAspectFlagBits" name="VK_IMAGE_ASPECT_MEMORY_PLANE_3_BIT_EXT"/>
+
+ <type name="VkDrmFormatModifierPropertiesListEXT"/>
+ <type name="VkDrmFormatModifierPropertiesEXT"/>
+ <type name="VkPhysicalDeviceImageDrmFormatModifierInfoEXT"/>
+ <type name="VkImageDrmFormatModifierListCreateInfoEXT"/>
+ <type name="VkImageDrmFormatModifierExplicitCreateInfoEXT"/>
+ <type name="VkImageDrmFormatModifierPropertiesEXT"/>
+
+ <command name="vkGetImageDrmFormatModifierPropertiesEXT"/>
</require>
</extension>
<extension name="VK_EXT_extension_160" number="160" author="EXT" contact="Mark Young @marky-lunarg" supported="disabled">
@@ -8760,36 +9497,108 @@
<enum value=""VK_NV_extension_164"" name="VK_EXT_EXTENSION_164_EXTENSION_NAME"/>
</require>
</extension>
- <extension name="VK_NV_extension_165" number="165" author="NV" contact="Daniel Koch @dgkoch" supported="disabled">
+ <extension name="VK_NV_shading_rate_image" number="165" type="device" requires="VK_KHR_get_physical_device_properties2" author="NV" contact="Pat Brown @nvpbrown" supported="vulkan">
<require>
- <enum value="0" name="VK_EXT_EXTENSION_165_SPEC_VERSION"/>
- <enum value=""VK_NV_extension_165"" name="VK_EXT_EXTENSION_165_EXTENSION_NAME"/>
- <enum bitpos="23" extends="VkAccessFlagBits" name="VK_ACCESS_RESERVED_23_BIT_NV"/>
- <enum bitpos="8" extends="VkImageUsageFlagBits" name="VK_IMAGE_USAGE_RESERVED_8_BIT_NV"/>
- <enum bitpos="22" extends="VkPipelineStageFlagBits" name="VK_PIPELINE_STAGE_RESERVED_22_BIT_NV"/>
+ <enum value="3" name="VK_NV_SHADING_RATE_IMAGE_SPEC_VERSION"/>
+ <enum value=""VK_NV_shading_rate_image"" name="VK_NV_SHADING_RATE_IMAGE_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV"/>
+ <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV"/>
+ <enum offset="2" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV"/>
+ <enum offset="3" extends="VkImageLayout" name="VK_IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV"/>
+ <enum offset="4" extends="VkDynamicState" name="VK_DYNAMIC_STATE_VIEWPORT_SHADING_RATE_PALETTE_NV"/>
+ <enum bitpos="23" extends="VkAccessFlagBits" name="VK_ACCESS_SHADING_RATE_IMAGE_READ_BIT_NV"/>
+ <enum bitpos="8" extends="VkImageUsageFlagBits" name="VK_IMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV"/>
+ <enum bitpos="22" extends="VkPipelineStageFlagBits" name="VK_PIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV"/>
+ <enum offset="5" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV"/>
+ <enum offset="6" extends="VkDynamicState" name="VK_DYNAMIC_STATE_VIEWPORT_COARSE_SAMPLE_ORDER_NV"/>
+ <type name="VkShadingRatePaletteEntryNV"/>
+ <type name="VkShadingRatePaletteNV"/>
+ <type name="VkPipelineViewportShadingRateImageStateCreateInfoNV"/>
+ <type name="VkPhysicalDeviceShadingRateImageFeaturesNV"/>
+ <type name="VkPhysicalDeviceShadingRateImagePropertiesNV"/>
+ <type name="VkCoarseSampleLocationNV"/>
+ <type name="VkCoarseSampleOrderCustomNV"/>
+ <type name="VkPipelineViewportCoarseSampleOrderStateCreateInfoNV"/>
+ <type name="VkCoarseSampleOrderTypeNV"/>
+ <command name="vkCmdBindShadingRateImageNV"/>
+ <command name="vkCmdSetViewportShadingRatePaletteNV"/>
+ <command name="vkCmdSetCoarseSampleOrderNV"/>
</require>
</extension>
- <extension name="VK_NV_extension_166" number="166" author="NV" contact="Daniel Koch @dgkoch" supported="disabled">
+ <extension name="VK_NVX_raytracing" number="166" type="device" requires="VK_KHR_get_physical_device_properties2,VK_KHR_get_memory_requirements2" author="NVX" contact="Eric Werness @ewerness" supported="vulkan">
<require>
- <enum value="0" name="VK_EXT_EXTENSION_166_SPEC_VERSION"/>
- <enum value=""VK_NV_extension_166"" name="VK_EXT_EXTENSION_166_EXTENSION_NAME"/>
- <enum bitpos="8" extends="VkShaderStageFlagBits" name="VK_SHADER_STAGE_RESERVED_8_BIT_NV"/>
- <enum bitpos="9" extends="VkShaderStageFlagBits" name="VK_SHADER_STAGE_RESERVED_9_BIT_NV"/>
- <enum bitpos="10" extends="VkShaderStageFlagBits" name="VK_SHADER_STAGE_RESERVED_10_BIT_NV"/>
- <enum bitpos="11" extends="VkShaderStageFlagBits" name="VK_SHADER_STAGE_RESERVED_11_BIT_NV"/>
- <enum bitpos="12" extends="VkShaderStageFlagBits" name="VK_SHADER_STAGE_RESERVED_12_BIT_NV"/>
- <enum bitpos="13" extends="VkShaderStageFlagBits" name="VK_SHADER_STAGE_RESERVED_13_BIT_NV"/>
- <enum bitpos="21" extends="VkPipelineStageFlagBits" name="VK_PIPELINE_STAGE_RESERVED_21_BIT_NV"/>
- <enum bitpos="10" extends="VkBufferUsageFlagBits" name="VK_BUFFER_USAGE_RESERVED_10_BIT_NV"/>
- <enum bitpos="21" extends="VkAccessFlagBits" name="VK_ACCESS_RESERVED_21_BIT_NV"/>
- <enum bitpos="22" extends="VkAccessFlagBits" name="VK_ACCESS_RESERVED_22_BIT_NV"/>
- <enum bitpos="5" extends="VkPipelineCreateFlagBits" name="VK_PIPELINE_CREATE_RESERVED_5_BIT_NV"/>
+ <enum value="1" name="VK_NVX_RAYTRACING_SPEC_VERSION"/>
+ <enum value=""VK_NVX_raytracing"" name="VK_NVX_RAYTRACING_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_RAYTRACING_PIPELINE_CREATE_INFO_NVX"/>
+ <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NVX"/>
+ <enum offset="2" extends="VkStructureType" name="VK_STRUCTURE_TYPE_GEOMETRY_INSTANCE_NVX"/>
+ <enum offset="3" extends="VkStructureType" name="VK_STRUCTURE_TYPE_GEOMETRY_NVX"/>
+ <enum offset="4" extends="VkStructureType" name="VK_STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NVX"/>
+ <enum offset="5" extends="VkStructureType" name="VK_STRUCTURE_TYPE_GEOMETRY_AABB_NVX"/>
+ <enum offset="6" extends="VkStructureType" name="VK_STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NVX"/>
+ <enum offset="7" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DESCRIPTOR_ACCELERATION_STRUCTURE_INFO_NVX"/>
+ <enum offset="8" extends="VkStructureType" name="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NVX"/>
+ <enum offset="9" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAYTRACING_PROPERTIES_NVX"/>
+ <enum offset="10" extends="VkStructureType" name="VK_STRUCTURE_TYPE_HIT_SHADER_MODULE_CREATE_INFO_NVX"/>
+ <enum bitpos="8" extends="VkShaderStageFlagBits" name="VK_SHADER_STAGE_RAYGEN_BIT_NVX"/>
+ <enum bitpos="9" extends="VkShaderStageFlagBits" name="VK_SHADER_STAGE_ANY_HIT_BIT_NVX"/>
+ <enum bitpos="10" extends="VkShaderStageFlagBits" name="VK_SHADER_STAGE_CLOSEST_HIT_BIT_NVX"/>
+ <enum bitpos="11" extends="VkShaderStageFlagBits" name="VK_SHADER_STAGE_MISS_BIT_NVX"/>
+ <enum bitpos="12" extends="VkShaderStageFlagBits" name="VK_SHADER_STAGE_INTERSECTION_BIT_NVX"/>
+ <enum bitpos="13" extends="VkShaderStageFlagBits" name="VK_SHADER_STAGE_CALLABLE_BIT_NVX"/>
+ <enum bitpos="21" extends="VkPipelineStageFlagBits" name="VK_PIPELINE_STAGE_RAYTRACING_BIT_NVX"/>
+ <enum bitpos="10" extends="VkBufferUsageFlagBits" name="VK_BUFFER_USAGE_RAYTRACING_BIT_NVX"/>
+ <enum offset="0" extends="VkPipelineBindPoint" name="VK_PIPELINE_BIND_POINT_RAYTRACING_NVX"/>
+ <enum offset="0" extends="VkDescriptorType" name="VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NVX"/>
+ <enum bitpos="21" extends="VkAccessFlagBits" name="VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_NVX"/>
+ <enum bitpos="22" extends="VkAccessFlagBits" name="VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_NVX"/>
+ <enum offset="0" extends="VkQueryType" name="VK_QUERY_TYPE_COMPACTED_SIZE_NVX"/>
+ <enum bitpos="5" extends="VkPipelineCreateFlagBits" name="VK_PIPELINE_CREATE_DEFER_COMPILE_BIT_NVX"/>
+ <enum offset="0" extends="VkObjectType" name="VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NVX"/>
+ <enum offset="0" extends="VkDebugReportObjectTypeEXT" name="VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_NVX_EXT"/>
+ <type name="VkRaytracingPipelineCreateInfoNVX"/>
+ <type name="VkGeometryTrianglesNVX"/>
+ <type name="VkGeometryAABBNVX"/>
+ <type name="VkGeometryDataNVX"/>
+ <type name="VkGeometryNVX"/>
+ <type name="VkGeometryFlagsNVX"/>
+ <type name="VkGeometryInstanceFlagsNVX"/>
+ <type name="VkGeometryFlagBitsNVX"/>
+ <type name="VkGeometryInstanceFlagBitsNVX"/>
+ <type name="VkAccelerationStructureCreateInfoNVX"/>
+ <type name="VkAccelerationStructureNVX"/>
+ <type name="VkBuildAccelerationStructureFlagBitsNVX"/>
+ <type name="VkBuildAccelerationStructureFlagsNVX"/>
+ <type name="VkCopyAccelerationStructureModeNVX"/>
+ <type name="VkGeometryTypeNVX"/>
+ <type name="VkBindAccelerationStructureMemoryInfoNVX"/>
+ <type name="VkDescriptorAccelerationStructureInfoNVX"/>
+ <type name="VkAccelerationStructureMemoryRequirementsInfoNVX"/>
+ <type name="VkPhysicalDeviceRaytracingPropertiesNVX"/>
+ <type name="VkMemoryRequirements2KHR"/>
+ <command name="vkCreateAccelerationStructureNVX"/>
+ <command name="vkDestroyAccelerationStructureNVX"/>
+ <command name="vkGetAccelerationStructureMemoryRequirementsNVX"/>
+ <command name="vkGetAccelerationStructureScratchMemoryRequirementsNVX"/>
+ <command name="vkBindAccelerationStructureMemoryNVX"/>
+ <command name="vkCmdBuildAccelerationStructureNVX"/>
+ <command name="vkCmdCopyAccelerationStructureNVX"/>
+ <command name="vkCmdTraceRaysNVX"/>
+ <command name="vkCreateRaytracingPipelinesNVX"/>
+ <command name="vkGetRaytracingShaderHandlesNVX"/>
+ <command name="vkGetAccelerationStructureHandleNVX"/>
+ <command name="vkCmdWriteAccelerationStructurePropertiesNVX"/>
+ <command name="vkCompileDeferredNVX"/>
</require>
</extension>
- <extension name="VK_NV_extension_167" number="167" author="NV" contact="Daniel Koch @dgkoch" supported="disabled">
+ <extension name="VK_NV_representative_fragment_test" number="167" type="device" author="NV" contact="Kedarnath Thangudu @kthangudu" supported="vulkan">
<require>
- <enum value="0" name="VK_EXT_EXTENSION_167_SPEC_VERSION"/>
- <enum value=""VK_NV_extension_167"" name="VK_EXT_EXTENSION_167_EXTENSION_NAME"/>
+ <enum value="1" name="VK_NV_REPRESENTATIVE_FRAGMENT_TEST_SPEC_VERSION"/>
+ <enum value=""VK_NV_representative_fragment_test"" name="VK_NV_REPRESENTATIVE_FRAGMENT_TEST_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV"/>
+ <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV"/>
+ <type name="VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV"/>
+ <type name="VkPipelineRepresentativeFragmentTestStateCreateInfoNV"/>
</require>
</extension>
<extension name="VK_NV_extension_168" number="168" author="NV" contact="Daniel Koch @dgkoch" supported="disabled">
@@ -8895,10 +9704,12 @@
<command name="vkCmdWriteBufferMarkerAMD"/>
</require>
</extension>
- <extension name="VK_AMD_extension_181" number="181" author="AMD" contact="Daniel Rakos @drakos-amd" supported="disabled">
+ <extension name="VK_KHR_shader_atomic_int64" number="181" type="device" author="KHR" requires="VK_KHR_get_physical_device_properties2" contact="Aaron Hagan @ahagan" supported="vulkan">
<require>
- <enum value="0" name="VK_KHR_EXTENSION_181_SPEC_VERSION"/>
- <enum value=""VK_AMD_extension_181"" name="VK_KHR_EXTENSION_181_EXTENSION_NAME"/>
+ <enum value="1" name="VK_KHR_SHADER_ATOMIC_INT64_SPEC_VERSION"/>
+ <enum value=""VK_KHR_shader_atomic_int64"" name="VK_KHR_SHADER_ATOMIC_INT64_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR"/>
+ <type name="VkPhysicalDeviceShaderAtomicInt64FeaturesKHR"/>
</require>
</extension>
<extension name="VK_AMD_extension_182" number="182" author="AMD" contact="Daniel Rakos @drakos-amd" supported="disabled">
@@ -8919,10 +9730,15 @@
<enum value=""VK_AMD_extension_184"" name="VK_KHR_EXTENSION_184_EXTENSION_NAME"/>
</require>
</extension>
- <extension name="VK_AMD_extension_185" number="185" author="AMD" contact="Daniel Rakos @drakos-amd" supported="disabled">
+ <extension name="VK_EXT_calibrated_timestamps" number="185" type="device" author="EXT" contact="Daniel Rakos @drakos-amd" supported="vulkan">
<require>
- <enum value="0" name="VK_KHR_EXTENSION_185_SPEC_VERSION"/>
- <enum value=""VK_AMD_extension_185"" name="VK_KHR_EXTENSION_185_EXTENSION_NAME"/>
+ <enum value="1" name="VK_EXT_CALIBRATED_TIMESTAMPS_SPEC_VERSION"/>
+ <enum value=""VK_EXT_calibrated_timestamps"" name="VK_EXT_CALIBRATED_TIMESTAMPS_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT"/>
+ <type name="VkTimeDomainEXT"/>
+ <type name="VkCalibratedTimestampInfoEXT"/>
+ <command name="vkGetPhysicalDeviceCalibrateableTimeDomainsEXT"/>
+ <command name="vkGetCalibratedTimestampsEXT"/>
</require>
</extension>
<extension name="VK_AMD_shader_core_properties" number="186" type="device" author="AMD" requires="VK_KHR_get_physical_device_properties2" contact="Martin Dinkov @mdinkov" supported="vulkan">
@@ -9000,10 +9816,16 @@
<enum value=""VK_GOOGLE_extension_196"" name="VK_GOOGLE_EXTENSION_196_EXTENSION_NAME"/>
</require>
</extension>
- <extension name="VK_EXT_extension_197" number="197" author="Baldur Karlsson" contact="Baldur Karlsson @baldurk" supported="disabled">
+ <extension name="VK_KHR_driver_properties" number="197" type="device" requires="VK_KHR_get_physical_device_properties2" author="KHR" contact="Daniel Rakos @drakos-amd" supported="vulkan">
<require>
- <enum value="0" name="VK_EXT_EXTENSION_197_SPEC_VERSION"/>
- <enum value=""VK_EXT_extension_197"" name="VK_EXT_EXTENSION_197_EXTENSION_NAME"/>
+ <enum value="1" name="VK_KHR_DRIVER_PROPERTIES_SPEC_VERSION"/>
+ <enum value=""VK_KHR_driver_properties"" name="VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR"/>
+ <enum name="VK_MAX_DRIVER_NAME_SIZE_KHR"/>
+ <enum name="VK_MAX_DRIVER_INFO_SIZE_KHR"/>
+ <type name="VkDriverIdKHR"/>
+ <type name="VkConformanceVersionKHR"/>
+ <type name="VkPhysicalDeviceDriverPropertiesKHR"/>
</require>
</extension>
<extension name="VK_ARM_extension_198" number="198" author="Alexander Galazin" contact="Alexander Galazin @alegal-arm" supported="disabled">
@@ -9031,38 +9853,58 @@
<enum value=""VK_KHR_extension_201"" name="VK_KHR_EXTENSION_201_EXTENSION_NAME"/>
</require>
</extension>
- <extension name="VK_NV_extension_202" number="202" author="NV" contact="Pat Brown @nvpbrown" supported="disabled">
+ <extension name="VK_NV_compute_shader_derivatives" number="202" type="device" requires="VK_KHR_get_physical_device_properties2" author="NV" contact="Pat Brown @nvpbrown" supported="vulkan">
<require>
- <enum value="0" name="VK_NV_EXTENSION_202_SPEC_VERSION"/>
- <enum value=""VK_NV_extension_202"" name="VK_NV_EXTENSION_202_EXTENSION_NAME"/>
+ <enum value="1" name="VK_NV_COMPUTE_SHADER_DERIVATIVES_SPEC_VERSION"/>
+ <enum value=""VK_NV_compute_shader_derivatives"" name="VK_NV_COMPUTE_SHADER_DERIVATIVES_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV"/>
+ <type name="VkPhysicalDeviceComputeShaderDerivativesFeaturesNV"/>
</require>
</extension>
- <extension name="VK_NV_extension_203" number="203" author="NV" contact="Pat Brown @nvpbrown" supported="disabled">
+ <extension name="VK_NV_mesh_shader" number="203" type="device" requires="VK_KHR_get_physical_device_properties2" author="NV" contact="Christoph Kubisch @pixeljetstream" supported="vulkan">
<require>
- <enum value="0" name="VK_NV_EXTENSION_203_SPEC_VERSION"/>
- <enum value=""VK_NV_extension_203"" name="VK_NV_EXTENSION_203_EXTENSION_NAME"/>
- <enum bitpos="6" extends="VkShaderStageFlagBits" name="VK_SHADER_STAGE_RESERVED_6_BIT_NV"/>
- <enum bitpos="7" extends="VkShaderStageFlagBits" name="VK_SHADER_STAGE_RESERVED_7_BIT_NV"/>
- <enum bitpos="19" extends="VkPipelineStageFlagBits" name="VK_PIPELINE_STAGE_RESERVED_19_BIT_NV"/>
- <enum bitpos="20" extends="VkPipelineStageFlagBits" name="VK_PIPELINE_STAGE_RESERVED_20_BIT_NV"/>
+ <enum value="1" name="VK_NV_MESH_SHADER_SPEC_VERSION"/>
+ <enum value=""VK_NV_mesh_shader"" name="VK_NV_MESH_SHADER_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV"/>
+ <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV"/>
+ <enum bitpos="6" extends="VkShaderStageFlagBits" name="VK_SHADER_STAGE_TASK_BIT_NV"/>
+ <enum bitpos="7" extends="VkShaderStageFlagBits" name="VK_SHADER_STAGE_MESH_BIT_NV"/>
+ <enum bitpos="19" extends="VkPipelineStageFlagBits" name="VK_PIPELINE_STAGE_TASK_SHADER_BIT_NV"/>
+ <enum bitpos="20" extends="VkPipelineStageFlagBits" name="VK_PIPELINE_STAGE_MESH_SHADER_BIT_NV"/>
+ <command name="vkCmdDrawMeshTasksNV"/>
+ <command name="vkCmdDrawMeshTasksIndirectNV"/>
+ <command name="vkCmdDrawMeshTasksIndirectCountNV"/>
+ <type name="VkPhysicalDeviceMeshShaderFeaturesNV"/>
+ <type name="VkPhysicalDeviceMeshShaderPropertiesNV"/>
+ <type name="VkDrawMeshTasksIndirectCommandNV"/>
</require>
</extension>
- <extension name="VK_NV_extension_204" number="204" author="NV" contact="Pat Brown @nvpbrown" supported="disabled">
+ <extension name="VK_NV_fragment_shader_barycentric" number="204" type="device" requires="VK_KHR_get_physical_device_properties2" author="NV" contact="Pat Brown @nvpbrown" supported="vulkan">
<require>
- <enum value="0" name="VK_NV_EXTENSION_204_SPEC_VERSION"/>
- <enum value=""VK_NV_extension_204"" name="VK_NV_EXTENSION_204_EXTENSION_NAME"/>
+ <enum value="1" name="VK_NV_FRAGMENT_SHADER_BARYCENTRIC_SPEC_VERSION"/>
+ <enum value=""VK_NV_fragment_shader_barycentric"" name="VK_NV_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV"/>
+ <type name="VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV"/>
</require>
</extension>
- <extension name="VK_NV_extension_205" number="205" author="NV" contact="Pat Brown @nvpbrown" supported="disabled">
+ <extension name="VK_NV_shader_image_footprint" number="205" type="device" requires="VK_KHR_get_physical_device_properties2" author="NV" contact="Pat Brown @nvpbrown" supported="vulkan">
<require>
- <enum value="0" name="VK_NV_EXTENSION_205_SPEC_VERSION"/>
- <enum value=""VK_NV_extension_205"" name="VK_NV_EXTENSION_205_EXTENSION_NAME"/>
+ <enum value="1" name="VK_NV_SHADER_IMAGE_FOOTPRINT_SPEC_VERSION"/>
+ <enum value=""VK_NV_shader_image_footprint"" name="VK_NV_SHADER_IMAGE_FOOTPRINT_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV"/>
+ <type name="VkPhysicalDeviceShaderImageFootprintFeaturesNV"/>
</require>
</extension>
- <extension name="VK_NV_extension_206" number="206" author="NV" contact="Pat Brown @nvpbrown" supported="disabled">
+ <extension name="VK_NV_scissor_exclusive" number="206" type="device" requires="VK_KHR_get_physical_device_properties2" author="NV" contact="Pat Brown @nvpbrown" supported="vulkan">
<require>
- <enum value="0" name="VK_NV_EXTENSION_206_SPEC_VERSION"/>
- <enum value=""VK_NV_extension_206"" name="VK_NV_EXTENSION_206_EXTENSION_NAME"/>
+ <enum value="1" name="VK_NV_SCISSOR_EXCLUSIVE_SPEC_VERSION"/>
+ <enum value=""VK_NV_scissor_exclusive"" name="VK_NV_SCISSOR_EXCLUSIVE_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV"/>
+ <enum offset="1" extends="VkDynamicState" name="VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_NV"/>
+ <enum offset="2" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV"/>
+ <type name="VkPipelineViewportExclusiveScissorStateCreateInfoNV"/>
+ <type name="VkPhysicalDeviceExclusiveScissorFeaturesNV"/>
+ <command name="vkCmdSetExclusiveScissorNV"/>
</require>
</extension>
<extension name="VK_NV_device_diagnostic_checkpoints" type="device" number="207" requires="VK_KHR_get_physical_device_properties2" author="NVIDIA" contact="Nuno Subtil @nsubtil" supported="vulkan">
@@ -9109,10 +9951,12 @@
<type name="VkPhysicalDeviceVulkanMemoryModelFeaturesKHR"/>
</require>
</extension>
- <extension name="VK_AMD_extension_213" number="213" author="AMD" contact="Neil Henning @sheredom" supported="disabled">
+ <extension name="VK_EXT_pci_bus_info" number="213" type="device" author="EXT" requires="VK_KHR_get_physical_device_properties2" contact="Matthaeus G. Chajdas @anteru" supported="vulkan">
<require>
- <enum value="0" name="VK_KHR_EXTENSION_213_SPEC_VERSION"/>
- <enum value=""VK_KHR_extension_213"" name="VK_KHR_EXTENSION_213_EXTENSION_NAME"/>
+ <enum value="1" name="VK_EXT_PCI_BUS_INFO_SPEC_VERSION"/>
+ <enum value=""VK_EXT_pci_bus_info"" name="VK_EXT_PCI_BUS_INFO_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT"/>
+ <type name="VkPhysicalDevicePCIBusInfoPropertiesEXT"/>
</require>
</extension>
<extension name="VK_AMD_extension_214" number="214" author="AMD" contact="Neil Henning @sheredom" supported="disabled">
@@ -9121,10 +9965,14 @@
<enum value=""VK_KHR_extension_214"" name="VK_KHR_EXTENSION_214_EXTENSION_NAME"/>
</require>
</extension>
- <extension name="VK_GOOGLE_extension_215" number="215" author="GOOGLE" contact="Jesse Hall @critsec" supported="disabled">
+ <extension name="VK_FUCHSIA_imagepipe_surface" number="215" type="instance" author="" requires="VK_KHR_surface" platform="fuchsia" contact="Craig Stout @cdotstout" supported="vulkan">
<require>
- <enum value="0" name="VK_KHR_EXTENSION_215_SPEC_VERSION"/>
- <enum value=""VK_KHR_extension_215"" name="VK_KHR_EXTENSION_215_EXTENSION_NAME"/>
+ <enum value="1" name="VK_FUCHSIA_IMAGEPIPE_SURFACE_SPEC_VERSION"/>
+ <enum value=""VK_FUCHSIA_imagepipe_surface"" name="VK_FUCHSIA_IMAGEPIPE_SURFACE_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA"/>
+ <type name="VkImagePipeSurfaceCreateFlagsFUCHSIA"/>
+ <type name="VkImagePipeSurfaceCreateInfoFUCHSIA"/>
+ <command name="vkCreateImagePipeSurfaceFUCHSIA"/>
</require>
</extension>
<extension name="VK_GOOGLE_extension_216" number="216" author="GOOGLE" contact="Jesse Hall @critsec" supported="disabled">
@@ -9162,5 +10010,191 @@
<enum value=""VK_EXT_extension_220"" name="VK_EXT_EXTENSION_220_EXTENSION_NAME"/>
</require>
</extension>
+ <extension name="VK_KHR_extension_221" number="221" author="KHR" contact="Tobias Hector @tobski" supported="disabled">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_221_SPEC_VERSION"/>
+ <enum value=""VK_KHR_extension_221"" name="VK_KHR_EXTENSION_221_EXTENSION_NAME"/>
+ <enum bitpos="0" extends="VkRenderPassCreateFlagBits" name="VK_RENDER_PASS_CREATE_RESERVED_0_BIT_KHR"/>
+ </require>
+ </extension>
+ <extension name="VK_EXT_extension_222" number="222" author="EXT" contact="Tobias Hector @tobski" supported="disabled">
+ <require>
+ <enum value="0" name="VK_EXT_EXTENSION_222_SPEC_VERSION"/>
+ <enum value=""VK_EXT_extension_222"" name="VK_EXT_EXTENSION_222_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_EXT_extension_223" number="223" author="EXT" contact="Tobias Hector @tobski" supported="disabled">
+ <require>
+ <enum value="0" name="VK_EXT_EXTENSION_223_SPEC_VERSION"/>
+ <enum value=""VK_EXT_extension_223"" name="VK_EXT_EXTENSION_223_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_GOOGLE_hlsl_functionality1" number="224" type="device" author="GOOGLE" contact="Hai Nguyen @chaoticbob" supported="vulkan">
+ <require>
+ <enum value="0" name="VK_GOOGLE_HLSL_FUNCTIONALITY1_SPEC_VERSION"/>
+ <enum value=""VK_GOOGLE_hlsl_functionality1"" name="VK_GOOGLE_HLSL_FUNCTIONALITY1_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_GOOGLE_decorate_string" number="225" type="device" author="GOOGLE" contact="Hai Nguyen @chaoticbob" supported="vulkan">
+ <require>
+ <enum value="0" name="VK_GOOGLE_DECORATE_STRING_SPEC_VERSION"/>
+ <enum value=""VK_GOOGLE_decorate_string"" name="VK_GOOGLE_DECORATE_STRING_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_226" number="226" author="AMD" contact="Martin Dinkov @mdinkov" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_226_SPEC_VERSION"/>
+ <enum value=""VK_AMD_extension_226"" name="VK_AMD_EXTENSION_226_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_227" number="227" author="AMD" contact="Martin Dinkov @mdinkov" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_227_SPEC_VERSION"/>
+ <enum value=""VK_AMD_extension_227"" name="VK_AMD_EXTENSION_227_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_228" number="228" author="AMD" contact="Martin Dinkov @mdinkov" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_228_SPEC_VERSION"/>
+ <enum value=""VK_AMD_extension_228"" name="VK_AMD_EXTENSION_228_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_229" number="229" author="AMD" contact="Martin Dinkov @mdinkov" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_229_SPEC_VERSION"/>
+ <enum value=""VK_AMD_extension_229"" name="VK_AMD_EXTENSION_229_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_230" number="230" author="AMD" contact="Martin Dinkov @mdinkov" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_230_SPEC_VERSION"/>
+ <enum value=""VK_AMD_extension_230"" name="VK_AMD_EXTENSION_230_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_231" number="231" author="AMD" contact="Martin Dinkov @mdinkov" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_231_SPEC_VERSION"/>
+ <enum value=""VK_AMD_extension_231"" name="VK_AMD_EXTENSION_231_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_232" number="232" author="AMD" contact="Martin Dinkov @mdinkov" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_232_SPEC_VERSION"/>
+ <enum value=""VK_AMD_extension_232"" name="VK_AMD_EXTENSION_232_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_233" number="233" author="AMD" contact="Martin Dinkov @mdinkov" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_233_SPEC_VERSION"/>
+ <enum value=""VK_AMD_extension_233"" name="VK_AMD_EXTENSION_233_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_234" number="234" author="AMD" contact="Martin Dinkov @mdinkov" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_234_SPEC_VERSION"/>
+ <enum value=""VK_AMD_extension_234"" name="VK_AMD_EXTENSION_234_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_235" number="235" author="AMD" contact="Martin Dinkov @mdinkov" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_235_SPEC_VERSION"/>
+ <enum value=""VK_AMD_extension_235"" name="VK_AMD_EXTENSION_235_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_236" number="236" author="AMD" contact="Martin Dinkov @mdinkov" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_236_SPEC_VERSION"/>
+ <enum value=""VK_AMD_extension_236"" name="VK_AMD_EXTENSION_236_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_237" number="237" author="KHR" contact="Jesse Hall @critsec" supported="disabled">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_237_SPEC_VERSION"/>
+ <enum value=""VK_KHR_extension_237"" name="VK_KHR_EXTENSION_237_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_238" number="238" author="KHR" contact="Jeff Bolz @jeffbolznv" supported="disabled">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_238_SPEC_VERSION"/>
+ <enum value=""VK_KHR_extension_238"" name="VK_KHR_EXTENSION_238_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_239" number="239" author="KHR" contact="Jeff Bolz @jeffbolznv" supported="disabled">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_239_SPEC_VERSION"/>
+ <enum value=""VK_KHR_extension_239"" name="VK_KHR_EXTENSION_239_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_240" number="240" author="KHR" contact="Sandeep Shinde @nvidia" supported="disabled">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_240_SPEC_VERSION"/>
+ <enum value=""VK_KHR_extension_240"" name="VK_KHR_EXTENSION_240_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_NV_extension_241" number="241" author="NVIDIA" contact="Nuno Subtil @nsubtil" supported="disabled">
+ <require>
+ <enum value="0" name="VK_NV_EXTENSION_241_SPEC_VERSION"/>
+ <enum value=""VK_NV_extension_241"" name="VK_NV_EXTENSION_241_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_NV_extension_242" number="242" author="NVIDIA" contact="Nuno Subtil @nsubtil" supported="disabled">
+ <require>
+ <enum value="0" name="VK_NV_EXTENSION_242_SPEC_VERSION"/>
+ <enum value=""VK_NV_extension_242"" name="VK_NV_EXTENSION_242_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_INTEL_extension_243" number="243" author="INTEL" contact="Slawek Grajewski @sgrajewski" supported="disabled">
+ <require>
+ <enum value="0" name="VK_INTEL_EXTENSION_243_SPEC_VERSION"/>
+ <enum value=""VK_INTEL_extension_243"" name="VK_INTEL_EXTENSION_243_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_MESA_extension_244" number="244" author="MESA" contact="Andres Rodriguez @lostgoat" supported="disabled">
+ <require>
+ <enum value="0" name="VK_MESA_EXTENSION_244_SPEC_VERSION"/>
+ <enum value=""VK_MESA_extension_244"" name="VK_MESA_EXTENSION_244_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_NV_extension_245" number="245" author="NV" contact="Jeff Bolz @jeffbolznv" supported="disabled">
+ <require>
+ <enum value="0" name="VK_NV_EXTENSION_245_SPEC_VERSION"/>
+ <enum value=""VK_NV_extension_245"" name="VK_NV_EXTENSION_245_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_GOOGLE_image_usage_scanout" number="1000" type="instance" author="" contact="Craig Stout @cdotstout" supported="vulkan" platform="fuchsia" protect="VK_USE_PLATFORM_MAGMA_KHR">
+ <require>
+ <enum value="1" name="VK_GOOGLE_IMAGE_USAGE_SCANOUT_SPEC_VERSION"/>
+ <enum value=""VK_GOOGLE_image_usage_scanout"" name="VK_GOOGLE_IMAGE_USAGE_SCANOUT_EXTENSION_NAME"/>
+ <enum bitpos="16" extends="VkImageUsageFlagBits" name="VK_IMAGE_USAGE_SCANOUT_BIT_GOOGLE"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_external_memory_fuchsia" number="1001" type="device" author="" requires="VK_KHR_external_memory_capabilities,VK_KHR_external_memory" platform="fuchsia" protect="VK_USE_PLATFORM_MAGMA_KHR" contact="Craig Stout @cdotstout" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_KHR_EXTERNAL_MEMORY_FUCHSIA_SPEC_VERSION"/>
+ <enum value=""VK_KHR_external_memory_fuchsia"" name="VK_KHR_EXTERNAL_MEMORY_FUCHSIA_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_IMPORT_MEMORY_FUCHSIA_HANDLE_INFO_KHR"/>
+ <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_MEMORY_FUCHSIA_HANDLE_PROPERTIES_KHR"/>
+ <enum offset="2" extends="VkStructureType" name="VK_STRUCTURE_TYPE_MEMORY_GET_FUCHSIA_HANDLE_INFO_KHR"/>
+ <enum bitpos="11" extends="VkExternalMemoryHandleTypeFlagBits" name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_FUCHSIA_VMO_BIT_KHR"/>
+ <type name="VkImportMemoryFuchsiaHandleInfoKHR"/>
+ <type name="VkMemoryFuchsiaHandlePropertiesKHR"/>
+ <type name="VkMemoryGetFuchsiaHandleInfoKHR"/>
+ <command name="vkGetMemoryFuchsiaHandleKHR"/>
+ <command name="vkGetMemoryFuchsiaHandlePropertiesKHR"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_external_semaphore_fuchsia" number="1002" type="device" author="" requires="VK_KHR_external_semaphore_capabilities,VK_KHR_external_semaphore" platform="fuchsia" protect="VK_USE_PLATFORM_MAGMA_KHR" contact="Craig Stout @cdotstout" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_KHR_EXTERNAL_SEMAPHORE_FUCHSIA_SPEC_VERSION"/>
+ <enum value=""VK_KHR_external_semaphore_fuchsia"" name="VK_KHR_EXTERNAL_SEMAPHORE_FUCHSIA_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FUCHSIA_HANDLE_INFO_KHR"/>
+ <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_SEMAPHORE_GET_FUCHSIA_HANDLE_INFO_KHR"/>
+ <enum bitpos="5" extends="VkExternalSemaphoreHandleTypeFlagBits" name="VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_FUCHSIA_FENCE_BIT_KHR"/>
+ <type name="VkImportSemaphoreFuchsiaHandleInfoKHR"/>
+ <type name="VkSemaphoreGetFuchsiaHandleInfoKHR"/>
+ <command name="vkImportSemaphoreFuchsiaHandleKHR"/>
+ <command name="vkGetSemaphoreFuchsiaHandleKHR"/>
+ </require>
+ </extension>
</extensions>
</registry>
diff --git a/src/vulkan/util/BUILD.gn b/src/vulkan/util/BUILD.gn
new file mode 100644
index 0000000..b61d07b
--- /dev/null
+++ b/src/vulkan/util/BUILD.gn
@@ -0,0 +1,65 @@
+# Copyright 2017 The Fuchsia Authors
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+import("../../../mesa.gni")
+
+config("config_util") {
+ include_dirs = [
+ "$target_gen_dir",
+ "."
+ ]
+}
+
+mesa_source_set("util") {
+ public_configs = [ ":config_util" ]
+ public_deps = [ "$mesa_build_root/include:vulkan" ]
+ deps = [ "$mesa_build_root/src/util" ]
+ sources = [
+ "$target_gen_dir/vk_enum_to_str.c",
+ "vk_enum_to_str.h",
+ "vk_util.c",
+ "vk_util.h",
+ "vk_debug_report.c",
+ "vk_debug_report.h",
+ ]
+ deps += [ ":gen_enum_to_str" ]
+}
+
+action("gen_enum_to_str") {
+ outputs = [ "$target_gen_dir/vk_enum_to_str.h",
+ "$target_gen_dir/vk_enum_to_str.c",
+ ]
+
+ script = "gen_enum_to_str.py"
+
+ inputs = [
+ "$mesa_build_root/src/vulkan/registry/vk.xml",
+ ]
+
+ args = [
+ "--pythonpath",
+ rebase_path("$magma_python_path"),
+ "--xml",
+ rebase_path("$mesa_build_root") + "/src/vulkan/registry/vk.xml",
+ "--outdir",
+ rebase_path("$target_gen_dir")
+ ]
+}
diff --git a/src/vulkan/util/gen_enum_to_str.py b/src/vulkan/util/gen_enum_to_str.py
old mode 100644
new mode 100755
index fb9ecd6..6d36ef5
--- a/src/vulkan/util/gen_enum_to_str.py
+++ b/src/vulkan/util/gen_enum_to_str.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
# encoding=utf-8
# Copyright © 2017 Intel Corporation
@@ -26,6 +27,10 @@
import os
import textwrap
import xml.etree.cElementTree as et
+import sys
+
+# --pythonpath must be the first argument
+sys.path.append(sys.argv[2])
from mako.template import Template
@@ -219,6 +224,7 @@
def main():
parser = argparse.ArgumentParser()
+ parser.add_argument('--pythonpath')
parser.add_argument('--xml', required=True,
help='Vulkan API XML files',
action='append',
diff --git a/src/vulkan/util/vk_alloc.h b/src/vulkan/util/vk_alloc.h
index 2e807a9..69cead7 100644
--- a/src/vulkan/util/vk_alloc.h
+++ b/src/vulkan/util/vk_alloc.h
@@ -75,7 +75,7 @@
return NULL;
size_t size = strlen(s) + 1;
- char *copy = vk_alloc(alloc, size, 1, scope);
+ char *copy = (char*) vk_alloc(alloc, size, 1, scope);
if (copy == NULL)
return NULL;
diff --git a/src/vulkan/wsi/BUILD.gn b/src/vulkan/wsi/BUILD.gn
new file mode 100644
index 0000000..2d7fdb7
--- /dev/null
+++ b/src/vulkan/wsi/BUILD.gn
@@ -0,0 +1,39 @@
+# Copyright 2016 The Fuchsia Authors
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+import("../../../mesa.gni")
+
+config("wsi_config") {
+ include_dirs = [
+ ".",
+ "$mesa_build_root/include/drm-uapi",
+ ]
+}
+
+mesa_source_set("wsi") {
+ public_configs = [ ":wsi_config" ]
+ public_deps = [ "$mesa_build_root/src/vulkan/util" ]
+ deps = [ "$mesa_build_root/src/util:headers" ]
+ sources = [
+ "wsi_common.h",
+ "wsi_common.c",
+ ]
+}
diff --git a/tests/BUILD.gn b/tests/BUILD.gn
new file mode 100644
index 0000000..0a6b1eb
--- /dev/null
+++ b/tests/BUILD.gn
@@ -0,0 +1,41 @@
+# Copyright 2016 The Fuchsia Authors
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+group("tests") {
+ testonly = true
+
+ public_deps = [
+ ":mesa_unit_tests",
+ ]
+}
+
+executable("mesa_unit_tests") {
+ testonly = true
+
+ sources = [
+ "main.cc",
+ ]
+
+ deps = [
+ "unit_tests",
+ "//third_party/gtest",
+ ]
+}
diff --git a/tests/main.cc b/tests/main.cc
new file mode 100644
index 0000000..4cd0432
--- /dev/null
+++ b/tests/main.cc
@@ -0,0 +1,10 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "gtest/gtest.h"
+int main(int argc, char** argv)
+{
+ testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
diff --git a/tests/unit_tests/BUILD.gn b/tests/unit_tests/BUILD.gn
new file mode 100644
index 0000000..0319da0
--- /dev/null
+++ b/tests/unit_tests/BUILD.gn
@@ -0,0 +1,38 @@
+# Copyright 2016 The Fuchsia Authors
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+import("../../mesa.gni")
+
+source_set("unit_tests") {
+ testonly = true
+
+ sources = [
+ "test_drm_command_buffer.cc",
+ ]
+
+ deps = [
+ "$magma_build_root/include:magma_abi",
+ "$magma_build_root/src/magma_util/platform:buffer",
+ "$mesa_build_root/src/magma",
+ "$magma_build_root/tests/mock:magma_system",
+ "//third_party/gtest",
+ ]
+}
diff --git a/tests/unit_tests/test_drm_command_buffer.cc b/tests/unit_tests/test_drm_command_buffer.cc
new file mode 100644
index 0000000..ede3867
--- /dev/null
+++ b/tests/unit_tests/test_drm_command_buffer.cc
@@ -0,0 +1,214 @@
+#include "drm_command_buffer.h"
+#include "magma.h"
+#include "magma_util/macros.h"
+#include "gtest/gtest.h"
+#include <vector>
+
+class Buffer {
+public:
+ Buffer(magma_connection_t* connection, magma_buffer_t handle, uint64_t size)
+ : connection_(connection), handle_(handle), size_(size)
+ {
+ }
+ ~Buffer() { magma_release_buffer(connection_, handle_); }
+
+ uint64_t size() { return size_; }
+ uint64_t id() { return magma_get_buffer_id(handle_); }
+ magma_buffer_t handle() { return handle_; }
+
+private:
+ magma_connection_t* connection_;
+ magma_buffer_t handle_;
+ uint64_t size_;
+};
+
+class TestDrmCommandBuffer {
+public:
+ TestDrmCommandBuffer() { connection_ = magma_create_connection(0, 0); }
+
+ ~TestDrmCommandBuffer() { magma_release_connection(connection_); }
+
+ void NoBuffers()
+ {
+ drm_i915_gem_execbuffer2 execbuffer2 = {
+ .buffers_ptr = reinterpret_cast<uint64_t>(nullptr),
+ .buffer_count = 0,
+ .batch_start_offset = 0,
+ .batch_len = 0, // not used
+ .flags = I915_EXEC_HANDLE_LUT,
+ };
+
+ std::vector<uint64_t> wait_semaphores;
+ std::vector<uint64_t> signal_semaphores;
+
+ uint64_t size = DrmCommandBuffer::RequiredSize(&execbuffer2, 0);
+ EXPECT_EQ(sizeof(magma_system_command_buffer), size);
+
+ std::vector<uint8_t> buffer(size);
+
+ EXPECT_TRUE(DrmCommandBuffer::Translate(&execbuffer2, wait_semaphores, signal_semaphores,
+ buffer.data()));
+
+ auto command_buffer = reinterpret_cast<magma_system_command_buffer*>(buffer.data());
+ EXPECT_EQ(-1, (int)command_buffer->batch_buffer_resource_index);
+ EXPECT_EQ(0u, command_buffer->batch_start_offset);
+ EXPECT_EQ(0u, command_buffer->num_resources);
+ EXPECT_EQ(0u, command_buffer->wait_semaphore_count);
+ EXPECT_EQ(0u, command_buffer->signal_semaphore_count);
+ }
+
+ std::unique_ptr<Buffer> CreateBuffer(uint64_t size)
+ {
+ magma_buffer_t handle;
+ if (magma_create_buffer(connection_, size, &size, &handle) != 0)
+ return DRETP(nullptr, "magma_system_alloc failed");
+ return std::make_unique<Buffer>(connection_, handle, size);
+ }
+
+ void WithBuffers(bool add_relocs, uint32_t wait_semaphore_count, uint32_t signal_semaphore_count)
+ {
+ std::vector<std::unique_ptr<Buffer>> buffers;
+
+ buffers.push_back(CreateBuffer(PAGE_SIZE));
+ buffers.push_back(CreateBuffer(PAGE_SIZE));
+
+ std::vector<uint64_t> wait_semaphore_ids;
+ for (uint32_t i = 0; i < wait_semaphore_count; i++) {
+ wait_semaphore_ids.push_back(10 + i);
+ }
+ std::vector<uint64_t> signal_semaphore_ids;
+ for (uint32_t i = 0; i < signal_semaphore_count; i++) {
+ signal_semaphore_ids.push_back(100 + i);
+ }
+
+ std::vector<drm_i915_gem_relocation_entry> exec_relocs_0;
+ std::vector<drm_i915_gem_relocation_entry> exec_relocs_1;
+ std::vector<drm_i915_gem_exec_object2> exec_res;
+
+ if (add_relocs) {
+ exec_relocs_0.push_back({.target_handle = 1, // index
+ .delta = 0xcafebeef,
+ .offset = buffers[0]->size() / 2,
+ .presumed_offset = 0, // not used
+ .read_domains = 0,
+ .write_domain = 0});
+ exec_relocs_0.push_back({.target_handle = 1, // index
+ .delta = 0xbeefcafe,
+ .offset = buffers[0]->size() / 3,
+ .presumed_offset = 0, // not used
+ .read_domains = 0,
+ .write_domain = 0});
+ exec_relocs_1.push_back({.target_handle = 0, // index
+ .delta = 0xcafebeef,
+ .offset = buffers[1]->size() / 2,
+ .presumed_offset = 0, // not used
+ .read_domains = 0,
+ .write_domain = 0});
+ }
+
+ exec_res.push_back({
+ .handle = buffers[0]->handle(),
+ .relocation_count = static_cast<uint32_t>(exec_relocs_0.size()),
+ .relocs_ptr = reinterpret_cast<uint64_t>(exec_relocs_0.data()),
+ .alignment = 0,
+ .offset = 0,
+ .flags = 0,
+ .rsvd1 = 10, // offset
+ .rsvd2 = buffers[0]->size() - 10, // length
+ });
+
+ exec_res.push_back({
+ .handle = buffers[1]->handle(),
+ .relocation_count = static_cast<uint32_t>(exec_relocs_1.size()),
+ .relocs_ptr = reinterpret_cast<uint64_t>(exec_relocs_1.data()),
+ .alignment = 0,
+ .offset = 0,
+ .flags = 0,
+ .rsvd1 = 20, // offset
+ .rsvd2 = buffers[1]->size() - 20, // length
+ });
+
+ drm_i915_gem_execbuffer2 exec_buffer = {
+ .buffers_ptr = reinterpret_cast<uint64_t>(exec_res.data()),
+ .buffer_count = static_cast<uint32_t>(exec_res.size()),
+ .batch_start_offset = static_cast<uint32_t>(buffers[1]->size()) / 2,
+ .batch_len = 0, // not used
+ .flags = I915_EXEC_HANDLE_LUT,
+ };
+
+ uint64_t size = DrmCommandBuffer::RequiredSize(&exec_buffer, wait_semaphore_ids.size() + signal_semaphore_ids.size());
+ uint64_t expected_size =
+ sizeof(magma_system_command_buffer) +
+ (wait_semaphore_ids.size() + signal_semaphore_ids.size()) * sizeof(uint64_t) +
+ sizeof(magma_system_exec_resource) * exec_res.size() +
+ sizeof(magma_system_relocation_entry) * (exec_relocs_0.size() + exec_relocs_1.size());
+ EXPECT_EQ(expected_size, size);
+
+ std::vector<uint8_t> buffer(size);
+ EXPECT_TRUE(DrmCommandBuffer::Translate(&exec_buffer, wait_semaphore_ids,
+ signal_semaphore_ids, buffer.data()));
+
+ auto command_buffer = reinterpret_cast<magma_system_command_buffer*>(buffer.data());
+ EXPECT_EQ(exec_buffer.buffer_count - 1, command_buffer->batch_buffer_resource_index);
+ EXPECT_EQ(exec_buffer.batch_start_offset, command_buffer->batch_start_offset);
+ EXPECT_EQ(exec_buffer.buffer_count, command_buffer->num_resources);
+ EXPECT_EQ(wait_semaphore_ids.size(), command_buffer->wait_semaphore_count);
+ EXPECT_EQ(signal_semaphore_ids.size(), command_buffer->signal_semaphore_count);
+
+ auto semaphores = reinterpret_cast<uint64_t*>(command_buffer + 1);
+ for (uint32_t i = 0; i < wait_semaphore_count; i++) {
+ EXPECT_EQ(wait_semaphore_ids[i], semaphores[i]);
+ }
+ semaphores += wait_semaphore_count;
+ for (uint32_t i = 0; i < signal_semaphore_count; i++) {
+ EXPECT_EQ(signal_semaphore_ids[i], semaphores[i]);
+ }
+
+ auto exec_resource =
+ reinterpret_cast<magma_system_exec_resource*>(semaphores + signal_semaphore_count);
+ for (uint32_t i = 0; i < exec_res.size(); i++) {
+ EXPECT_EQ(exec_resource->buffer_id, buffers[i]->id());
+ EXPECT_EQ(exec_resource->offset, exec_res[i].rsvd1);
+ EXPECT_EQ(exec_resource->length, exec_res[i].rsvd2);
+ EXPECT_EQ(exec_resource->num_relocations, exec_res[i].relocation_count);
+ exec_resource++;
+ }
+
+ if (add_relocs) {
+ auto reloc = reinterpret_cast<magma_system_relocation_entry*>(exec_resource);
+ for (uint32_t i = 0; i < exec_relocs_0.size(); i++) {
+ EXPECT_EQ(reloc->offset, exec_relocs_0[i].offset);
+ EXPECT_EQ(reloc->target_resource_index, exec_relocs_0[i].target_handle);
+ EXPECT_EQ(reloc->target_offset, exec_relocs_0[i].delta);
+ reloc++;
+ }
+ for (uint32_t i = 0; i < exec_relocs_1.size(); i++) {
+ EXPECT_EQ(reloc->offset, exec_relocs_1[i].offset);
+ EXPECT_EQ(reloc->target_resource_index, exec_relocs_1[i].target_handle);
+ EXPECT_EQ(reloc->target_offset, exec_relocs_1[i].delta);
+ reloc++;
+ }
+ }
+ }
+
+private:
+ magma_connection_t* connection_;
+};
+
+TEST(DrmCommandBuffer, NoBuffers)
+{
+ TestDrmCommandBuffer test;
+ test.NoBuffers();
+}
+
+TEST(DrmCommandBuffer, SomeBuffers)
+{
+ TestDrmCommandBuffer test;
+ test.WithBuffers(false, 1, 2);
+}
+
+TEST(DrmCommandBuffer, BuffersWithRelocs)
+{
+ TestDrmCommandBuffer test;
+ test.WithBuffers(true, 3, 2);
+}