diff options
| -rw-r--r-- | libs/binder/Android.bp | 1 | ||||
| -rw-r--r-- | libs/binder/IPCThreadState.cpp | 10 | ||||
| -rw-r--r-- | libs/binder/include/binder/IPCThreadState.h | 30 | ||||
| -rw-r--r-- | libs/binderthreadstate/Android.bp | 44 | ||||
| -rw-r--r-- | libs/binderthreadstate/IPCThreadStateBase.cpp | 89 | ||||
| -rw-r--r-- | libs/binderthreadstate/include/binderthreadstate/IPCThreadStateBase.h | 44 | ||||
| -rw-r--r-- | libs/input/tests/VelocityTracker_test.cpp | 165 | ||||
| -rw-r--r-- | vulkan/api/vulkan.api | 151 | ||||
| -rw-r--r-- | vulkan/include/vulkan/vulkan_core.h | 74 |
9 files changed, 534 insertions, 74 deletions
diff --git a/libs/binder/Android.bp b/libs/binder/Android.bp index 61b881861b..da10687476 100644 --- a/libs/binder/Android.bp +++ b/libs/binder/Android.bp @@ -119,6 +119,7 @@ cc_library_shared { "liblog", "libcutils", "libutils", + "libbinderthreadstate", ], header_libs: [ diff --git a/libs/binder/IPCThreadState.cpp b/libs/binder/IPCThreadState.cpp index b2217b5333..f052bcb982 100644 --- a/libs/binder/IPCThreadState.cpp +++ b/libs/binder/IPCThreadState.cpp @@ -17,6 +17,7 @@ #define LOG_TAG "IPCThreadState" #include <binder/IPCThreadState.h> +#include <binderthreadstate/IPCThreadStateBase.h> #include <binder/Binder.h> #include <binder/BpBinder.h> @@ -742,6 +743,7 @@ IPCThreadState::IPCThreadState() clearCaller(); mIn.setDataCapacity(256); mOut.setDataCapacity(256); + mIPCThreadStateBase = IPCThreadStateBase::self(); } IPCThreadState::~IPCThreadState() @@ -1082,6 +1084,9 @@ status_t IPCThreadState::executeCommand(int32_t cmd) "Not enough command data for brTRANSACTION"); if (result != NO_ERROR) break; + //Record the fact that we're in a binder call. + mIPCThreadStateBase->pushCurrentState( + IPCThreadStateBase::CallState::BINDER); Parcel buffer; buffer.ipcSetDataReference( reinterpret_cast<const uint8_t*>(tr.data.ptr.buffer), @@ -1129,6 +1134,7 @@ status_t IPCThreadState::executeCommand(int32_t cmd) error = the_context_object->transact(tr.code, buffer, &reply, tr.flags); } + mIPCThreadStateBase->popCurrentState(); //ALOGI("<<<< TRANSACT from pid %d restore pid %d uid %d\n", // mCallingPid, origPid, origUid); @@ -1192,6 +1198,10 @@ status_t IPCThreadState::executeCommand(int32_t cmd) return result; } +bool IPCThreadState::isServingCall() const { + return mIPCThreadStateBase->getCurrentBinderCallState() == IPCThreadStateBase::CallState::BINDER; +} + void IPCThreadState::threadDestructor(void *st) { IPCThreadState* const self = static_cast<IPCThreadState*>(st); diff --git a/libs/binder/include/binder/IPCThreadState.h b/libs/binder/include/binder/IPCThreadState.h index dce3f3856b..40b51adb06 100644 --- a/libs/binder/include/binder/IPCThreadState.h +++ b/libs/binder/include/binder/IPCThreadState.h @@ -29,6 +29,8 @@ typedef int uid_t; // --------------------------------------------------------------------------- namespace android { +class IPCThreadStateBase; + class IPCThreadState { public: @@ -89,6 +91,33 @@ public: // the maximum number of binder threads threads allowed for this process. void blockUntilThreadAvailable(); + + // Is this thread currently serving a binder call. This method + // returns true if while traversing backwards from the function call + // stack for this thread, we encounter a function serving a binder + // call before encountering a hwbinder call / hitting the end of the + // call stack. + // Eg: If thread T1 went through the following call pattern + // 1) T1 receives and executes hwbinder call H1. + // 2) While handling H1, T1 makes binder call B1. + // 3) The handler of B1, calls into T1 with a callback B2. + // If isServingCall() is called during H1 before 3), this method + // will return false, else true. + // + // ---- + // | B2 | ---> While callback B2 is being handled, during 3). + // ---- + // | H1 | ---> While H1 is being handled. + // ---- + // Fig: Thread Call stack while handling B2 + // + // This is since after 3), while traversing the thread call stack, + // we hit a binder call before a hwbinder call / end of stack. This + // method may be typically used to determine whether to use + // hardware::IPCThreadState methods or IPCThreadState methods to + // infer information about thread state. + bool isServingCall() const; + private: IPCThreadState(); ~IPCThreadState(); @@ -128,6 +157,7 @@ private: uid_t mCallingUid; int32_t mStrictModePolicy; int32_t mLastTransactionBinderFlags; + IPCThreadStateBase *mIPCThreadStateBase; }; }; // namespace android diff --git a/libs/binderthreadstate/Android.bp b/libs/binderthreadstate/Android.bp new file mode 100644 index 0000000000..7106cbbf75 --- /dev/null +++ b/libs/binderthreadstate/Android.bp @@ -0,0 +1,44 @@ +// Copyright (C) 2018 The Android Open Source Project +// +// 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. + +cc_library { + name: "libbinderthreadstate", + recovery_available: true, + vendor_available: false, + vndk: { + enabled: true, + support_system_process: true, + }, + srcs: [ + "IPCThreadStateBase.cpp", + ], + + shared_libs: [ + "libbase", + "liblog", + "libcutils", + "libutils", + ], + + export_include_dirs: ["include"], + + sanitize: { + misc_undefined: ["integer"], + }, + + cflags: [ + "-Wall", + "-Werror", + ], +} diff --git a/libs/binderthreadstate/IPCThreadStateBase.cpp b/libs/binderthreadstate/IPCThreadStateBase.cpp new file mode 100644 index 0000000000..fede151774 --- /dev/null +++ b/libs/binderthreadstate/IPCThreadStateBase.cpp @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * 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. + */ + +#define LOG_TAG "IPCThreadStateBase" + +#include <binderthreadstate/IPCThreadStateBase.h> +#include <android-base/macros.h> + +#include <utils/Log.h> + +#include <errno.h> +#include <inttypes.h> +#include <pthread.h> + +namespace android { + +static pthread_mutex_t gTLSMutex = PTHREAD_MUTEX_INITIALIZER; +static bool gHaveTLS = false; +static pthread_key_t gTLS = 0; + +IPCThreadStateBase::IPCThreadStateBase() { + pthread_setspecific(gTLS, this); +} + +IPCThreadStateBase* IPCThreadStateBase::self() +{ + if (gHaveTLS) { +restart: + const pthread_key_t k = gTLS; + IPCThreadStateBase* st = (IPCThreadStateBase*)pthread_getspecific(k); + if (st) return st; + return new IPCThreadStateBase; + } + + pthread_mutex_lock(&gTLSMutex); + if (!gHaveTLS) { + int key_create_value = pthread_key_create(&gTLS, threadDestructor); + if (key_create_value != 0) { + pthread_mutex_unlock(&gTLSMutex); + ALOGW("IPCThreadStateBase::self() unable to create TLS key, expect a crash: %s\n", + strerror(key_create_value)); + return nullptr; + } + gHaveTLS = true; + } + pthread_mutex_unlock(&gTLSMutex); + goto restart; +} + +void IPCThreadStateBase::pushCurrentState(CallState callState) { + mCallStateStack.emplace(callState); +} + +IPCThreadStateBase::CallState IPCThreadStateBase::popCurrentState() { + ALOG_ASSERT(mCallStateStack.size > 0); + CallState val = mCallStateStack.top(); + mCallStateStack.pop(); + return val; +} + +IPCThreadStateBase::CallState IPCThreadStateBase::getCurrentBinderCallState() { + if (mCallStateStack.size() > 0) { + return mCallStateStack.top(); + } + return CallState::NONE; +} + +void IPCThreadStateBase::threadDestructor(void *st) +{ + IPCThreadStateBase* const self = static_cast<IPCThreadStateBase*>(st); + if (self) { + delete self; + } +} + +}; // namespace android diff --git a/libs/binderthreadstate/include/binderthreadstate/IPCThreadStateBase.h b/libs/binderthreadstate/include/binderthreadstate/IPCThreadStateBase.h new file mode 100644 index 0000000000..6fdcc84054 --- /dev/null +++ b/libs/binderthreadstate/include/binderthreadstate/IPCThreadStateBase.h @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * 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. + */ + +#ifndef BINDER_THREADSTATE_IPC_THREADSTATE_BASE_H +#define BINDER_THREADSTATE_IPC_THREADSTATE_BASE_H + +#include <stack> +namespace android { + +class IPCThreadStateBase { +public: + enum CallState { + HWBINDER, + BINDER, + NONE, + }; + static IPCThreadStateBase* self(); + void pushCurrentState(CallState callState); + CallState popCurrentState(); + CallState getCurrentBinderCallState(); + +private: + IPCThreadStateBase(); + static void threadDestructor(void *st); + + std::stack<CallState> mCallStateStack; +}; + +}; // namespace android + +#endif // BINDER_THREADSTATE_IPC_THREADSTATE_BASE_H diff --git a/libs/input/tests/VelocityTracker_test.cpp b/libs/input/tests/VelocityTracker_test.cpp index 43b6012e0d..9da2e2a315 100644 --- a/libs/input/tests/VelocityTracker_test.cpp +++ b/libs/input/tests/VelocityTracker_test.cpp @@ -16,6 +16,7 @@ #define LOG_TAG "VelocityTracker_test" +#include <array> #include <math.h> #include <android-base/stringprintf.h> @@ -32,29 +33,35 @@ constexpr int32_t DEFAULT_POINTER_ID = 0; // pointer ID used for manually define // here EV = expected value, tol = VELOCITY_TOLERANCE constexpr float VELOCITY_TOLERANCE = 0.2; +// estimate coefficients must be within 0.001% of the target value +constexpr float COEFFICIENT_TOLERANCE = 0.00001; + // --- VelocityTrackerTest --- class VelocityTrackerTest : public testing::Test { }; -static void checkVelocity(float Vactual, float Vtarget) { - // Compare directions - if ((Vactual > 0 && Vtarget <= 0) || (Vactual < 0 && Vtarget >= 0)) { - FAIL() << StringPrintf("Velocity %f does not have the same direction" - " as the target velocity %f", Vactual, Vtarget); +/* + * Similar to EXPECT_NEAR, but ensures that the difference between the two float values + * is at most a certain fraction of the target value. + * If fraction is zero, require exact match. + */ +static void EXPECT_NEAR_BY_FRACTION(float actual, float target, float fraction) { + float tolerance = fabsf(target * fraction); + + if (target == 0 && fraction != 0) { + // If target is zero, this would force actual == target, which is too harsh. + // Relax this requirement a little. The value is determined empirically from the + // coefficients computed by the quadratic least squares algorithms. + tolerance = 1E-6; } + EXPECT_NEAR(actual, target, tolerance); +} - // Compare magnitudes - const float Vlower = fabsf(Vtarget * (1 - VELOCITY_TOLERANCE)); - const float Vupper = fabsf(Vtarget * (1 + VELOCITY_TOLERANCE)); - if (fabsf(Vactual) < Vlower) { - FAIL() << StringPrintf("Velocity %f is more than %.0f%% below target velocity %f", - Vactual, VELOCITY_TOLERANCE * 100, Vtarget); - } - if (fabsf(Vactual) > Vupper) { - FAIL() << StringPrintf("Velocity %f is more than %.0f%% above target velocity %f", - Vactual, VELOCITY_TOLERANCE * 100, Vtarget); - } - SUCCEED() << StringPrintf("Velocity %f within %.0f%% of target %f)", - Vactual, VELOCITY_TOLERANCE * 100, Vtarget); +static void checkVelocity(float Vactual, float Vtarget) { + EXPECT_NEAR_BY_FRACTION(Vactual, Vtarget, VELOCITY_TOLERANCE); +} + +static void checkCoefficient(float actual, float target) { + EXPECT_NEAR_BY_FRACTION(actual, target, COEFFICIENT_TOLERANCE); } void failWithMessage(std::string message) { @@ -123,6 +130,19 @@ static void computeAndCheckVelocity(const Position* positions, size_t numSamples delete event; } +static void computeAndCheckQuadraticEstimate(const Position* positions, size_t numSamples, + const std::array<float, 3>& coefficients) { + VelocityTracker vt("lsq2"); + MotionEvent* event = createSimpleMotionEvent(positions, numSamples); + vt.addMovement(event); + VelocityTracker::Estimator estimator; + EXPECT_TRUE(vt.getEstimator(0, &estimator)); + for (size_t i = 0; i< coefficients.size(); i++) { + checkCoefficient(estimator.xCoeff[i], coefficients[i]); + checkCoefficient(estimator.yCoeff[i], coefficients[i]); + } +} + /* * ================== VelocityTracker tests generated manually ===================================== */ @@ -660,5 +680,114 @@ TEST_F(VelocityTrackerTest, SailfishFlingDownFast3) { computeAndCheckVelocity(values, count, AMOTION_EVENT_AXIS_Y, 28354.796875); // lsq2 } +/* + * Special care must be taken when constructing tests for LeastSquaresVelocityTrackerStrategy + * getEstimator function. In particular: + * - inside the function, time gets converted from nanoseconds to seconds + * before being used in the fit. + * - any values that are older than 100 ms are being discarded. + * - the newest time gets subtracted from all of the other times before being used in the fit. + * So these tests have to be designed with those limitations in mind. + * + * General approach for the tests below: + * We only used timestamps in milliseconds, 0 ms, 1 ms, and 2 ms, to be sure that + * we are well within the HORIZON range. + * When specifying the expected values of the coefficients, we treat the x values as if + * they were in ms. Then, to adjust for the time units, the coefficients get progressively + * multiplied by powers of 1E3. + * For example: + * data: t(ms), x + * 1 ms, 1 + * 2 ms, 4 + * 3 ms, 9 + * The coefficients are (0, 0, 1). + * In the test, we would convert these coefficients to (0*(1E3)^0, 0*(1E3)^1, 1*(1E3)^2). + */ +TEST_F(VelocityTrackerTest, LeastSquaresVelocityTrackerStrategyEstimator_Constant) { + Position values[] = { + { 0000000, 1, 1 }, // 0 s + { 1000000, 1, 1 }, // 0.001 s + { 2000000, 1, 1 }, // 0.002 s + }; + // The data used for the fit will be as follows: + // time(s), position + // -0.002, 1 + // -0.001, 1 + // -0.000, 1 + size_t count = sizeof(values) / sizeof(Position); + computeAndCheckQuadraticEstimate(values, count, std::array<float, 3>({1, 0, 0})); +} + +/* + * Straight line y = x :: the constant and quadratic coefficients are zero. + */ +TEST_F(VelocityTrackerTest, LeastSquaresVelocityTrackerStrategyEstimator_Linear) { + Position values[] = { + { 0000000, -2, -2 }, + { 1000000, -1, -1 }, + { 2000000, -0, -0 }, + }; + // The data used for the fit will be as follows: + // time(s), position + // -0.002, -2 + // -0.001, -1 + // -0.000, 0 + size_t count = sizeof(values) / sizeof(Position); + computeAndCheckQuadraticEstimate(values, count, std::array<float, 3>({0, 1E3, 0})); +} + +/* + * Parabola + */ +TEST_F(VelocityTrackerTest, LeastSquaresVelocityTrackerStrategyEstimator_Parabolic) { + Position values[] = { + { 0000000, 1, 1 }, + { 1000000, 4, 4 }, + { 2000000, 8, 8 }, + }; + // The data used for the fit will be as follows: + // time(s), position + // -0.002, 1 + // -0.001, 4 + // -0.000, 8 + size_t count = sizeof(values) / sizeof(Position); + computeAndCheckQuadraticEstimate(values, count, std::array<float, 3>({8, 4.5E3, 0.5E6})); +} + +/* + * Parabola + */ +TEST_F(VelocityTrackerTest, LeastSquaresVelocityTrackerStrategyEstimator_Parabolic2) { + Position values[] = { + { 0000000, 1, 1 }, + { 1000000, 4, 4 }, + { 2000000, 9, 9 }, + }; + // The data used for the fit will be as follows: + // time(s), position + // -0.002, 1 + // -0.001, 4 + // -0.000, 9 + size_t count = sizeof(values) / sizeof(Position); + computeAndCheckQuadraticEstimate(values, count, std::array<float, 3>({9, 6E3, 1E6})); +} + +/* + * Parabola :: y = x^2 :: the constant and linear coefficients are zero. + */ +TEST_F(VelocityTrackerTest, LeastSquaresVelocityTrackerStrategyEstimator_Parabolic3) { + Position values[] = { + { 0000000, 4, 4 }, + { 1000000, 1, 1 }, + { 2000000, 0, 0 }, + }; + // The data used for the fit will be as follows: + // time(s), position + // -0.002, 4 + // -0.001, 1 + // -0.000, 0 + size_t count = sizeof(values) / sizeof(Position); + computeAndCheckQuadraticEstimate(values, count, std::array<float, 3>({0, 0E3, 1E6})); +} } // namespace android diff --git a/vulkan/api/vulkan.api b/vulkan/api/vulkan.api index fa63fbdf98..57228104e2 100644 --- a/vulkan/api/vulkan.api +++ b/vulkan/api/vulkan.api @@ -28,7 +28,7 @@ import platform "platform.api" // API version (major.minor.patch) define VERSION_MAJOR 1 define VERSION_MINOR 1 -define VERSION_PATCH 85 +define VERSION_PATCH 86 // API limits define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256 @@ -45,6 +45,10 @@ define VK_LUID_SIZE 8 define VK_QUEUE_FAMILY_EXTERNAL -2 @extension("VK_EXT_queue_family_foreign") define VK_QUEUE_FAMILY_FOREIGN_EXT -3 +@extension("VK_MAX_DRIVER_NAME_SIZE_KHR") // 197 +define VK_MAX_DRIVER_NAME_SIZE_KHR 256 +@extension("VK_MAX_DRIVER_NAME_SIZE_KHR") // 197 +define VK_MAX_DRIVER_INFO_SIZE_KHR 256 // API keywords define VK_TRUE 1 @@ -545,6 +549,10 @@ define NULL_HANDLE 0 @extension("VK_AMD_buffer_marker") define VK_AMD_BUFFER_MARKER_SPEC_VERSION 1 @extension("VK_AMD_buffer_marker") define VK_AMD_BUFFER_MARKER_EXTENSION_NAME "VK_AMD_buffer_marker" +// 181 +@extension("VK_KHR_shader_atomic_int64") define VK_KHR_SHADER_ATOMIC_INT64_SPEC_VERSION 1 +@extension("VK_KHR_shader_atomic_int64") define VK_KHR_SHADER_ATOMIC_INT64_EXTENSION_NAME "VK_KHR_shader_atomic_int64" + // 186 @extension("VK_AMD_shader_core_properties") define VK_AMD_SHADER_CORE_PROPERTIES_SPEC_VERSION 1 @extension("VK_AMD_shader_core_properties") define VK_AMD_SHADER_CORE_PROPERTIES_EXTENSION_NAME "VK_AMD_shader_core_properties" @@ -553,6 +561,10 @@ define NULL_HANDLE 0 @extension("VK_EXT_vertex_attribute_divisor") define VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION 2 @extension("VK_EXT_vertex_attribute_divisor") define VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME "VK_EXT_vertex_attribute_divisor" +// 197 +@extension("VK_KHR_driver_properties") define VK_KHR_DRIVER_PROPERTIES_SPEC_VERSION 1 +@extension("VK_KHR_driver_properties") define VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME "VK_KHR_driver_properties" + // 199 @extension("VK_NV_shader_subgroup_partitioned") define VK_NV_SHADER_SUBGROUP_PARTITIONED_SPEC_VERSION 1 @extension("VK_NV_shader_subgroup_partitioned") define VK_NV_SHADER_SUBGROUP_PARTITIONED_EXTENSION_NAME "VK_NV_shader_subgroup_partitioned" @@ -1763,6 +1775,12 @@ enum VkStructureType { VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT = 1000178001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT = 1000178002, + //@extension("VK_KHR_shader_atomic_int64") // 181 + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR = 1000180000, + + //@extension("VK_KHR_driver_properties") // 197 + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR = 1000196000, + //@extension("VK_AMD_shader_core_properties") // 186 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD = 1000185000, @@ -2264,6 +2282,19 @@ enum VkQueueGlobalPriorityEXT { VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT = 1024, } +@extension("VK_KHR_driver_properties") // 197 +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, +} + ///////////////// // Bitfields // ///////////////// @@ -7214,6 +7245,14 @@ class VkPhysicalDeviceExternalMemoryHostPropertiesEXT { VkDeviceSize minImportedHostPointerAlignment } +@extension("VK_KHR_shader_atomic_int64") // 181 +class VkPhysicalDeviceShaderAtomicInt64FeaturesKHR { + VkStructureType sType + void* pNext + VkBool32 shaderBufferInt64Atomics + VkBool32 shaderSharedInt64Atomics +} + @extension("VK_AMD_shader_core_properties") // 186 class VkPhysicalDeviceShaderCorePropertiesAMD { VkStructureType sType @@ -7263,6 +7302,24 @@ class VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT { VkBool32 vertexAttributeInstanceRateZeroDivisor } +@extension("VK_KHR_driver_properties") // 197 +class VkConformanceVersionKHR { + u8 major + u8 minor + u8 subminor + u8 patch +} + +@extension("VK_KHR_driver_properties") // 197 +class VkPhysicalDeviceDriverPropertiesKHR { + VkStructureType sType + void* pNext + u32 driverID + char[VK_MAX_DRIVER_NAME_SIZE_KHR] driverName + char[VK_MAX_DRIVER_INFO_SIZE_KHR] driverInfo + VkConformanceVersionKHR conformanceVersion +} + @extension("VK_NV_compute_shader_derivatives") // 202 class VkPhysicalDeviceComputeShaderDerivativesFeaturesNV { VkStructureType sType @@ -11168,42 +11225,42 @@ cmd VkResult vkBindAccelerationStructureMemoryNVX( @extension("VK_NVX_raytracing") // 166 cmd void vkCmdBuildAccelerationStructureNVX( - VkCommandBuffer cmdBuf, - VkAccelerationStructureTypeNVX type, - u32 instanceCount, - VkBuffer instanceData, - VkDeviceSize instanceOffset, - u32 geometryCount, - const VkGeometryNVX* pGeometries, - VkBuildAccelerationStructureFlagsNVX flags, - VkBool32 update, - VkAccelerationStructureNVX dst, - VkAccelerationStructureNVX src, - VkBuffer scratch, - VkDeviceSize scratchOffset) { + VkCommandBuffer commandBuffer, + VkAccelerationStructureTypeNVX type, + u32 instanceCount, + VkBuffer instanceData, + VkDeviceSize instanceOffset, + u32 geometryCount, + const VkGeometryNVX* pGeometries, + VkBuildAccelerationStructureFlagsNVX flags, + VkBool32 update, + VkAccelerationStructureNVX dst, + VkAccelerationStructureNVX src, + VkBuffer scratch, + VkDeviceSize scratchOffset) { } @extension("VK_NVX_raytracing") // 166 cmd void vkCmdCopyAccelerationStructureNVX( - VkCommandBuffer cmdBuf, - VkAccelerationStructureNVX dst, - VkAccelerationStructureNVX src, - VkCopyAccelerationStructureModeNVX mode) { + VkCommandBuffer commandBuffer, + VkAccelerationStructureNVX dst, + VkAccelerationStructureNVX src, + VkCopyAccelerationStructureModeNVX mode) { } @extension("VK_NVX_raytracing") // 166 cmd void vkCmdTraceRaysNVX( - VkCommandBuffer cmdBuf, - VkBuffer raygenShaderBindingTableBuffer, - VkDeviceSize raygenShaderBindingOffset, - VkBuffer missShaderBindingTableBuffer, - VkDeviceSize missShaderBindingOffset, - VkDeviceSize missShaderBindingStride, - VkBuffer hitShaderBindingTableBuffer, - VkDeviceSize hitShaderBindingOffset, - VkDeviceSize hitShaderBindingStride, - u32 width, - u32 height) { + VkCommandBuffer commandBuffer, + VkBuffer raygenShaderBindingTableBuffer, + VkDeviceSize raygenShaderBindingOffset, + VkBuffer missShaderBindingTableBuffer, + VkDeviceSize missShaderBindingOffset, + VkDeviceSize missShaderBindingStride, + VkBuffer hitShaderBindingTableBuffer, + VkDeviceSize hitShaderBindingOffset, + VkDeviceSize hitShaderBindingStride, + u32 width, + u32 height) { } @extension("VK_NVX_raytracing") // 166 @@ -11219,38 +11276,38 @@ cmd VkResult vkCreateRaytracingPipelinesNVX( @extension("VK_NVX_raytracing") // 166 cmd VkResult vkGetRaytracingShaderHandlesNVX( - VkDevice device, - VkPipeline pipeline, - u32 firstGroup, - u32 groupCount, - platform.size_t dataSize, - void* pData) { + VkDevice device, + VkPipeline pipeline, + u32 firstGroup, + u32 groupCount, + platform.size_t dataSize, + void* pData) { return ? } @extension("VK_NVX_raytracing") // 166 cmd VkResult vkGetAccelerationStructureHandleNVX( - VkDevice device, - VkAccelerationStructureNVX accelerationStructure, - platform.size_t dataSize, - void* pData) { + VkDevice device, + VkAccelerationStructureNVX accelerationStructure, + platform.size_t dataSize, + void* pData) { return ? } @extension("VK_NVX_raytracing") // 166 cmd void vkCmdWriteAccelerationStructurePropertiesNVX( - VkCommandBuffer cmdBuf, - VkAccelerationStructureNVX accelerationStructure, - VkQueryType queryType, - VkQueryPool queryPool, - u32 query) { + VkCommandBuffer commandBuffer, + VkAccelerationStructureNVX accelerationStructure, + VkQueryType queryType, + VkQueryPool queryPool, + u32 query) { } @extension("VK_NVX_raytracing") // 166 cmd VkResult vkCompileDeferredNVX( - VkDevice device, - VkPipeline pipeline, - u32 shader) { + VkDevice device, + VkPipeline pipeline, + u32 shader) { return ? } diff --git a/vulkan/include/vulkan/vulkan_core.h b/vulkan/include/vulkan/vulkan_core.h index 2d1b3f5d1e..39f4dc6f05 100644 --- a/vulkan/include/vulkan/vulkan_core.h +++ b/vulkan/include/vulkan/vulkan_core.h @@ -43,7 +43,7 @@ extern "C" { #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 85 +#define VK_HEADER_VERSION 86 #define VK_NULL_HANDLE 0 @@ -427,10 +427,12 @@ typedef enum VkStructureType { 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_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, @@ -6044,6 +6046,60 @@ typedef struct VkPhysicalDevice8BitStorageFeaturesKHR { +#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; + uint32_t 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" @@ -8044,13 +8100,13 @@ typedef void (VKAPI_PTR *PFN_vkDestroyAccelerationStructureNVX)(VkDevice device, 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 cmdBuf, 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 cmdBuf, VkAccelerationStructureNVX dst, VkAccelerationStructureNVX src, VkCopyAccelerationStructureModeNVX mode); -typedef void (VKAPI_PTR *PFN_vkCmdTraceRaysNVX)(VkCommandBuffer cmdBuf, VkBuffer raygenShaderBindingTableBuffer, VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer, VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride, VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset, VkDeviceSize hitShaderBindingStride, uint32_t width, uint32_t height); +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 cmdBuf, VkAccelerationStructureNVX accelerationStructure, VkQueryType queryType, VkQueryPool queryPool, uint32_t query); +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 @@ -8081,7 +8137,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkBindAccelerationStructureMemoryNVX( const VkBindAccelerationStructureMemoryInfoNVX* pBindInfos); VKAPI_ATTR void VKAPI_CALL vkCmdBuildAccelerationStructureNVX( - VkCommandBuffer cmdBuf, + VkCommandBuffer commandBuffer, VkAccelerationStructureTypeNVX type, uint32_t instanceCount, VkBuffer instanceData, @@ -8096,13 +8152,13 @@ VKAPI_ATTR void VKAPI_CALL vkCmdBuildAccelerationStructureNVX( VkDeviceSize scratchOffset); VKAPI_ATTR void VKAPI_CALL vkCmdCopyAccelerationStructureNVX( - VkCommandBuffer cmdBuf, + VkCommandBuffer commandBuffer, VkAccelerationStructureNVX dst, VkAccelerationStructureNVX src, VkCopyAccelerationStructureModeNVX mode); VKAPI_ATTR void VKAPI_CALL vkCmdTraceRaysNVX( - VkCommandBuffer cmdBuf, + VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer, VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer, @@ -8137,7 +8193,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetAccelerationStructureHandleNVX( void* pData); VKAPI_ATTR void VKAPI_CALL vkCmdWriteAccelerationStructurePropertiesNVX( - VkCommandBuffer cmdBuf, + VkCommandBuffer commandBuffer, VkAccelerationStructureNVX accelerationStructure, VkQueryType queryType, VkQueryPool queryPool, |