Add ktx
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
<!-- Copyright 2023 The Khronos Group Inc. -->
|
||||
<!-- SPDX-License-Identifier: Apache-2.0 -->
|
||||
|
||||
# Why Vulkan Header Files Here?
|
||||
|
||||
The `vulkan_core.h` included here is custom generated from the Vulkan
|
||||
Registry's `vk.xml` in order to include the format enumerators for the
|
||||
ASTC 3d formats. We need to support these formats because there are OpenGL implementations even though, as yet, there are no Vulkan implementations.
|
||||
|
||||
See `./build_custom_vulkan_core` for instructions on generating the file.
|
||||
|
||||
`vulkan_core.h` is used to generate the switch bodies `dfd2vk.inl` and `vk2dfd.inl`.
|
||||
|
||||
## To Do
|
||||
|
||||
Generate the switch bodies from `vk.xml` instead.
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
# Copyright 2023 The Khronos Group Inc.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# Build vulkan_core.h to be included with dfdutils. It is the standard
|
||||
# vulkan_core.h with the unreleased VK_EXT_texture_compression_ASTC_3d
|
||||
# extension force included and VK_KHR_video_decode_h264 and
|
||||
# VK_KHR_video_decode_h265 removed due to their including other large
|
||||
# header files.
|
||||
|
||||
# You need python3 installed to use this script. You also need
|
||||
# the pyparsing module. Install with `pip install pyparsing`.
|
||||
|
||||
# Note that genvk.py explicitly calls for /usr/bin/python3. If you are
|
||||
# on macOS, the only way to get this is to install the Xcode command
|
||||
# line tools. If this is not possible, use Docker.
|
||||
|
||||
# If you do not have python but have Docker and the Vulkan docker image
|
||||
# installed you can do the work with that but you will have to manually
|
||||
# run the command and copy the resulting file here.
|
||||
#
|
||||
|
||||
function usage() {
|
||||
echo "$0 <path>"
|
||||
echo "Path to vulkan directory in your clone of the Khronos GitLab vulkan"
|
||||
echo "repo or path to your clone of the GitHub KhronosGroup/Vulkan-Docs"
|
||||
echo "repo. GitLab is the preferred source."
|
||||
}
|
||||
|
||||
if [ "$1" = "-h" -o "$1" = "--help" ]; then
|
||||
usage
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Need path."
|
||||
usage
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Generated file goes in same directory as this script.
|
||||
dst=$(dirname $0)
|
||||
if [ ! "${dst:0:1}" = "/" ]; then
|
||||
dst="$(pwd)/$dst"
|
||||
fi
|
||||
|
||||
cd $1
|
||||
scripts/genvk.py -extension VK_EXT_extension_289 -removeExtensions '(VK_KHR_video_decode_av1|VK_KHR_video_decode_h264|VK_KHR_video_encode_h264|VK_KHR_video_decode_h265|VK_KHR_video_encode_h265)' -registry xml/vk.xml -o $dst vulkan_core.h
|
||||
|
||||
# To use with Docker
|
||||
# 1. Install Docker
|
||||
# 2. In a terminal
|
||||
# $ cd <your clone of the GitLab vulkan repo>
|
||||
# $ scripts/runDocker
|
||||
# 3. At the prompt in the shell started by Docker
|
||||
# $ <paste the above scripts/genvk command with $dst replaced with '.'>
|
||||
# $ ^d # to exit the Docker shell.
|
||||
# 4. Back at the prompt in no. 2
|
||||
# $ mv vulkan_core.h <path to your dfdutils repo clone/vulkan/
|
||||
# $ cd <path to your dfdutils repo>
|
||||
# The pasting and copying steps are needed because programs cannot reach
|
||||
# outside docker to the host file system.
|
||||
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
//
|
||||
// File: vk_platform.h
|
||||
//
|
||||
/*
|
||||
** Copyright 2014-2023 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
|
||||
#ifndef VK_PLATFORM_H_
|
||||
#define VK_PLATFORM_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif // __cplusplus
|
||||
|
||||
/*
|
||||
***************************************************************************************************
|
||||
* Platform-specific directives and type declarations
|
||||
***************************************************************************************************
|
||||
*/
|
||||
|
||||
/* Platform-specific calling convention macros.
|
||||
*
|
||||
* Platforms should define these so that Vulkan clients call Vulkan commands
|
||||
* with the same calling conventions that the Vulkan implementation expects.
|
||||
*
|
||||
* VKAPI_ATTR - Placed before the return type in function declarations.
|
||||
* Useful for C++11 and GCC/Clang-style function attribute syntax.
|
||||
* VKAPI_CALL - Placed after the return type in function declarations.
|
||||
* Useful for MSVC-style calling convention syntax.
|
||||
* VKAPI_PTR - Placed between the '(' and '*' in function pointer types.
|
||||
*
|
||||
* Function declaration: VKAPI_ATTR void VKAPI_CALL vkCommand(void);
|
||||
* Function pointer type: typedef void (VKAPI_PTR *PFN_vkCommand)(void);
|
||||
*/
|
||||
#if defined(_WIN32)
|
||||
// On Windows, Vulkan commands use the stdcall convention
|
||||
#define VKAPI_ATTR
|
||||
#define VKAPI_CALL __stdcall
|
||||
#define VKAPI_PTR VKAPI_CALL
|
||||
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7
|
||||
#error "Vulkan is not supported for the 'armeabi' NDK ABI"
|
||||
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE)
|
||||
// On Android 32-bit ARM targets, Vulkan functions use the "hardfloat"
|
||||
// calling convention, i.e. float parameters are passed in registers. This
|
||||
// is true even if the rest of the application passes floats on the stack,
|
||||
// as it does by default when compiling for the armeabi-v7a NDK ABI.
|
||||
#define VKAPI_ATTR __attribute__((pcs("aapcs-vfp")))
|
||||
#define VKAPI_CALL
|
||||
#define VKAPI_PTR VKAPI_ATTR
|
||||
#else
|
||||
// On other platforms, use the default calling convention
|
||||
#define VKAPI_ATTR
|
||||
#define VKAPI_CALL
|
||||
#define VKAPI_PTR
|
||||
#endif
|
||||
|
||||
#if !defined(VK_NO_STDDEF_H)
|
||||
#include <stddef.h>
|
||||
#endif // !defined(VK_NO_STDDEF_H)
|
||||
|
||||
#if !defined(VK_NO_STDINT_H)
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1600)
|
||||
typedef signed __int8 int8_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef signed __int16 int16_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef signed __int32 int32_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef signed __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
#endif // !defined(VK_NO_STDINT_H)
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif
|
||||
+19185
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user