diff options
| author | 2024-11-26 02:14:41 +0000 | |
|---|---|---|
| committer | 2024-11-26 02:14:41 +0000 | |
| commit | 592ba0d1e1a4c94de3998b5d33aa74a34c29f7c0 (patch) | |
| tree | 8339c5a2457859bee7fd55e928d44a19e9d77036 | |
| parent | 4be1e6368aa999c61f15cfac99298a524d61c519 (diff) | |
| parent | d3ca472da613f281eb09b0ca07b44ce85a35ecfb (diff) | |
Snap for 12710726 from d3ca472da613f281eb09b0ca07b44ce85a35ecfb to 25Q1-release
Change-Id: I65018bf876da48690798e19263e256229959dd22
22 files changed, 713 insertions, 179 deletions
diff --git a/data/etc/android.hardware.vulkan.version-1_4.xml b/data/etc/android.hardware.vulkan.version-1_4.xml new file mode 100644 index 0000000000..010f6daee7 --- /dev/null +++ b/data/etc/android.hardware.vulkan.version-1_4.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright 2024 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. +--> + +<!-- This is the standard feature indicating that the device has a Vulkan + driver that supports API version 1.4 (0x00404000) --> +<permissions> + <feature name="android.hardware.vulkan.version" version="4210688" /> +</permissions> diff --git a/include/audiomanager/AudioManager.h b/include/audiomanager/AudioManager.h index 917d9a74db..203623dea7 100644 --- a/include/audiomanager/AudioManager.h +++ b/include/audiomanager/AudioManager.h @@ -22,6 +22,7 @@ namespace android { // must be kept in sync with definitions in AudioPlaybackConfiguration.java #define PLAYER_PIID_INVALID -1 +// TODO (b/309532236) remove manual IAudioManager impl in favor of AIDL. typedef enum { PLAYER_TYPE_SLES_AUDIOPLAYER_BUFFERQUEUE = 11, PLAYER_TYPE_SLES_AUDIOPLAYER_URI_FD = 12, @@ -60,6 +61,7 @@ enum { PLAYER_MUTE_CLIENT_VOLUME = (1 << 4), PLAYER_MUTE_VOLUME_SHAPER = (1 << 5), PLAYER_MUTE_PORT_VOLUME = (1 << 6), + PLAYER_MUTE_OP_AUDIO_CONTROL = (1 << 7), }; struct mute_state_t { @@ -77,6 +79,8 @@ struct mute_state_t { bool muteFromVolumeShaper = false; /** Flag used when volume is muted by port volume. */ bool muteFromPortVolume = false; + /** Flag used when volume is muted by audio control op. */ + bool muteFromOpAudioControl = false; explicit operator int() const { @@ -87,6 +91,7 @@ struct mute_state_t { result |= muteFromClientVolume * PLAYER_MUTE_CLIENT_VOLUME; result |= muteFromVolumeShaper * PLAYER_MUTE_VOLUME_SHAPER; result |= muteFromPortVolume * PLAYER_MUTE_PORT_VOLUME; + result |= muteFromOpAudioControl * PLAYER_MUTE_OP_AUDIO_CONTROL; return result; } diff --git a/libs/binder/rust/src/system_only.rs b/libs/binder/rust/src/system_only.rs index 3da59ab811..1a58d6b44d 100644 --- a/libs/binder/rust/src/system_only.rs +++ b/libs/binder/rust/src/system_only.rs @@ -91,6 +91,32 @@ impl Accessor { Accessor { accessor } } + /// Creates a new Accessor instance based on an existing Accessor's binder. + /// This is useful when the Accessor instance is hosted in another process + /// that has the permissions to create the socket connection FD. + /// + /// The `instance` argument must match the instance that the original Accessor + /// is responsible for. + /// `instance` must not contain null bytes and is used to create a CString to + /// pass through FFI. + /// The `binder` argument must be a valid binder from an Accessor + pub fn from_binder(instance: &str, binder: SpIBinder) -> Option<Accessor> { + let inst = CString::new(instance).unwrap(); + + // Safety: All `SpIBinder` objects (the `binder` argument) hold a valid pointer + // to an `AIBinder` that is guaranteed to remain valid for the lifetime of the + // SpIBinder. `ABinderRpc_Accessor_fromBinder` creates a new pointer to that binder + // that it is responsible for. + // The `inst` argument is a new CString that will copied by + // `ABinderRpc_Accessor_fromBinder` and not modified. + let accessor = + unsafe { sys::ABinderRpc_Accessor_fromBinder(inst.as_ptr(), binder.as_raw()) }; + if accessor.is_null() { + return None; + } + Some(Accessor { accessor }) + } + /// Get the underlying binder for this Accessor for when it needs to be either /// registered with service manager or sent to another process. pub fn as_binder(&self) -> Option<SpIBinder> { diff --git a/libs/binder/rust/tests/integration.rs b/libs/binder/rust/tests/integration.rs index 0e793e5761..da4f128e67 100644 --- a/libs/binder/rust/tests/integration.rs +++ b/libs/binder/rust/tests/integration.rs @@ -1038,6 +1038,34 @@ mod tests { assert!(deleted.load(Ordering::Relaxed)); } + #[test] + fn test_accessor_from_accessor_binder() { + let get_connection_info = move |_instance: &str| None; + let accessor = Accessor::new("foo.service", get_connection_info); + let accessor2 = + Accessor::from_binder("foo.service", accessor.as_binder().unwrap()).unwrap(); + assert_eq!(accessor.as_binder(), accessor2.as_binder()); + } + + #[test] + fn test_accessor_from_non_accessor_binder() { + let service_name = "rust_test_ibinder"; + let _process = ScopedServiceProcess::new(service_name); + let binder = binder::get_service(service_name).unwrap(); + assert!(binder.is_binder_alive()); + + let accessor = Accessor::from_binder("rust_test_ibinder", binder); + assert!(accessor.is_none()); + } + + #[test] + fn test_accessor_from_wrong_accessor_binder() { + let get_connection_info = move |_instance: &str| None; + let accessor = Accessor::new("foo.service", get_connection_info); + let accessor2 = Accessor::from_binder("NOT.foo.service", accessor.as_binder().unwrap()); + assert!(accessor2.is_none()); + } + #[tokio::test] async fn reassociate_rust_binder_async() { let service_name = "testing_service"; diff --git a/libs/input/InputConsumerNoResampling.cpp b/libs/input/InputConsumerNoResampling.cpp index 2c0f77a814..cd8582182a 100644 --- a/libs/input/InputConsumerNoResampling.cpp +++ b/libs/input/InputConsumerNoResampling.cpp @@ -169,6 +169,12 @@ InputMessage createTimelineMessage(int32_t inputEventId, nsecs_t gpuCompletedTim msg.body.timeline.graphicsTimeline[GraphicsTimeline::PRESENT_TIME] = presentTime; return msg; } + +std::ostream& operator<<(std::ostream& out, const InputMessage& msg) { + out << ftl::enum_string(msg.header.type); + return out; +} + } // namespace // --- InputConsumerNoResampling --- @@ -272,6 +278,15 @@ void InputConsumerNoResampling::processOutboundEvents() { return; // try again later } + if (result == DEAD_OBJECT) { + // If there's no one to receive events in the channel, there's no point in sending them. + // Drop all outbound events. + LOG(INFO) << "Channel " << mChannel->getName() << " died. Dropping outbound event " + << outboundMsg; + mOutboundQueue.pop(); + setFdEvents(0); + continue; + } // Some other error. Give up LOG(FATAL) << "Failed to send outbound event on channel '" << mChannel->getName() << "'. status=" << statusToString(result) << "(" << result << ")"; diff --git a/libs/input/tests/InputPublisherAndConsumerNoResampling_test.cpp b/libs/input/tests/InputPublisherAndConsumerNoResampling_test.cpp index 39bb841c0a..1dadae98e4 100644 --- a/libs/input/tests/InputPublisherAndConsumerNoResampling_test.cpp +++ b/libs/input/tests/InputPublisherAndConsumerNoResampling_test.cpp @@ -319,6 +319,8 @@ protected: protected: // Interaction with the looper thread + void blockLooper(); + void unblockLooper(); enum class LooperMessage : int { CALL_PROBABLY_HAS_INPUT, CREATE_CONSUMER, @@ -389,6 +391,26 @@ private: }; }; +void InputPublisherAndConsumerNoResamplingTest::blockLooper() { + { + std::scoped_lock l(mLock); + mLooperMayProceed = false; + } + sendMessage(LooperMessage::BLOCK_LOOPER); + { + std::unique_lock l(mLock); + mNotifyLooperWaiting.wait(l, [this] { return mLooperIsBlocked; }); + } +} + +void InputPublisherAndConsumerNoResamplingTest::unblockLooper() { + { + std::scoped_lock l(mLock); + mLooperMayProceed = true; + } + mNotifyLooperMayProceed.notify_all(); +} + void InputPublisherAndConsumerNoResamplingTest::sendMessage(LooperMessage message) { Message msg{ftl::to_underlying(message)}; mLooper->sendMessage(mMessageHandler, msg); @@ -600,15 +622,7 @@ void InputPublisherAndConsumerNoResamplingTest::publishAndConsumeSinglePointerMu std::queue<uint32_t> publishedSequenceNumbers; // Block Looper to increase the chance of batching events - { - std::scoped_lock l(mLock); - mLooperMayProceed = false; - } - sendMessage(LooperMessage::BLOCK_LOOPER); - { - std::unique_lock l(mLock); - mNotifyLooperWaiting.wait(l, [this] { return mLooperIsBlocked; }); - } + blockLooper(); uint32_t firstSampleId; for (size_t i = 0; i < nSamples; ++i) { @@ -629,12 +643,7 @@ void InputPublisherAndConsumerNoResamplingTest::publishAndConsumeSinglePointerMu std::vector<MotionEvent> singleSampledMotionEvents; - // Unblock Looper - { - std::scoped_lock l(mLock); - mLooperMayProceed = true; - } - mNotifyLooperMayProceed.notify_all(); + unblockLooper(); // We have no control over the socket behavior, so the consumer can receive // the motion as a batched event, or as a sequence of multiple single-sample MotionEvents (or a @@ -809,6 +818,15 @@ void InputPublisherAndConsumerNoResamplingTest::publishAndConsumeTouchModeEvent( verifyFinishedSignal(*mPublisher, seq, publishTime); } +/** + * If the publisher has died, consumer should not crash when trying to send an outgoing message. + */ +TEST_F(InputPublisherAndConsumerNoResamplingTest, ConsumerWritesAfterPublisherDies) { + mPublisher.reset(); // The publisher has died + mReportTimelineArgs.emplace(/*inputEventId=*/10, /*gpuCompletedTime=*/20, /*presentTime=*/30); + sendMessage(LooperMessage::CALL_REPORT_TIMELINE); +} + TEST_F(InputPublisherAndConsumerNoResamplingTest, SendTimeline) { const int32_t inputEventId = 20; const nsecs_t gpuCompletedTime = 30; diff --git a/services/inputflinger/PointerChoreographer.cpp b/services/inputflinger/PointerChoreographer.cpp index 006d507a40..38e5974c3f 100644 --- a/services/inputflinger/PointerChoreographer.cpp +++ b/services/inputflinger/PointerChoreographer.cpp @@ -139,23 +139,24 @@ PointerChoreographer::PointerChoreographer( mShowTouchesEnabled(false), mStylusPointerIconEnabled(false), mCurrentFocusedDisplay(ui::LogicalDisplayId::DEFAULT), + mIsWindowInfoListenerRegistered(false), + mWindowInfoListener(sp<PointerChoreographerDisplayInfoListener>::make(this)), mRegisterListener(registerListener), mUnregisterListener(unregisterListener) {} PointerChoreographer::~PointerChoreographer() { - std::scoped_lock _l(mLock); - if (mWindowInfoListener == nullptr) { - return; + if (mIsWindowInfoListenerRegistered) { + mUnregisterListener(mWindowInfoListener); + mIsWindowInfoListenerRegistered = false; } mWindowInfoListener->onPointerChoreographerDestroyed(); - mUnregisterListener(mWindowInfoListener); } void PointerChoreographer::notifyInputDevicesChanged(const NotifyInputDevicesChangedArgs& args) { PointerDisplayChange pointerDisplayChange; { // acquire lock - std::scoped_lock _l(mLock); + std::scoped_lock _l(getLock()); mInputDeviceInfos = args.inputDeviceInfos; pointerDisplayChange = updatePointerControllersLocked(); @@ -191,7 +192,7 @@ void PointerChoreographer::fadeMouseCursorOnKeyPress(const android::NotifyKeyArg return; } - std::scoped_lock _l(mLock); + std::scoped_lock _l(getLock()); ui::LogicalDisplayId targetDisplay = args.displayId; if (targetDisplay == ui::LogicalDisplayId::INVALID) { targetDisplay = mCurrentFocusedDisplay; @@ -204,7 +205,7 @@ void PointerChoreographer::fadeMouseCursorOnKeyPress(const android::NotifyKeyArg } NotifyMotionArgs PointerChoreographer::processMotion(const NotifyMotionArgs& args) { - std::scoped_lock _l(mLock); + std::scoped_lock _l(getLock()); if (isFromMouse(args)) { return processMouseEventLocked(args); @@ -242,14 +243,7 @@ NotifyMotionArgs PointerChoreographer::processMouseEventLocked(const NotifyMotio pc.setPosition(args.xCursorPosition, args.yCursorPosition); } else { // This is a relative mouse, so move the cursor by the specified amount. - const float deltaX = args.pointerCoords[0].getAxisValue(AMOTION_EVENT_AXIS_RELATIVE_X); - const float deltaY = args.pointerCoords[0].getAxisValue(AMOTION_EVENT_AXIS_RELATIVE_Y); - pc.move(deltaX, deltaY); - const auto [x, y] = pc.getPosition(); - newArgs.pointerCoords[0].setAxisValue(AMOTION_EVENT_AXIS_X, x); - newArgs.pointerCoords[0].setAxisValue(AMOTION_EVENT_AXIS_Y, y); - newArgs.xCursorPosition = x; - newArgs.yCursorPosition = y; + processPointerDeviceMotionEventLocked(/*byref*/ newArgs, /*byref*/ pc); } if (canUnfadeOnDisplay(displayId)) { pc.unfade(PointerControllerInterface::Transition::IMMEDIATE); @@ -265,24 +259,9 @@ NotifyMotionArgs PointerChoreographer::processTouchpadEventLocked(const NotifyMo newArgs.displayId = displayId; if (args.getPointerCount() == 1 && args.classification == MotionClassification::NONE) { // This is a movement of the mouse pointer. - const float deltaX = args.pointerCoords[0].getAxisValue(AMOTION_EVENT_AXIS_RELATIVE_X); - const float deltaY = args.pointerCoords[0].getAxisValue(AMOTION_EVENT_AXIS_RELATIVE_Y); - pc.move(deltaX, deltaY); - if (canUnfadeOnDisplay(displayId)) { - pc.unfade(PointerControllerInterface::Transition::IMMEDIATE); - } - - const auto [x, y] = pc.getPosition(); - newArgs.pointerCoords[0].setAxisValue(AMOTION_EVENT_AXIS_X, x); - newArgs.pointerCoords[0].setAxisValue(AMOTION_EVENT_AXIS_Y, y); - newArgs.xCursorPosition = x; - newArgs.yCursorPosition = y; + processPointerDeviceMotionEventLocked(/*byref*/ newArgs, /*byref*/ pc); } else { // This is a trackpad gesture with fake finger(s) that should not move the mouse pointer. - if (canUnfadeOnDisplay(displayId)) { - pc.unfade(PointerControllerInterface::Transition::IMMEDIATE); - } - const auto [x, y] = pc.getPosition(); for (uint32_t i = 0; i < newArgs.getPointerCount(); i++) { newArgs.pointerCoords[i].setAxisValue(AMOTION_EVENT_AXIS_X, @@ -293,9 +272,25 @@ NotifyMotionArgs PointerChoreographer::processTouchpadEventLocked(const NotifyMo newArgs.xCursorPosition = x; newArgs.yCursorPosition = y; } + if (canUnfadeOnDisplay(displayId)) { + pc.unfade(PointerControllerInterface::Transition::IMMEDIATE); + } return newArgs; } +void PointerChoreographer::processPointerDeviceMotionEventLocked(NotifyMotionArgs& newArgs, + PointerControllerInterface& pc) { + const float deltaX = newArgs.pointerCoords[0].getAxisValue(AMOTION_EVENT_AXIS_RELATIVE_X); + const float deltaY = newArgs.pointerCoords[0].getAxisValue(AMOTION_EVENT_AXIS_RELATIVE_Y); + + pc.move(deltaX, deltaY); + const auto [x, y] = pc.getPosition(); + newArgs.pointerCoords[0].setAxisValue(AMOTION_EVENT_AXIS_X, x); + newArgs.pointerCoords[0].setAxisValue(AMOTION_EVENT_AXIS_Y, y); + newArgs.xCursorPosition = x; + newArgs.yCursorPosition = y; +} + void PointerChoreographer::processDrawingTabletEventLocked(const android::NotifyMotionArgs& args) { if (args.displayId == ui::LogicalDisplayId::INVALID) { return; @@ -433,7 +428,7 @@ void PointerChoreographer::notifyDeviceReset(const NotifyDeviceResetArgs& args) } void PointerChoreographer::processDeviceReset(const NotifyDeviceResetArgs& args) { - std::scoped_lock _l(mLock); + std::scoped_lock _l(getLock()); mTouchPointersByDevice.erase(args.deviceId); mStylusPointersByDevice.erase(args.deviceId); mDrawingTabletPointersByDevice.erase(args.deviceId); @@ -447,17 +442,22 @@ void PointerChoreographer::onControllerAddedOrRemovedLocked() { bool requireListener = !mTouchPointersByDevice.empty() || !mMousePointersByDisplay.empty() || !mDrawingTabletPointersByDevice.empty() || !mStylusPointersByDevice.empty(); - if (requireListener && mWindowInfoListener == nullptr) { - mWindowInfoListener = sp<PointerChoreographerDisplayInfoListener>::make(this); - mWindowInfoListener->setInitialDisplayInfos(mRegisterListener(mWindowInfoListener)); - onPrivacySensitiveDisplaysChangedLocked(mWindowInfoListener->getPrivacySensitiveDisplays()); - } else if (!requireListener && mWindowInfoListener != nullptr) { + // PointerChoreographer uses Listener's lock which is already held by caller + base::ScopedLockAssertion assumeLocked(mWindowInfoListener->mLock); + + if (requireListener && !mIsWindowInfoListenerRegistered) { + mIsWindowInfoListenerRegistered = true; + mWindowInfoListener->setInitialDisplayInfosLocked(mRegisterListener(mWindowInfoListener)); + onPrivacySensitiveDisplaysChangedLocked( + mWindowInfoListener->getPrivacySensitiveDisplaysLocked()); + } else if (!requireListener && mIsWindowInfoListenerRegistered) { + mIsWindowInfoListenerRegistered = false; mUnregisterListener(mWindowInfoListener); - mWindowInfoListener = nullptr; - } else if (requireListener && mWindowInfoListener != nullptr) { + } else if (requireListener) { // controller may have been added to an existing privacy sensitive display, we need to // update all controllers again - onPrivacySensitiveDisplaysChangedLocked(mWindowInfoListener->getPrivacySensitiveDisplays()); + onPrivacySensitiveDisplaysChangedLocked( + mWindowInfoListener->getPrivacySensitiveDisplaysLocked()); } } @@ -494,7 +494,7 @@ void PointerChoreographer::onPrivacySensitiveDisplaysChangedLocked( void PointerChoreographer::notifyPointerCaptureChanged( const NotifyPointerCaptureChangedArgs& args) { if (args.request.isEnable()) { - std::scoped_lock _l(mLock); + std::scoped_lock _l(getLock()); for (const auto& [_, mousePointerController] : mMousePointersByDisplay) { mousePointerController->fade(PointerControllerInterface::Transition::IMMEDIATE); } @@ -502,14 +502,8 @@ void PointerChoreographer::notifyPointerCaptureChanged( mNextListener.notify(args); } -void PointerChoreographer::onPrivacySensitiveDisplaysChanged( - const std::unordered_set<ui::LogicalDisplayId>& privacySensitiveDisplays) { - std::scoped_lock _l(mLock); - onPrivacySensitiveDisplaysChangedLocked(privacySensitiveDisplays); -} - void PointerChoreographer::dump(std::string& dump) { - std::scoped_lock _l(mLock); + std::scoped_lock _l(getLock()); dump += "PointerChoreographer:\n"; dump += StringPrintf(INDENT "Show Touches Enabled: %s\n", @@ -579,6 +573,10 @@ bool PointerChoreographer::canUnfadeOnDisplay(ui::LogicalDisplayId displayId) { return mDisplaysWithPointersHidden.find(displayId) == mDisplaysWithPointersHidden.end(); } +std::mutex& PointerChoreographer::getLock() const { + return mWindowInfoListener->mLock; +} + PointerChoreographer::PointerDisplayChange PointerChoreographer::updatePointerControllersLocked() { std::set<ui::LogicalDisplayId /*displayId*/> mouseDisplaysToKeep; std::set<DeviceId> touchDevicesToKeep; @@ -641,7 +639,7 @@ PointerChoreographer::PointerDisplayChange PointerChoreographer::updatePointerCo std::erase_if(mDrawingTabletPointersByDevice, [&drawingTabletDevicesToKeep](const auto& pair) { return drawingTabletDevicesToKeep.find(pair.first) == drawingTabletDevicesToKeep.end(); }); - std::erase_if(mMouseDevices, [&](DeviceId id) REQUIRES(mLock) { + std::erase_if(mMouseDevices, [&](DeviceId id) REQUIRES(getLock()) { return std::find_if(mInputDeviceInfos.begin(), mInputDeviceInfos.end(), [id](const auto& info) { return info.getId() == id; }) == mInputDeviceInfos.end(); @@ -677,7 +675,7 @@ void PointerChoreographer::setDefaultMouseDisplayId(ui::LogicalDisplayId display PointerDisplayChange pointerDisplayChange; { // acquire lock - std::scoped_lock _l(mLock); + std::scoped_lock _l(getLock()); mDefaultMouseDisplayId = displayId; pointerDisplayChange = updatePointerControllersLocked(); @@ -690,7 +688,7 @@ void PointerChoreographer::setDisplayViewports(const std::vector<DisplayViewport PointerDisplayChange pointerDisplayChange; { // acquire lock - std::scoped_lock _l(mLock); + std::scoped_lock _l(getLock()); for (const auto& viewport : viewports) { const ui::LogicalDisplayId displayId = viewport.displayId; if (const auto it = mMousePointersByDisplay.find(displayId); @@ -719,7 +717,7 @@ void PointerChoreographer::setDisplayViewports(const std::vector<DisplayViewport std::optional<DisplayViewport> PointerChoreographer::getViewportForPointerDevice( ui::LogicalDisplayId associatedDisplayId) { - std::scoped_lock _l(mLock); + std::scoped_lock _l(getLock()); const ui::LogicalDisplayId resolvedDisplayId = getTargetMouseDisplayLocked(associatedDisplayId); if (const auto viewport = findViewportByIdLocked(resolvedDisplayId); viewport) { return *viewport; @@ -728,7 +726,7 @@ std::optional<DisplayViewport> PointerChoreographer::getViewportForPointerDevice } FloatPoint PointerChoreographer::getMouseCursorPosition(ui::LogicalDisplayId displayId) { - std::scoped_lock _l(mLock); + std::scoped_lock _l(getLock()); const ui::LogicalDisplayId resolvedDisplayId = getTargetMouseDisplayLocked(displayId); if (auto it = mMousePointersByDisplay.find(resolvedDisplayId); it != mMousePointersByDisplay.end()) { @@ -741,7 +739,7 @@ void PointerChoreographer::setShowTouchesEnabled(bool enabled) { PointerDisplayChange pointerDisplayChange; { // acquire lock - std::scoped_lock _l(mLock); + std::scoped_lock _l(getLock()); if (mShowTouchesEnabled == enabled) { return; } @@ -756,7 +754,7 @@ void PointerChoreographer::setStylusPointerIconEnabled(bool enabled) { PointerDisplayChange pointerDisplayChange; { // acquire lock - std::scoped_lock _l(mLock); + std::scoped_lock _l(getLock()); if (mStylusPointerIconEnabled == enabled) { return; } @@ -770,7 +768,7 @@ void PointerChoreographer::setStylusPointerIconEnabled(bool enabled) { bool PointerChoreographer::setPointerIcon( std::variant<std::unique_ptr<SpriteIcon>, PointerIconStyle> icon, ui::LogicalDisplayId displayId, DeviceId deviceId) { - std::scoped_lock _l(mLock); + std::scoped_lock _l(getLock()); if (deviceId < 0) { LOG(WARNING) << "Invalid device id " << deviceId << ". Cannot set pointer icon."; return false; @@ -821,7 +819,7 @@ bool PointerChoreographer::setPointerIcon( } void PointerChoreographer::setPointerIconVisibility(ui::LogicalDisplayId displayId, bool visible) { - std::scoped_lock lock(mLock); + std::scoped_lock lock(getLock()); if (visible) { mDisplaysWithPointersHidden.erase(displayId); // We do not unfade the icons here, because we don't know when the last event happened. @@ -843,14 +841,14 @@ void PointerChoreographer::setPointerIconVisibility(ui::LogicalDisplayId display } void PointerChoreographer::setFocusedDisplay(ui::LogicalDisplayId displayId) { - std::scoped_lock lock(mLock); + std::scoped_lock lock(getLock()); mCurrentFocusedDisplay = displayId; } PointerChoreographer::ControllerConstructor PointerChoreographer::getMouseControllerConstructor( ui::LogicalDisplayId displayId) { std::function<std::shared_ptr<PointerControllerInterface>()> ctor = - [this, displayId]() REQUIRES(mLock) { + [this, displayId]() REQUIRES(getLock()) { auto pc = mPolicy.createPointerController( PointerControllerInterface::ControllerType::MOUSE); if (const auto viewport = findViewportByIdLocked(displayId); viewport) { @@ -864,7 +862,7 @@ PointerChoreographer::ControllerConstructor PointerChoreographer::getMouseContro PointerChoreographer::ControllerConstructor PointerChoreographer::getStylusControllerConstructor( ui::LogicalDisplayId displayId) { std::function<std::shared_ptr<PointerControllerInterface>()> ctor = - [this, displayId]() REQUIRES(mLock) { + [this, displayId]() REQUIRES(getLock()) { auto pc = mPolicy.createPointerController( PointerControllerInterface::ControllerType::STYLUS); if (const auto viewport = findViewportByIdLocked(displayId); viewport) { @@ -875,9 +873,11 @@ PointerChoreographer::ControllerConstructor PointerChoreographer::getStylusContr return ConstructorDelegate(std::move(ctor)); } +// --- PointerChoreographer::PointerChoreographerDisplayInfoListener --- + void PointerChoreographer::PointerChoreographerDisplayInfoListener::onWindowInfosChanged( const gui::WindowInfosUpdate& windowInfosUpdate) { - std::scoped_lock _l(mListenerLock); + std::scoped_lock _l(mLock); if (mPointerChoreographer == nullptr) { return; } @@ -885,25 +885,25 @@ void PointerChoreographer::PointerChoreographerDisplayInfoListener::onWindowInfo getPrivacySensitiveDisplaysFromWindowInfos(windowInfosUpdate.windowInfos); if (newPrivacySensitiveDisplays != mPrivacySensitiveDisplays) { mPrivacySensitiveDisplays = std::move(newPrivacySensitiveDisplays); - mPointerChoreographer->onPrivacySensitiveDisplaysChanged(mPrivacySensitiveDisplays); + // PointerChoreographer uses Listener's lock. + base::ScopedLockAssertion assumeLocked(mPointerChoreographer->getLock()); + mPointerChoreographer->onPrivacySensitiveDisplaysChangedLocked(mPrivacySensitiveDisplays); } } -void PointerChoreographer::PointerChoreographerDisplayInfoListener::setInitialDisplayInfos( +void PointerChoreographer::PointerChoreographerDisplayInfoListener::setInitialDisplayInfosLocked( const std::vector<gui::WindowInfo>& windowInfos) { - std::scoped_lock _l(mListenerLock); mPrivacySensitiveDisplays = getPrivacySensitiveDisplaysFromWindowInfos(windowInfos); } std::unordered_set<ui::LogicalDisplayId /*displayId*/> -PointerChoreographer::PointerChoreographerDisplayInfoListener::getPrivacySensitiveDisplays() { - std::scoped_lock _l(mListenerLock); +PointerChoreographer::PointerChoreographerDisplayInfoListener::getPrivacySensitiveDisplaysLocked() { return mPrivacySensitiveDisplays; } void PointerChoreographer::PointerChoreographerDisplayInfoListener:: onPointerChoreographerDestroyed() { - std::scoped_lock _l(mListenerLock); + std::scoped_lock _l(mLock); mPointerChoreographer = nullptr; } diff --git a/services/inputflinger/PointerChoreographer.h b/services/inputflinger/PointerChoreographer.h index 635487be6b..fba1aef260 100644 --- a/services/inputflinger/PointerChoreographer.h +++ b/services/inputflinger/PointerChoreographer.h @@ -118,31 +118,40 @@ public: private: using PointerDisplayChange = std::optional< std::tuple<ui::LogicalDisplayId /*displayId*/, FloatPoint /*cursorPosition*/>>; - [[nodiscard]] PointerDisplayChange updatePointerControllersLocked() REQUIRES(mLock); - [[nodiscard]] PointerDisplayChange calculatePointerDisplayChangeToNotify() REQUIRES(mLock); + + // PointerChoreographer's DisplayInfoListener can outlive the PointerChoreographer because when + // the listener is registered and called from display thread, a strong pointer to the listener + // (which can extend its lifecycle) is given away. + // If we use two locks it can also cause deadlocks due to race in acquiring them between the + // display and reader thread. + // To avoid these problems we use DisplayInfoListener's lock in PointerChoreographer. + std::mutex& getLock() const; + + [[nodiscard]] PointerDisplayChange updatePointerControllersLocked() REQUIRES(getLock()); + [[nodiscard]] PointerDisplayChange calculatePointerDisplayChangeToNotify() REQUIRES(getLock()); const DisplayViewport* findViewportByIdLocked(ui::LogicalDisplayId displayId) const - REQUIRES(mLock); + REQUIRES(getLock()); ui::LogicalDisplayId getTargetMouseDisplayLocked(ui::LogicalDisplayId associatedDisplayId) const - REQUIRES(mLock); + REQUIRES(getLock()); std::pair<ui::LogicalDisplayId /*displayId*/, PointerControllerInterface&> - ensureMouseControllerLocked(ui::LogicalDisplayId associatedDisplayId) REQUIRES(mLock); - InputDeviceInfo* findInputDeviceLocked(DeviceId deviceId) REQUIRES(mLock); - bool canUnfadeOnDisplay(ui::LogicalDisplayId displayId) REQUIRES(mLock); + ensureMouseControllerLocked(ui::LogicalDisplayId associatedDisplayId) REQUIRES(getLock()); + InputDeviceInfo* findInputDeviceLocked(DeviceId deviceId) REQUIRES(getLock()); + bool canUnfadeOnDisplay(ui::LogicalDisplayId displayId) REQUIRES(getLock()); void fadeMouseCursorOnKeyPress(const NotifyKeyArgs& args); NotifyMotionArgs processMotion(const NotifyMotionArgs& args); - NotifyMotionArgs processMouseEventLocked(const NotifyMotionArgs& args) REQUIRES(mLock); - NotifyMotionArgs processTouchpadEventLocked(const NotifyMotionArgs& args) REQUIRES(mLock); - void processDrawingTabletEventLocked(const NotifyMotionArgs& args) REQUIRES(mLock); - void processTouchscreenAndStylusEventLocked(const NotifyMotionArgs& args) REQUIRES(mLock); - void processStylusHoverEventLocked(const NotifyMotionArgs& args) REQUIRES(mLock); + NotifyMotionArgs processMouseEventLocked(const NotifyMotionArgs& args) REQUIRES(getLock()); + NotifyMotionArgs processTouchpadEventLocked(const NotifyMotionArgs& args) REQUIRES(getLock()); + void processDrawingTabletEventLocked(const NotifyMotionArgs& args) REQUIRES(getLock()); + void processTouchscreenAndStylusEventLocked(const NotifyMotionArgs& args) REQUIRES(getLock()); + void processStylusHoverEventLocked(const NotifyMotionArgs& args) REQUIRES(getLock()); + void processPointerDeviceMotionEventLocked(NotifyMotionArgs& newArgs, + PointerControllerInterface& pc) REQUIRES(getLock()); void processDeviceReset(const NotifyDeviceResetArgs& args); - void onControllerAddedOrRemovedLocked() REQUIRES(mLock); + void onControllerAddedOrRemovedLocked() REQUIRES(getLock()); void onPrivacySensitiveDisplaysChangedLocked( const std::unordered_set<ui::LogicalDisplayId>& privacySensitiveDisplays) - REQUIRES(mLock); - void onPrivacySensitiveDisplaysChanged( - const std::unordered_set<ui::LogicalDisplayId>& privacySensitiveDisplays); + REQUIRES(getLock()); /* This listener keeps tracks of visible privacy sensitive displays and updates the * choreographer if there are any changes. @@ -156,49 +165,50 @@ private: explicit PointerChoreographerDisplayInfoListener(PointerChoreographer* pc) : mPointerChoreographer(pc){}; void onWindowInfosChanged(const gui::WindowInfosUpdate&) override; - void setInitialDisplayInfos(const std::vector<gui::WindowInfo>& windowInfos); - std::unordered_set<ui::LogicalDisplayId /*displayId*/> getPrivacySensitiveDisplays(); + void setInitialDisplayInfosLocked(const std::vector<gui::WindowInfo>& windowInfos) + REQUIRES(mLock); + std::unordered_set<ui::LogicalDisplayId> getPrivacySensitiveDisplaysLocked() + REQUIRES(mLock); void onPointerChoreographerDestroyed(); + // This lock is also used by PointerChoreographer. See PointerChoreographer::getLock(). + std::mutex mLock; + private: - std::mutex mListenerLock; - PointerChoreographer* mPointerChoreographer GUARDED_BY(mListenerLock); + PointerChoreographer* mPointerChoreographer GUARDED_BY(mLock); std::unordered_set<ui::LogicalDisplayId /*displayId*/> mPrivacySensitiveDisplays - GUARDED_BY(mListenerLock); + GUARDED_BY(mLock); }; - sp<PointerChoreographerDisplayInfoListener> mWindowInfoListener GUARDED_BY(mLock); using ControllerConstructor = ConstructorDelegate<std::function<std::shared_ptr<PointerControllerInterface>()>>; - ControllerConstructor mTouchControllerConstructor GUARDED_BY(mLock); + ControllerConstructor mTouchControllerConstructor GUARDED_BY(getLock()); ControllerConstructor getMouseControllerConstructor(ui::LogicalDisplayId displayId) - REQUIRES(mLock); + REQUIRES(getLock()); ControllerConstructor getStylusControllerConstructor(ui::LogicalDisplayId displayId) - REQUIRES(mLock); - - std::mutex mLock; + REQUIRES(getLock()); InputListenerInterface& mNextListener; PointerChoreographerPolicyInterface& mPolicy; std::map<ui::LogicalDisplayId, std::shared_ptr<PointerControllerInterface>> - mMousePointersByDisplay GUARDED_BY(mLock); + mMousePointersByDisplay GUARDED_BY(getLock()); std::map<DeviceId, std::shared_ptr<PointerControllerInterface>> mTouchPointersByDevice - GUARDED_BY(mLock); + GUARDED_BY(getLock()); std::map<DeviceId, std::shared_ptr<PointerControllerInterface>> mStylusPointersByDevice - GUARDED_BY(mLock); + GUARDED_BY(getLock()); std::map<DeviceId, std::shared_ptr<PointerControllerInterface>> mDrawingTabletPointersByDevice - GUARDED_BY(mLock); - - ui::LogicalDisplayId mDefaultMouseDisplayId GUARDED_BY(mLock); - ui::LogicalDisplayId mNotifiedPointerDisplayId GUARDED_BY(mLock); - std::vector<InputDeviceInfo> mInputDeviceInfos GUARDED_BY(mLock); - std::set<DeviceId> mMouseDevices GUARDED_BY(mLock); - std::vector<DisplayViewport> mViewports GUARDED_BY(mLock); - bool mShowTouchesEnabled GUARDED_BY(mLock); - bool mStylusPointerIconEnabled GUARDED_BY(mLock); + GUARDED_BY(getLock()); + + ui::LogicalDisplayId mDefaultMouseDisplayId GUARDED_BY(getLock()); + ui::LogicalDisplayId mNotifiedPointerDisplayId GUARDED_BY(getLock()); + std::vector<InputDeviceInfo> mInputDeviceInfos GUARDED_BY(getLock()); + std::set<DeviceId> mMouseDevices GUARDED_BY(getLock()); + std::vector<DisplayViewport> mViewports GUARDED_BY(getLock()); + bool mShowTouchesEnabled GUARDED_BY(getLock()); + bool mStylusPointerIconEnabled GUARDED_BY(getLock()); std::set<ui::LogicalDisplayId /*displayId*/> mDisplaysWithPointersHidden; - ui::LogicalDisplayId mCurrentFocusedDisplay GUARDED_BY(mLock); + ui::LogicalDisplayId mCurrentFocusedDisplay GUARDED_BY(getLock()); protected: using WindowListenerRegisterConsumer = std::function<std::vector<gui::WindowInfo>( @@ -211,6 +221,10 @@ protected: const WindowListenerUnregisterConsumer& unregisterListener); private: + // WindowInfoListener object should always exist while PointerChoreographer exists, because we + // need to use the lock from it. But we don't always need to register the listener. + bool mIsWindowInfoListenerRegistered GUARDED_BY(getLock()); + const sp<PointerChoreographerDisplayInfoListener> mWindowInfoListener; const WindowListenerRegisterConsumer mRegisterListener; const WindowListenerUnregisterConsumer mUnregisterListener; }; diff --git a/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp b/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp index a040c88e78..143c192686 100644 --- a/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp +++ b/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp @@ -589,28 +589,30 @@ void OutputLayer::writeOutputIndependentGeometryStateToHWC( void OutputLayer::writeLutToHWC(HWC2::Layer* hwcLayer, const LayerFECompositionState& outputIndependentState) { - if (!outputIndependentState.luts) { - return; - } - auto& lutFileDescriptor = outputIndependentState.luts->getLutFileDescriptor(); - auto lutOffsets = outputIndependentState.luts->offsets; - auto& lutProperties = outputIndependentState.luts->lutProperties; + Luts luts; + // if outputIndependentState.luts is nullptr, it means we want to clear the LUTs + // and we pass an empty Luts object to the HWC. + if (outputIndependentState.luts) { + auto& lutFileDescriptor = outputIndependentState.luts->getLutFileDescriptor(); + auto lutOffsets = outputIndependentState.luts->offsets; + auto& lutProperties = outputIndependentState.luts->lutProperties; + + std::vector<LutProperties> aidlProperties; + aidlProperties.reserve(lutProperties.size()); + for (size_t i = 0; i < lutOffsets.size(); i++) { + LutProperties properties; + properties.dimension = static_cast<LutProperties::Dimension>(lutProperties[i].dimension); + properties.size = lutProperties[i].size; + properties.samplingKeys = { + static_cast<LutProperties::SamplingKey>(lutProperties[i].samplingKey)}; + aidlProperties.emplace_back(properties); + } - std::vector<LutProperties> aidlProperties; - aidlProperties.reserve(lutProperties.size()); - for (size_t i = 0; i < lutOffsets.size(); i++) { - LutProperties properties; - properties.dimension = static_cast<LutProperties::Dimension>(lutProperties[i].dimension); - properties.size = lutProperties[i].size; - properties.samplingKeys = { - static_cast<LutProperties::SamplingKey>(lutProperties[i].samplingKey)}; - aidlProperties.emplace_back(properties); - } - Luts luts; - luts.pfd = ndk::ScopedFileDescriptor(dup(lutFileDescriptor.get())); - luts.offsets = lutOffsets; - luts.lutProperties = std::move(aidlProperties); + luts.pfd = ndk::ScopedFileDescriptor(dup(lutFileDescriptor.get())); + luts.offsets = lutOffsets; + luts.lutProperties = std::move(aidlProperties); + } switch (auto error = hwcLayer->setLuts(luts)) { case hal::Error::NONE: diff --git a/services/surfaceflinger/CompositionEngine/tests/OutputLayerTest.cpp b/services/surfaceflinger/CompositionEngine/tests/OutputLayerTest.cpp index dbffe80a3a..034c768ff3 100644 --- a/services/surfaceflinger/CompositionEngine/tests/OutputLayerTest.cpp +++ b/services/surfaceflinger/CompositionEngine/tests/OutputLayerTest.cpp @@ -901,6 +901,7 @@ struct OutputLayerWriteStateToHWCTest : public OutputLayerTest { EXPECT_CALL(*mHwcLayer, setSurfaceDamage(RegionEq(surfaceDamage))).WillOnce(Return(kError)); EXPECT_CALL(*mHwcLayer, setBlockingRegion(RegionEq(blockingRegion))) .WillOnce(Return(kError)); + EXPECT_CALL(*mHwcLayer, setLuts(_)).WillOnce(Return(kError)); } void expectSetCompositionTypeCall(Composition compositionType) { diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 2c4fcf546b..f9e59b914c 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -9177,26 +9177,46 @@ binder::Status SurfaceComposerAIDL::setGameDefaultFrameRateOverride(int32_t uid, } binder::Status SurfaceComposerAIDL::enableRefreshRateOverlay(bool active) { + status_t status = checkAccessPermission(); + if (status != OK) { + return binderStatusFromStatusT(status); + } mFlinger->sfdo_enableRefreshRateOverlay(active); return binder::Status::ok(); } binder::Status SurfaceComposerAIDL::setDebugFlash(int delay) { + status_t status = checkAccessPermission(); + if (status != OK) { + return binderStatusFromStatusT(status); + } mFlinger->sfdo_setDebugFlash(delay); return binder::Status::ok(); } binder::Status SurfaceComposerAIDL::scheduleComposite() { + status_t status = checkAccessPermission(); + if (status != OK) { + return binderStatusFromStatusT(status); + } mFlinger->sfdo_scheduleComposite(); return binder::Status::ok(); } binder::Status SurfaceComposerAIDL::scheduleCommit() { + status_t status = checkAccessPermission(); + if (status != OK) { + return binderStatusFromStatusT(status); + } mFlinger->sfdo_scheduleCommit(); return binder::Status::ok(); } binder::Status SurfaceComposerAIDL::forceClientComposition(bool enabled) { + status_t status = checkAccessPermission(); + if (status != OK) { + return binderStatusFromStatusT(status); + } mFlinger->sfdo_forceClientComposition(enabled); return binder::Status::ok(); } diff --git a/vulkan/libvulkan/api.cpp b/vulkan/libvulkan/api.cpp index c335e2a952..8451ad1c9e 100644 --- a/vulkan/libvulkan/api.cpp +++ b/vulkan/libvulkan/api.cpp @@ -45,6 +45,9 @@ #include "driver.h" #include "layers_extensions.h" +#include <com_android_graphics_libvulkan_flags.h> + +using namespace com::android::graphics::libvulkan; namespace vulkan { namespace api { @@ -1473,7 +1476,7 @@ VkResult EnumerateInstanceVersion(uint32_t* pApiVersion) { if (!EnsureInitialized()) return VK_ERROR_OUT_OF_HOST_MEMORY; - *pApiVersion = VK_API_VERSION_1_3; + *pApiVersion = flags::vulkan_1_4_instance_api() ? VK_API_VERSION_1_4 : VK_API_VERSION_1_3; return VK_SUCCESS; } diff --git a/vulkan/libvulkan/api_gen.cpp b/vulkan/libvulkan/api_gen.cpp index 9ff0b46c0f..131c97ca85 100644 --- a/vulkan/libvulkan/api_gen.cpp +++ b/vulkan/libvulkan/api_gen.cpp @@ -266,6 +266,7 @@ bool InitDispatchTable( INIT_PROC(true, dev, CreateRenderPass); INIT_PROC(true, dev, DestroyRenderPass); INIT_PROC(true, dev, GetRenderAreaGranularity); + INIT_PROC(false, dev, GetRenderingAreaGranularity); INIT_PROC(true, dev, CreateCommandPool); INIT_PROC(true, dev, DestroyCommandPool); INIT_PROC(true, dev, ResetCommandPool); @@ -323,6 +324,7 @@ bool InitDispatchTable( INIT_PROC_EXT(KHR_swapchain, true, dev, GetSwapchainImagesKHR); INIT_PROC_EXT(KHR_swapchain, true, dev, AcquireNextImageKHR); INIT_PROC_EXT(KHR_swapchain, true, dev, QueuePresentKHR); + INIT_PROC(false, dev, CmdPushDescriptorSet); INIT_PROC(false, dev, TrimCommandPool); INIT_PROC(false, dev, GetDeviceGroupPeerMemoryFeatures); INIT_PROC(false, dev, BindBufferMemory2); @@ -335,6 +337,7 @@ bool InitDispatchTable( INIT_PROC(false, dev, CreateDescriptorUpdateTemplate); INIT_PROC(false, dev, DestroyDescriptorUpdateTemplate); INIT_PROC(false, dev, UpdateDescriptorSetWithTemplate); + INIT_PROC(false, dev, CmdPushDescriptorSetWithTemplate); INIT_PROC(false, dev, GetBufferMemoryRequirements2); INIT_PROC(false, dev, GetImageMemoryRequirements2); INIT_PROC(false, dev, GetImageSparseMemoryRequirements2); @@ -359,11 +362,13 @@ bool InitDispatchTable( INIT_PROC(false, dev, GetBufferOpaqueCaptureAddress); INIT_PROC(false, dev, GetBufferDeviceAddress); INIT_PROC(false, dev, GetDeviceMemoryOpaqueCaptureAddress); + INIT_PROC(false, dev, CmdSetLineStipple); INIT_PROC(false, dev, CmdSetCullMode); INIT_PROC(false, dev, CmdSetFrontFace); INIT_PROC(false, dev, CmdSetPrimitiveTopology); INIT_PROC(false, dev, CmdSetViewportWithCount); INIT_PROC(false, dev, CmdSetScissorWithCount); + INIT_PROC(false, dev, CmdBindIndexBuffer2); INIT_PROC(false, dev, CmdBindVertexBuffers2); INIT_PROC(false, dev, CmdSetDepthTestEnable); INIT_PROC(false, dev, CmdSetDepthWriteEnable); @@ -390,8 +395,22 @@ bool InitDispatchTable( INIT_PROC(false, dev, CmdPipelineBarrier2); INIT_PROC(false, dev, QueueSubmit2); INIT_PROC(false, dev, CmdWriteTimestamp2); + INIT_PROC(false, dev, CopyMemoryToImage); + INIT_PROC(false, dev, CopyImageToMemory); + INIT_PROC(false, dev, CopyImageToImage); + INIT_PROC(false, dev, TransitionImageLayout); INIT_PROC(false, dev, CmdBeginRendering); INIT_PROC(false, dev, CmdEndRendering); + INIT_PROC(false, dev, GetImageSubresourceLayout2); + INIT_PROC(false, dev, GetDeviceImageSubresourceLayout); + INIT_PROC(false, dev, MapMemory2); + INIT_PROC(false, dev, UnmapMemory2); + INIT_PROC(false, dev, CmdBindDescriptorSets2); + INIT_PROC(false, dev, CmdPushConstants2); + INIT_PROC(false, dev, CmdPushDescriptorSet2); + INIT_PROC(false, dev, CmdPushDescriptorSetWithTemplate2); + INIT_PROC(false, dev, CmdSetRenderingAttachmentLocations); + INIT_PROC(false, dev, CmdSetRenderingInputAttachmentIndices); // clang-format on return success; @@ -480,6 +499,7 @@ VKAPI_ATTR void DestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, c VKAPI_ATTR VkResult CreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass); VKAPI_ATTR void DestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR void GetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity); +VKAPI_ATTR void GetRenderingAreaGranularity(VkDevice device, const VkRenderingAreaInfo* pRenderingAreaInfo, VkExtent2D* pGranularity); VKAPI_ATTR VkResult CreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool); VKAPI_ATTR void DestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult ResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags); @@ -550,6 +570,7 @@ VKAPI_ATTR VkResult GetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice phy VKAPI_ATTR void GetPhysicalDeviceQueueFamilyProperties2(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2* pQueueFamilyProperties); VKAPI_ATTR void GetPhysicalDeviceMemoryProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties); VKAPI_ATTR void GetPhysicalDeviceSparseImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties); +VKAPI_ATTR void CmdPushDescriptorSet(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites); VKAPI_ATTR void TrimCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags); VKAPI_ATTR void GetPhysicalDeviceExternalBufferProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties); VKAPI_ATTR void GetPhysicalDeviceExternalSemaphoreProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, VkExternalSemaphoreProperties* pExternalSemaphoreProperties); @@ -567,6 +588,7 @@ VKAPI_ATTR VkResult GetPhysicalDevicePresentRectanglesKHR(VkPhysicalDevice physi VKAPI_ATTR VkResult CreateDescriptorUpdateTemplate(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate); VKAPI_ATTR void DestroyDescriptorUpdateTemplate(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR void UpdateDescriptorSetWithTemplate(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData); +VKAPI_ATTR void CmdPushDescriptorSetWithTemplate(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void* pData); VKAPI_ATTR void GetBufferMemoryRequirements2(VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements); VKAPI_ATTR void GetImageMemoryRequirements2(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements); VKAPI_ATTR void GetImageSparseMemoryRequirements2(VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements); @@ -591,12 +613,14 @@ VKAPI_ATTR void CmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkBuf VKAPI_ATTR uint64_t GetBufferOpaqueCaptureAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo); VKAPI_ATTR VkDeviceAddress GetBufferDeviceAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo); VKAPI_ATTR uint64_t GetDeviceMemoryOpaqueCaptureAddress(VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo); +VKAPI_ATTR void CmdSetLineStipple(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern); VKAPI_ATTR VkResult GetPhysicalDeviceToolProperties(VkPhysicalDevice physicalDevice, uint32_t* pToolCount, VkPhysicalDeviceToolProperties* pToolProperties); VKAPI_ATTR void CmdSetCullMode(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode); VKAPI_ATTR void CmdSetFrontFace(VkCommandBuffer commandBuffer, VkFrontFace frontFace); VKAPI_ATTR void CmdSetPrimitiveTopology(VkCommandBuffer commandBuffer, VkPrimitiveTopology primitiveTopology); VKAPI_ATTR void CmdSetViewportWithCount(VkCommandBuffer commandBuffer, uint32_t viewportCount, const VkViewport* pViewports); VKAPI_ATTR void CmdSetScissorWithCount(VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D* pScissors); +VKAPI_ATTR void CmdBindIndexBuffer2(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkDeviceSize size, VkIndexType indexType); VKAPI_ATTR void CmdBindVertexBuffers2(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes, const VkDeviceSize* pStrides); VKAPI_ATTR void CmdSetDepthTestEnable(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable); VKAPI_ATTR void CmdSetDepthWriteEnable(VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable); @@ -623,8 +647,22 @@ VKAPI_ATTR void CmdWaitEvents2(VkCommandBuffer commandBuffer, uint32_t eventCoun VKAPI_ATTR void CmdPipelineBarrier2(VkCommandBuffer commandBuffer, const VkDependencyInfo* pDependencyInfo); VKAPI_ATTR VkResult QueueSubmit2(VkQueue queue, uint32_t submitCount, const VkSubmitInfo2* pSubmits, VkFence fence); VKAPI_ATTR void CmdWriteTimestamp2(VkCommandBuffer commandBuffer, VkPipelineStageFlags2 stage, VkQueryPool queryPool, uint32_t query); +VKAPI_ATTR VkResult CopyMemoryToImage(VkDevice device, const VkCopyMemoryToImageInfo* pCopyMemoryToImageInfo); +VKAPI_ATTR VkResult CopyImageToMemory(VkDevice device, const VkCopyImageToMemoryInfo* pCopyImageToMemoryInfo); +VKAPI_ATTR VkResult CopyImageToImage(VkDevice device, const VkCopyImageToImageInfo* pCopyImageToImageInfo); +VKAPI_ATTR VkResult TransitionImageLayout(VkDevice device, uint32_t transitionCount, const VkHostImageLayoutTransitionInfo* pTransitions); VKAPI_ATTR void CmdBeginRendering(VkCommandBuffer commandBuffer, const VkRenderingInfo* pRenderingInfo); VKAPI_ATTR void CmdEndRendering(VkCommandBuffer commandBuffer); +VKAPI_ATTR void GetImageSubresourceLayout2(VkDevice device, VkImage image, const VkImageSubresource2* pSubresource, VkSubresourceLayout2* pLayout); +VKAPI_ATTR void GetDeviceImageSubresourceLayout(VkDevice device, const VkDeviceImageSubresourceInfo* pInfo, VkSubresourceLayout2* pLayout); +VKAPI_ATTR VkResult MapMemory2(VkDevice device, const VkMemoryMapInfo* pMemoryMapInfo, void** ppData); +VKAPI_ATTR VkResult UnmapMemory2(VkDevice device, const VkMemoryUnmapInfo* pMemoryUnmapInfo); +VKAPI_ATTR void CmdBindDescriptorSets2(VkCommandBuffer commandBuffer, const VkBindDescriptorSetsInfo* pBindDescriptorSetsInfo); +VKAPI_ATTR void CmdPushConstants2(VkCommandBuffer commandBuffer, const VkPushConstantsInfo* pPushConstantsInfo); +VKAPI_ATTR void CmdPushDescriptorSet2(VkCommandBuffer commandBuffer, const VkPushDescriptorSetInfo* pPushDescriptorSetInfo); +VKAPI_ATTR void CmdPushDescriptorSetWithTemplate2(VkCommandBuffer commandBuffer, const VkPushDescriptorSetWithTemplateInfo* pPushDescriptorSetWithTemplateInfo); +VKAPI_ATTR void CmdSetRenderingAttachmentLocations(VkCommandBuffer commandBuffer, const VkRenderingAttachmentLocationInfo* pLocationInfo); +VKAPI_ATTR void CmdSetRenderingInputAttachmentIndices(VkCommandBuffer commandBuffer, const VkRenderingInputAttachmentIndexInfo* pInputAttachmentIndexInfo); VKAPI_ATTR VkResult EnumeratePhysicalDevices(VkInstance instance, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices) { return GetData(instance).dispatch.EnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices); @@ -764,7 +802,9 @@ VKAPI_ATTR PFN_vkVoidFunction GetInstanceProcAddr(VkInstance instance, const cha { "vkCmdBeginRenderPass2", reinterpret_cast<PFN_vkVoidFunction>(CmdBeginRenderPass2) }, { "vkCmdBeginRendering", reinterpret_cast<PFN_vkVoidFunction>(CmdBeginRendering) }, { "vkCmdBindDescriptorSets", reinterpret_cast<PFN_vkVoidFunction>(CmdBindDescriptorSets) }, + { "vkCmdBindDescriptorSets2", reinterpret_cast<PFN_vkVoidFunction>(CmdBindDescriptorSets2) }, { "vkCmdBindIndexBuffer", reinterpret_cast<PFN_vkVoidFunction>(CmdBindIndexBuffer) }, + { "vkCmdBindIndexBuffer2", reinterpret_cast<PFN_vkVoidFunction>(CmdBindIndexBuffer2) }, { "vkCmdBindPipeline", reinterpret_cast<PFN_vkVoidFunction>(CmdBindPipeline) }, { "vkCmdBindVertexBuffers", reinterpret_cast<PFN_vkVoidFunction>(CmdBindVertexBuffers) }, { "vkCmdBindVertexBuffers2", reinterpret_cast<PFN_vkVoidFunction>(CmdBindVertexBuffers2) }, @@ -802,6 +842,11 @@ VKAPI_ATTR PFN_vkVoidFunction GetInstanceProcAddr(VkInstance instance, const cha { "vkCmdPipelineBarrier", reinterpret_cast<PFN_vkVoidFunction>(CmdPipelineBarrier) }, { "vkCmdPipelineBarrier2", reinterpret_cast<PFN_vkVoidFunction>(CmdPipelineBarrier2) }, { "vkCmdPushConstants", reinterpret_cast<PFN_vkVoidFunction>(CmdPushConstants) }, + { "vkCmdPushConstants2", reinterpret_cast<PFN_vkVoidFunction>(CmdPushConstants2) }, + { "vkCmdPushDescriptorSet", reinterpret_cast<PFN_vkVoidFunction>(CmdPushDescriptorSet) }, + { "vkCmdPushDescriptorSet2", reinterpret_cast<PFN_vkVoidFunction>(CmdPushDescriptorSet2) }, + { "vkCmdPushDescriptorSetWithTemplate", reinterpret_cast<PFN_vkVoidFunction>(CmdPushDescriptorSetWithTemplate) }, + { "vkCmdPushDescriptorSetWithTemplate2", reinterpret_cast<PFN_vkVoidFunction>(CmdPushDescriptorSetWithTemplate2) }, { "vkCmdResetEvent", reinterpret_cast<PFN_vkVoidFunction>(CmdResetEvent) }, { "vkCmdResetEvent2", reinterpret_cast<PFN_vkVoidFunction>(CmdResetEvent2) }, { "vkCmdResetQueryPool", reinterpret_cast<PFN_vkVoidFunction>(CmdResetQueryPool) }, @@ -820,10 +865,13 @@ VKAPI_ATTR PFN_vkVoidFunction GetInstanceProcAddr(VkInstance instance, const cha { "vkCmdSetEvent", reinterpret_cast<PFN_vkVoidFunction>(CmdSetEvent) }, { "vkCmdSetEvent2", reinterpret_cast<PFN_vkVoidFunction>(CmdSetEvent2) }, { "vkCmdSetFrontFace", reinterpret_cast<PFN_vkVoidFunction>(CmdSetFrontFace) }, + { "vkCmdSetLineStipple", reinterpret_cast<PFN_vkVoidFunction>(CmdSetLineStipple) }, { "vkCmdSetLineWidth", reinterpret_cast<PFN_vkVoidFunction>(CmdSetLineWidth) }, { "vkCmdSetPrimitiveRestartEnable", reinterpret_cast<PFN_vkVoidFunction>(CmdSetPrimitiveRestartEnable) }, { "vkCmdSetPrimitiveTopology", reinterpret_cast<PFN_vkVoidFunction>(CmdSetPrimitiveTopology) }, { "vkCmdSetRasterizerDiscardEnable", reinterpret_cast<PFN_vkVoidFunction>(CmdSetRasterizerDiscardEnable) }, + { "vkCmdSetRenderingAttachmentLocations", reinterpret_cast<PFN_vkVoidFunction>(CmdSetRenderingAttachmentLocations) }, + { "vkCmdSetRenderingInputAttachmentIndices", reinterpret_cast<PFN_vkVoidFunction>(CmdSetRenderingInputAttachmentIndices) }, { "vkCmdSetScissor", reinterpret_cast<PFN_vkVoidFunction>(CmdSetScissor) }, { "vkCmdSetScissorWithCount", reinterpret_cast<PFN_vkVoidFunction>(CmdSetScissorWithCount) }, { "vkCmdSetStencilCompareMask", reinterpret_cast<PFN_vkVoidFunction>(CmdSetStencilCompareMask) }, @@ -838,6 +886,9 @@ VKAPI_ATTR PFN_vkVoidFunction GetInstanceProcAddr(VkInstance instance, const cha { "vkCmdWaitEvents2", reinterpret_cast<PFN_vkVoidFunction>(CmdWaitEvents2) }, { "vkCmdWriteTimestamp", reinterpret_cast<PFN_vkVoidFunction>(CmdWriteTimestamp) }, { "vkCmdWriteTimestamp2", reinterpret_cast<PFN_vkVoidFunction>(CmdWriteTimestamp2) }, + { "vkCopyImageToImage", reinterpret_cast<PFN_vkVoidFunction>(CopyImageToImage) }, + { "vkCopyImageToMemory", reinterpret_cast<PFN_vkVoidFunction>(CopyImageToMemory) }, + { "vkCopyMemoryToImage", reinterpret_cast<PFN_vkVoidFunction>(CopyMemoryToImage) }, { "vkCreateBuffer", reinterpret_cast<PFN_vkVoidFunction>(CreateBuffer) }, { "vkCreateBufferView", reinterpret_cast<PFN_vkVoidFunction>(CreateBufferView) }, { "vkCreateCommandPool", reinterpret_cast<PFN_vkVoidFunction>(CreateCommandPool) }, @@ -911,6 +962,7 @@ VKAPI_ATTR PFN_vkVoidFunction GetInstanceProcAddr(VkInstance instance, const cha { "vkGetDeviceGroupSurfacePresentModesKHR", reinterpret_cast<PFN_vkVoidFunction>(GetDeviceGroupSurfacePresentModesKHR) }, { "vkGetDeviceImageMemoryRequirements", reinterpret_cast<PFN_vkVoidFunction>(GetDeviceImageMemoryRequirements) }, { "vkGetDeviceImageSparseMemoryRequirements", reinterpret_cast<PFN_vkVoidFunction>(GetDeviceImageSparseMemoryRequirements) }, + { "vkGetDeviceImageSubresourceLayout", reinterpret_cast<PFN_vkVoidFunction>(GetDeviceImageSubresourceLayout) }, { "vkGetDeviceMemoryCommitment", reinterpret_cast<PFN_vkVoidFunction>(GetDeviceMemoryCommitment) }, { "vkGetDeviceMemoryOpaqueCaptureAddress", reinterpret_cast<PFN_vkVoidFunction>(GetDeviceMemoryOpaqueCaptureAddress) }, { "vkGetDeviceProcAddr", reinterpret_cast<PFN_vkVoidFunction>(GetDeviceProcAddr) }, @@ -923,16 +975,19 @@ VKAPI_ATTR PFN_vkVoidFunction GetInstanceProcAddr(VkInstance instance, const cha { "vkGetImageSparseMemoryRequirements", reinterpret_cast<PFN_vkVoidFunction>(GetImageSparseMemoryRequirements) }, { "vkGetImageSparseMemoryRequirements2", reinterpret_cast<PFN_vkVoidFunction>(GetImageSparseMemoryRequirements2) }, { "vkGetImageSubresourceLayout", reinterpret_cast<PFN_vkVoidFunction>(GetImageSubresourceLayout) }, + { "vkGetImageSubresourceLayout2", reinterpret_cast<PFN_vkVoidFunction>(GetImageSubresourceLayout2) }, { "vkGetInstanceProcAddr", reinterpret_cast<PFN_vkVoidFunction>(GetInstanceProcAddr) }, { "vkGetMemoryAndroidHardwareBufferANDROID", reinterpret_cast<PFN_vkVoidFunction>(GetMemoryAndroidHardwareBufferANDROID) }, { "vkGetPipelineCacheData", reinterpret_cast<PFN_vkVoidFunction>(GetPipelineCacheData) }, { "vkGetPrivateData", reinterpret_cast<PFN_vkVoidFunction>(GetPrivateData) }, { "vkGetQueryPoolResults", reinterpret_cast<PFN_vkVoidFunction>(GetQueryPoolResults) }, { "vkGetRenderAreaGranularity", reinterpret_cast<PFN_vkVoidFunction>(GetRenderAreaGranularity) }, + { "vkGetRenderingAreaGranularity", reinterpret_cast<PFN_vkVoidFunction>(GetRenderingAreaGranularity) }, { "vkGetSemaphoreCounterValue", reinterpret_cast<PFN_vkVoidFunction>(GetSemaphoreCounterValue) }, { "vkGetSwapchainImagesKHR", reinterpret_cast<PFN_vkVoidFunction>(GetSwapchainImagesKHR) }, { "vkInvalidateMappedMemoryRanges", reinterpret_cast<PFN_vkVoidFunction>(InvalidateMappedMemoryRanges) }, { "vkMapMemory", reinterpret_cast<PFN_vkVoidFunction>(MapMemory) }, + { "vkMapMemory2", reinterpret_cast<PFN_vkVoidFunction>(MapMemory2) }, { "vkMergePipelineCaches", reinterpret_cast<PFN_vkVoidFunction>(MergePipelineCaches) }, { "vkQueueBindSparse", reinterpret_cast<PFN_vkVoidFunction>(QueueBindSparse) }, { "vkQueuePresentKHR", reinterpret_cast<PFN_vkVoidFunction>(QueuePresentKHR) }, @@ -948,8 +1003,10 @@ VKAPI_ATTR PFN_vkVoidFunction GetInstanceProcAddr(VkInstance instance, const cha { "vkSetEvent", reinterpret_cast<PFN_vkVoidFunction>(SetEvent) }, { "vkSetPrivateData", reinterpret_cast<PFN_vkVoidFunction>(SetPrivateData) }, { "vkSignalSemaphore", reinterpret_cast<PFN_vkVoidFunction>(SignalSemaphore) }, + { "vkTransitionImageLayout", reinterpret_cast<PFN_vkVoidFunction>(TransitionImageLayout) }, { "vkTrimCommandPool", reinterpret_cast<PFN_vkVoidFunction>(TrimCommandPool) }, { "vkUnmapMemory", reinterpret_cast<PFN_vkVoidFunction>(UnmapMemory) }, + { "vkUnmapMemory2", reinterpret_cast<PFN_vkVoidFunction>(UnmapMemory2) }, { "vkUpdateDescriptorSetWithTemplate", reinterpret_cast<PFN_vkVoidFunction>(UpdateDescriptorSetWithTemplate) }, { "vkUpdateDescriptorSets", reinterpret_cast<PFN_vkVoidFunction>(UpdateDescriptorSets) }, { "vkWaitForFences", reinterpret_cast<PFN_vkVoidFunction>(WaitForFences) }, @@ -1273,6 +1330,10 @@ VKAPI_ATTR void GetRenderAreaGranularity(VkDevice device, VkRenderPass renderPas GetData(device).dispatch.GetRenderAreaGranularity(device, renderPass, pGranularity); } +VKAPI_ATTR void GetRenderingAreaGranularity(VkDevice device, const VkRenderingAreaInfo* pRenderingAreaInfo, VkExtent2D* pGranularity) { + GetData(device).dispatch.GetRenderingAreaGranularity(device, pRenderingAreaInfo, pGranularity); +} + VKAPI_ATTR VkResult CreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool) { return GetData(device).dispatch.CreateCommandPool(device, pCreateInfo, pAllocator, pCommandPool); } @@ -1553,6 +1614,10 @@ VKAPI_ATTR void GetPhysicalDeviceSparseImageFormatProperties2(VkPhysicalDevice p GetData(physicalDevice).dispatch.GetPhysicalDeviceSparseImageFormatProperties2(physicalDevice, pFormatInfo, pPropertyCount, pProperties); } +VKAPI_ATTR void CmdPushDescriptorSet(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites) { + GetData(commandBuffer).dispatch.CmdPushDescriptorSet(commandBuffer, pipelineBindPoint, layout, set, descriptorWriteCount, pDescriptorWrites); +} + VKAPI_ATTR void TrimCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags) { GetData(device).dispatch.TrimCommandPool(device, commandPool, flags); } @@ -1621,6 +1686,10 @@ VKAPI_ATTR void UpdateDescriptorSetWithTemplate(VkDevice device, VkDescriptorSet GetData(device).dispatch.UpdateDescriptorSetWithTemplate(device, descriptorSet, descriptorUpdateTemplate, pData); } +VKAPI_ATTR void CmdPushDescriptorSetWithTemplate(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void* pData) { + GetData(commandBuffer).dispatch.CmdPushDescriptorSetWithTemplate(commandBuffer, descriptorUpdateTemplate, layout, set, pData); +} + VKAPI_ATTR void GetBufferMemoryRequirements2(VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) { GetData(device).dispatch.GetBufferMemoryRequirements2(device, pInfo, pMemoryRequirements); } @@ -1717,6 +1786,10 @@ VKAPI_ATTR uint64_t GetDeviceMemoryOpaqueCaptureAddress(VkDevice device, const V return GetData(device).dispatch.GetDeviceMemoryOpaqueCaptureAddress(device, pInfo); } +VKAPI_ATTR void CmdSetLineStipple(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern) { + GetData(commandBuffer).dispatch.CmdSetLineStipple(commandBuffer, lineStippleFactor, lineStipplePattern); +} + VKAPI_ATTR VkResult GetPhysicalDeviceToolProperties(VkPhysicalDevice physicalDevice, uint32_t* pToolCount, VkPhysicalDeviceToolProperties* pToolProperties) { return GetData(physicalDevice).dispatch.GetPhysicalDeviceToolProperties(physicalDevice, pToolCount, pToolProperties); } @@ -1741,6 +1814,10 @@ VKAPI_ATTR void CmdSetScissorWithCount(VkCommandBuffer commandBuffer, uint32_t s GetData(commandBuffer).dispatch.CmdSetScissorWithCount(commandBuffer, scissorCount, pScissors); } +VKAPI_ATTR void CmdBindIndexBuffer2(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkDeviceSize size, VkIndexType indexType) { + GetData(commandBuffer).dispatch.CmdBindIndexBuffer2(commandBuffer, buffer, offset, size, indexType); +} + VKAPI_ATTR void CmdBindVertexBuffers2(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes, const VkDeviceSize* pStrides) { GetData(commandBuffer).dispatch.CmdBindVertexBuffers2(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets, pSizes, pStrides); } @@ -1845,6 +1922,22 @@ VKAPI_ATTR void CmdWriteTimestamp2(VkCommandBuffer commandBuffer, VkPipelineStag GetData(commandBuffer).dispatch.CmdWriteTimestamp2(commandBuffer, stage, queryPool, query); } +VKAPI_ATTR VkResult CopyMemoryToImage(VkDevice device, const VkCopyMemoryToImageInfo* pCopyMemoryToImageInfo) { + return GetData(device).dispatch.CopyMemoryToImage(device, pCopyMemoryToImageInfo); +} + +VKAPI_ATTR VkResult CopyImageToMemory(VkDevice device, const VkCopyImageToMemoryInfo* pCopyImageToMemoryInfo) { + return GetData(device).dispatch.CopyImageToMemory(device, pCopyImageToMemoryInfo); +} + +VKAPI_ATTR VkResult CopyImageToImage(VkDevice device, const VkCopyImageToImageInfo* pCopyImageToImageInfo) { + return GetData(device).dispatch.CopyImageToImage(device, pCopyImageToImageInfo); +} + +VKAPI_ATTR VkResult TransitionImageLayout(VkDevice device, uint32_t transitionCount, const VkHostImageLayoutTransitionInfo* pTransitions) { + return GetData(device).dispatch.TransitionImageLayout(device, transitionCount, pTransitions); +} + VKAPI_ATTR void CmdBeginRendering(VkCommandBuffer commandBuffer, const VkRenderingInfo* pRenderingInfo) { GetData(commandBuffer).dispatch.CmdBeginRendering(commandBuffer, pRenderingInfo); } @@ -1853,6 +1946,46 @@ VKAPI_ATTR void CmdEndRendering(VkCommandBuffer commandBuffer) { GetData(commandBuffer).dispatch.CmdEndRendering(commandBuffer); } +VKAPI_ATTR void GetImageSubresourceLayout2(VkDevice device, VkImage image, const VkImageSubresource2* pSubresource, VkSubresourceLayout2* pLayout) { + GetData(device).dispatch.GetImageSubresourceLayout2(device, image, pSubresource, pLayout); +} + +VKAPI_ATTR void GetDeviceImageSubresourceLayout(VkDevice device, const VkDeviceImageSubresourceInfo* pInfo, VkSubresourceLayout2* pLayout) { + GetData(device).dispatch.GetDeviceImageSubresourceLayout(device, pInfo, pLayout); +} + +VKAPI_ATTR VkResult MapMemory2(VkDevice device, const VkMemoryMapInfo* pMemoryMapInfo, void** ppData) { + return GetData(device).dispatch.MapMemory2(device, pMemoryMapInfo, ppData); +} + +VKAPI_ATTR VkResult UnmapMemory2(VkDevice device, const VkMemoryUnmapInfo* pMemoryUnmapInfo) { + return GetData(device).dispatch.UnmapMemory2(device, pMemoryUnmapInfo); +} + +VKAPI_ATTR void CmdBindDescriptorSets2(VkCommandBuffer commandBuffer, const VkBindDescriptorSetsInfo* pBindDescriptorSetsInfo) { + GetData(commandBuffer).dispatch.CmdBindDescriptorSets2(commandBuffer, pBindDescriptorSetsInfo); +} + +VKAPI_ATTR void CmdPushConstants2(VkCommandBuffer commandBuffer, const VkPushConstantsInfo* pPushConstantsInfo) { + GetData(commandBuffer).dispatch.CmdPushConstants2(commandBuffer, pPushConstantsInfo); +} + +VKAPI_ATTR void CmdPushDescriptorSet2(VkCommandBuffer commandBuffer, const VkPushDescriptorSetInfo* pPushDescriptorSetInfo) { + GetData(commandBuffer).dispatch.CmdPushDescriptorSet2(commandBuffer, pPushDescriptorSetInfo); +} + +VKAPI_ATTR void CmdPushDescriptorSetWithTemplate2(VkCommandBuffer commandBuffer, const VkPushDescriptorSetWithTemplateInfo* pPushDescriptorSetWithTemplateInfo) { + GetData(commandBuffer).dispatch.CmdPushDescriptorSetWithTemplate2(commandBuffer, pPushDescriptorSetWithTemplateInfo); +} + +VKAPI_ATTR void CmdSetRenderingAttachmentLocations(VkCommandBuffer commandBuffer, const VkRenderingAttachmentLocationInfo* pLocationInfo) { + GetData(commandBuffer).dispatch.CmdSetRenderingAttachmentLocations(commandBuffer, pLocationInfo); +} + +VKAPI_ATTR void CmdSetRenderingInputAttachmentIndices(VkCommandBuffer commandBuffer, const VkRenderingInputAttachmentIndexInfo* pInputAttachmentIndexInfo) { + GetData(commandBuffer).dispatch.CmdSetRenderingInputAttachmentIndices(commandBuffer, pInputAttachmentIndexInfo); +} + } // anonymous namespace @@ -2299,6 +2432,11 @@ VKAPI_ATTR void vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderP } __attribute__((visibility("default"))) +VKAPI_ATTR void vkGetRenderingAreaGranularity(VkDevice device, const VkRenderingAreaInfo* pRenderingAreaInfo, VkExtent2D* pGranularity) { + vulkan::api::GetRenderingAreaGranularity(device, pRenderingAreaInfo, pGranularity); +} + +__attribute__((visibility("default"))) VKAPI_ATTR VkResult vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool) { return vulkan::api::CreateCommandPool(device, pCreateInfo, pAllocator, pCommandPool); } @@ -2649,6 +2787,11 @@ VKAPI_ATTR void vkGetPhysicalDeviceSparseImageFormatProperties2(VkPhysicalDevice } __attribute__((visibility("default"))) +VKAPI_ATTR void vkCmdPushDescriptorSet(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites) { + vulkan::api::CmdPushDescriptorSet(commandBuffer, pipelineBindPoint, layout, set, descriptorWriteCount, pDescriptorWrites); +} + +__attribute__((visibility("default"))) VKAPI_ATTR void vkTrimCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags) { vulkan::api::TrimCommandPool(device, commandPool, flags); } @@ -2734,6 +2877,11 @@ VKAPI_ATTR void vkUpdateDescriptorSetWithTemplate(VkDevice device, VkDescriptorS } __attribute__((visibility("default"))) +VKAPI_ATTR void vkCmdPushDescriptorSetWithTemplate(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void* pData) { + vulkan::api::CmdPushDescriptorSetWithTemplate(commandBuffer, descriptorUpdateTemplate, layout, set, pData); +} + +__attribute__((visibility("default"))) VKAPI_ATTR void vkGetBufferMemoryRequirements2(VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) { vulkan::api::GetBufferMemoryRequirements2(device, pInfo, pMemoryRequirements); } @@ -2854,6 +3002,11 @@ VKAPI_ATTR uint64_t vkGetDeviceMemoryOpaqueCaptureAddress(VkDevice device, const } __attribute__((visibility("default"))) +VKAPI_ATTR void vkCmdSetLineStipple(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern) { + vulkan::api::CmdSetLineStipple(commandBuffer, lineStippleFactor, lineStipplePattern); +} + +__attribute__((visibility("default"))) VKAPI_ATTR VkResult vkGetPhysicalDeviceToolProperties(VkPhysicalDevice physicalDevice, uint32_t* pToolCount, VkPhysicalDeviceToolProperties* pToolProperties) { return vulkan::api::GetPhysicalDeviceToolProperties(physicalDevice, pToolCount, pToolProperties); } @@ -2884,6 +3037,11 @@ VKAPI_ATTR void vkCmdSetScissorWithCount(VkCommandBuffer commandBuffer, uint32_t } __attribute__((visibility("default"))) +VKAPI_ATTR void vkCmdBindIndexBuffer2(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkDeviceSize size, VkIndexType indexType) { + vulkan::api::CmdBindIndexBuffer2(commandBuffer, buffer, offset, size, indexType); +} + +__attribute__((visibility("default"))) VKAPI_ATTR void vkCmdBindVertexBuffers2(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes, const VkDeviceSize* pStrides) { vulkan::api::CmdBindVertexBuffers2(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets, pSizes, pStrides); } @@ -3014,6 +3172,26 @@ VKAPI_ATTR void vkCmdWriteTimestamp2(VkCommandBuffer commandBuffer, VkPipelineSt } __attribute__((visibility("default"))) +VKAPI_ATTR VkResult vkCopyMemoryToImage(VkDevice device, const VkCopyMemoryToImageInfo* pCopyMemoryToImageInfo) { + return vulkan::api::CopyMemoryToImage(device, pCopyMemoryToImageInfo); +} + +__attribute__((visibility("default"))) +VKAPI_ATTR VkResult vkCopyImageToMemory(VkDevice device, const VkCopyImageToMemoryInfo* pCopyImageToMemoryInfo) { + return vulkan::api::CopyImageToMemory(device, pCopyImageToMemoryInfo); +} + +__attribute__((visibility("default"))) +VKAPI_ATTR VkResult vkCopyImageToImage(VkDevice device, const VkCopyImageToImageInfo* pCopyImageToImageInfo) { + return vulkan::api::CopyImageToImage(device, pCopyImageToImageInfo); +} + +__attribute__((visibility("default"))) +VKAPI_ATTR VkResult vkTransitionImageLayout(VkDevice device, uint32_t transitionCount, const VkHostImageLayoutTransitionInfo* pTransitions) { + return vulkan::api::TransitionImageLayout(device, transitionCount, pTransitions); +} + +__attribute__((visibility("default"))) VKAPI_ATTR void vkCmdBeginRendering(VkCommandBuffer commandBuffer, const VkRenderingInfo* pRenderingInfo) { vulkan::api::CmdBeginRendering(commandBuffer, pRenderingInfo); } @@ -3023,4 +3201,54 @@ VKAPI_ATTR void vkCmdEndRendering(VkCommandBuffer commandBuffer) { vulkan::api::CmdEndRendering(commandBuffer); } +__attribute__((visibility("default"))) +VKAPI_ATTR void vkGetImageSubresourceLayout2(VkDevice device, VkImage image, const VkImageSubresource2* pSubresource, VkSubresourceLayout2* pLayout) { + vulkan::api::GetImageSubresourceLayout2(device, image, pSubresource, pLayout); +} + +__attribute__((visibility("default"))) +VKAPI_ATTR void vkGetDeviceImageSubresourceLayout(VkDevice device, const VkDeviceImageSubresourceInfo* pInfo, VkSubresourceLayout2* pLayout) { + vulkan::api::GetDeviceImageSubresourceLayout(device, pInfo, pLayout); +} + +__attribute__((visibility("default"))) +VKAPI_ATTR VkResult vkMapMemory2(VkDevice device, const VkMemoryMapInfo* pMemoryMapInfo, void** ppData) { + return vulkan::api::MapMemory2(device, pMemoryMapInfo, ppData); +} + +__attribute__((visibility("default"))) +VKAPI_ATTR VkResult vkUnmapMemory2(VkDevice device, const VkMemoryUnmapInfo* pMemoryUnmapInfo) { + return vulkan::api::UnmapMemory2(device, pMemoryUnmapInfo); +} + +__attribute__((visibility("default"))) +VKAPI_ATTR void vkCmdBindDescriptorSets2(VkCommandBuffer commandBuffer, const VkBindDescriptorSetsInfo* pBindDescriptorSetsInfo) { + vulkan::api::CmdBindDescriptorSets2(commandBuffer, pBindDescriptorSetsInfo); +} + +__attribute__((visibility("default"))) +VKAPI_ATTR void vkCmdPushConstants2(VkCommandBuffer commandBuffer, const VkPushConstantsInfo* pPushConstantsInfo) { + vulkan::api::CmdPushConstants2(commandBuffer, pPushConstantsInfo); +} + +__attribute__((visibility("default"))) +VKAPI_ATTR void vkCmdPushDescriptorSet2(VkCommandBuffer commandBuffer, const VkPushDescriptorSetInfo* pPushDescriptorSetInfo) { + vulkan::api::CmdPushDescriptorSet2(commandBuffer, pPushDescriptorSetInfo); +} + +__attribute__((visibility("default"))) +VKAPI_ATTR void vkCmdPushDescriptorSetWithTemplate2(VkCommandBuffer commandBuffer, const VkPushDescriptorSetWithTemplateInfo* pPushDescriptorSetWithTemplateInfo) { + vulkan::api::CmdPushDescriptorSetWithTemplate2(commandBuffer, pPushDescriptorSetWithTemplateInfo); +} + +__attribute__((visibility("default"))) +VKAPI_ATTR void vkCmdSetRenderingAttachmentLocations(VkCommandBuffer commandBuffer, const VkRenderingAttachmentLocationInfo* pLocationInfo) { + vulkan::api::CmdSetRenderingAttachmentLocations(commandBuffer, pLocationInfo); +} + +__attribute__((visibility("default"))) +VKAPI_ATTR void vkCmdSetRenderingInputAttachmentIndices(VkCommandBuffer commandBuffer, const VkRenderingInputAttachmentIndexInfo* pInputAttachmentIndexInfo) { + vulkan::api::CmdSetRenderingInputAttachmentIndices(commandBuffer, pInputAttachmentIndexInfo); +} + // clang-format on diff --git a/vulkan/libvulkan/api_gen.h b/vulkan/libvulkan/api_gen.h index b468a8911b..17dc62fa6b 100644 --- a/vulkan/libvulkan/api_gen.h +++ b/vulkan/libvulkan/api_gen.h @@ -139,6 +139,7 @@ struct DeviceDispatchTable { PFN_vkCreateRenderPass CreateRenderPass; PFN_vkDestroyRenderPass DestroyRenderPass; PFN_vkGetRenderAreaGranularity GetRenderAreaGranularity; + PFN_vkGetRenderingAreaGranularity GetRenderingAreaGranularity; PFN_vkCreateCommandPool CreateCommandPool; PFN_vkDestroyCommandPool DestroyCommandPool; PFN_vkResetCommandPool ResetCommandPool; @@ -196,6 +197,7 @@ struct DeviceDispatchTable { PFN_vkGetSwapchainImagesKHR GetSwapchainImagesKHR; PFN_vkAcquireNextImageKHR AcquireNextImageKHR; PFN_vkQueuePresentKHR QueuePresentKHR; + PFN_vkCmdPushDescriptorSet CmdPushDescriptorSet; PFN_vkTrimCommandPool TrimCommandPool; PFN_vkGetDeviceGroupPeerMemoryFeatures GetDeviceGroupPeerMemoryFeatures; PFN_vkBindBufferMemory2 BindBufferMemory2; @@ -208,6 +210,7 @@ struct DeviceDispatchTable { PFN_vkCreateDescriptorUpdateTemplate CreateDescriptorUpdateTemplate; PFN_vkDestroyDescriptorUpdateTemplate DestroyDescriptorUpdateTemplate; PFN_vkUpdateDescriptorSetWithTemplate UpdateDescriptorSetWithTemplate; + PFN_vkCmdPushDescriptorSetWithTemplate CmdPushDescriptorSetWithTemplate; PFN_vkGetBufferMemoryRequirements2 GetBufferMemoryRequirements2; PFN_vkGetImageMemoryRequirements2 GetImageMemoryRequirements2; PFN_vkGetImageSparseMemoryRequirements2 GetImageSparseMemoryRequirements2; @@ -232,11 +235,13 @@ struct DeviceDispatchTable { PFN_vkGetBufferOpaqueCaptureAddress GetBufferOpaqueCaptureAddress; PFN_vkGetBufferDeviceAddress GetBufferDeviceAddress; PFN_vkGetDeviceMemoryOpaqueCaptureAddress GetDeviceMemoryOpaqueCaptureAddress; + PFN_vkCmdSetLineStipple CmdSetLineStipple; PFN_vkCmdSetCullMode CmdSetCullMode; PFN_vkCmdSetFrontFace CmdSetFrontFace; PFN_vkCmdSetPrimitiveTopology CmdSetPrimitiveTopology; PFN_vkCmdSetViewportWithCount CmdSetViewportWithCount; PFN_vkCmdSetScissorWithCount CmdSetScissorWithCount; + PFN_vkCmdBindIndexBuffer2 CmdBindIndexBuffer2; PFN_vkCmdBindVertexBuffers2 CmdBindVertexBuffers2; PFN_vkCmdSetDepthTestEnable CmdSetDepthTestEnable; PFN_vkCmdSetDepthWriteEnable CmdSetDepthWriteEnable; @@ -263,8 +268,22 @@ struct DeviceDispatchTable { PFN_vkCmdPipelineBarrier2 CmdPipelineBarrier2; PFN_vkQueueSubmit2 QueueSubmit2; PFN_vkCmdWriteTimestamp2 CmdWriteTimestamp2; + PFN_vkCopyMemoryToImage CopyMemoryToImage; + PFN_vkCopyImageToMemory CopyImageToMemory; + PFN_vkCopyImageToImage CopyImageToImage; + PFN_vkTransitionImageLayout TransitionImageLayout; PFN_vkCmdBeginRendering CmdBeginRendering; PFN_vkCmdEndRendering CmdEndRendering; + PFN_vkGetImageSubresourceLayout2 GetImageSubresourceLayout2; + PFN_vkGetDeviceImageSubresourceLayout GetDeviceImageSubresourceLayout; + PFN_vkMapMemory2 MapMemory2; + PFN_vkUnmapMemory2 UnmapMemory2; + PFN_vkCmdBindDescriptorSets2 CmdBindDescriptorSets2; + PFN_vkCmdPushConstants2 CmdPushConstants2; + PFN_vkCmdPushDescriptorSet2 CmdPushDescriptorSet2; + PFN_vkCmdPushDescriptorSetWithTemplate2 CmdPushDescriptorSetWithTemplate2; + PFN_vkCmdSetRenderingAttachmentLocations CmdSetRenderingAttachmentLocations; + PFN_vkCmdSetRenderingInputAttachmentIndices CmdSetRenderingInputAttachmentIndices; // clang-format on }; diff --git a/vulkan/libvulkan/driver.cpp b/vulkan/libvulkan/driver.cpp index 01436db4ae..7d0f545774 100644 --- a/vulkan/libvulkan/driver.cpp +++ b/vulkan/libvulkan/driver.cpp @@ -398,7 +398,7 @@ CreateInfoWrapper::CreateInfoWrapper(const VkInstanceCreateInfo& create_info, const VkAllocationCallbacks& allocator) : is_instance_(true), allocator_(allocator), - loader_api_version_(VK_API_VERSION_1_3), + loader_api_version_(flags::vulkan_1_4_instance_api() ? VK_API_VERSION_1_4 : VK_API_VERSION_1_3), icd_api_version_(icd_api_version), physical_dev_(VK_NULL_HANDLE), instance_info_(create_info), @@ -410,7 +410,7 @@ CreateInfoWrapper::CreateInfoWrapper(VkPhysicalDevice physical_dev, const VkAllocationCallbacks& allocator) : is_instance_(false), allocator_(allocator), - loader_api_version_(VK_API_VERSION_1_3), + loader_api_version_(flags::vulkan_1_4_instance_api() ? VK_API_VERSION_1_4 : VK_API_VERSION_1_3), icd_api_version_(icd_api_version), physical_dev_(physical_dev), dev_info_(create_info), @@ -552,6 +552,10 @@ VkResult CreateInfoWrapper::SanitizeExtensions() { is_instance_ ? loader_api_version_ : std::min(icd_api_version_, loader_api_version_); switch (api_version) { + case VK_API_VERSION_1_4: + hook_extensions_.set(ProcHook::EXTENSION_CORE_1_4); + hal_extensions_.set(ProcHook::EXTENSION_CORE_1_4); + [[clang::fallthrough]]; case VK_API_VERSION_1_3: hook_extensions_.set(ProcHook::EXTENSION_CORE_1_3); hal_extensions_.set(ProcHook::EXTENSION_CORE_1_3); @@ -701,6 +705,7 @@ void CreateInfoWrapper::FilterExtension(const char* name) { case ProcHook::EXTENSION_CORE_1_1: case ProcHook::EXTENSION_CORE_1_2: case ProcHook::EXTENSION_CORE_1_3: + case ProcHook::EXTENSION_CORE_1_4: case ProcHook::EXTENSION_COUNT: // Device and meta extensions. If we ever get here it's a bug in // our code. But enumerating them lets us avoid having a default @@ -766,6 +771,7 @@ void CreateInfoWrapper::FilterExtension(const char* name) { case ProcHook::EXTENSION_CORE_1_1: case ProcHook::EXTENSION_CORE_1_2: case ProcHook::EXTENSION_CORE_1_3: + case ProcHook::EXTENSION_CORE_1_4: case ProcHook::EXTENSION_COUNT: // Instance and meta extensions. If we ever get here it's a bug // in our code. But enumerating them lets us avoid having a diff --git a/vulkan/libvulkan/driver_gen.h b/vulkan/libvulkan/driver_gen.h index 649c0f1a17..204b16f65a 100644 --- a/vulkan/libvulkan/driver_gen.h +++ b/vulkan/libvulkan/driver_gen.h @@ -68,6 +68,7 @@ struct ProcHook { EXTENSION_CORE_1_1, EXTENSION_CORE_1_2, EXTENSION_CORE_1_3, + EXTENSION_CORE_1_4, EXTENSION_COUNT, EXTENSION_UNKNOWN, }; diff --git a/vulkan/libvulkan/libvulkan.map.txt b/vulkan/libvulkan/libvulkan.map.txt index b189c6888d..ffe46f7c58 100644 --- a/vulkan/libvulkan/libvulkan.map.txt +++ b/vulkan/libvulkan/libvulkan.map.txt @@ -6,32 +6,34 @@ LIBVULKAN { vkAllocateDescriptorSets; vkAllocateMemory; vkBeginCommandBuffer; - vkBindBufferMemory; vkBindBufferMemory2; # introduced=28 - vkBindImageMemory; + vkBindBufferMemory; vkBindImageMemory2; # introduced=28 + vkBindImageMemory; vkCmdBeginQuery; - vkCmdBeginRendering; # introduced=33 - vkCmdBeginRenderPass; vkCmdBeginRenderPass2; # introduced=31 + vkCmdBeginRenderPass; + vkCmdBeginRendering; # introduced=33 + vkCmdBindDescriptorSets2; #introduced=36 vkCmdBindDescriptorSets; + vkCmdBindIndexBuffer2; #introduced=36 vkCmdBindIndexBuffer; vkCmdBindPipeline; - vkCmdBindVertexBuffers; vkCmdBindVertexBuffers2; #introduced=33 - vkCmdBlitImage; + vkCmdBindVertexBuffers; vkCmdBlitImage2; #introduced=33 + vkCmdBlitImage; vkCmdClearAttachments; vkCmdClearColorImage; vkCmdClearDepthStencilImage; - vkCmdCopyBuffer; vkCmdCopyBuffer2; #introduced=33 - vkCmdCopyBufferToImage; + vkCmdCopyBuffer; vkCmdCopyBufferToImage2; #introduced=33 - vkCmdCopyImage; + vkCmdCopyBufferToImage; vkCmdCopyImage2; #introduced=33 - vkCmdCopyImageToBuffer; + vkCmdCopyImage; vkCmdCopyImageToBuffer2; #introduced=33 + vkCmdCopyImageToBuffer; vkCmdCopyQueryPoolResults; vkCmdDispatch; vkCmdDispatchBase; # introduced=28 @@ -43,21 +45,26 @@ LIBVULKAN { vkCmdDrawIndirect; vkCmdDrawIndirectCount; # introduced=31 vkCmdEndQuery; - vkCmdEndRendering; #introduced=33 - vkCmdEndRenderPass; vkCmdEndRenderPass2; # introduced=31 + vkCmdEndRenderPass; + vkCmdEndRendering; #introduced=33 vkCmdExecuteCommands; vkCmdFillBuffer; - vkCmdNextSubpass; vkCmdNextSubpass2; # introduced=31 - vkCmdPipelineBarrier; + vkCmdNextSubpass; vkCmdPipelineBarrier2; #introduced=33 + vkCmdPipelineBarrier; + vkCmdPushConstants2; #introduced=36 vkCmdPushConstants; - vkCmdResetEvent; + vkCmdPushDescriptorSet2; #introduced=36 + vkCmdPushDescriptorSet; #introduced=36 + vkCmdPushDescriptorSetWithTemplate2; #introduced=36 + vkCmdPushDescriptorSetWithTemplate; #introduced=36 vkCmdResetEvent2; #introduced=33 + vkCmdResetEvent; vkCmdResetQueryPool; - vkCmdResolveImage; vkCmdResolveImage2; #introduced=33 + vkCmdResolveImage; vkCmdSetBlendConstants; vkCmdSetCullMode; #introduced=33 vkCmdSetDepthBias; @@ -68,13 +75,16 @@ LIBVULKAN { vkCmdSetDepthTestEnable; #introduced=33 vkCmdSetDepthWriteEnable; #introduced=33 vkCmdSetDeviceMask; # introduced=28 - vkCmdSetEvent; vkCmdSetEvent2; #introduced=33 + vkCmdSetEvent; vkCmdSetFrontFace; #introduced=33 + vkCmdSetLineStipple; #introduced=36 vkCmdSetLineWidth; vkCmdSetPrimitiveRestartEnable; #introduced=33 vkCmdSetPrimitiveTopology; #introduced=33 vkCmdSetRasterizerDiscardEnable; #introduced=33 + vkCmdSetRenderingAttachmentLocations; #introduced=36 + vkCmdSetRenderingInputAttachmentIndices; #introduced=36 vkCmdSetScissor; vkCmdSetScissorWithCount; #introduced=33 vkCmdSetStencilCompareMask; @@ -85,10 +95,12 @@ LIBVULKAN { vkCmdSetViewport; vkCmdSetViewportWithCount; #introduced=33 vkCmdUpdateBuffer; - vkCmdWaitEvents; vkCmdWaitEvents2; #introduced=33 - vkCmdWriteTimestamp; + vkCmdWaitEvents; vkCmdWriteTimestamp2; #introduced=33 + vkCmdWriteTimestamp; + vkCopyImageToMemory; #introduced=36 + vkCopyMemoryToImage; #introduced=36 vkCreateAndroidSurfaceKHR; vkCreateBuffer; vkCreateBufferView; @@ -109,8 +121,8 @@ LIBVULKAN { vkCreatePipelineLayout; vkCreatePrivateDataSlot; #introduced=33 vkCreateQueryPool; - vkCreateRenderPass; vkCreateRenderPass2; # introduced=31 + vkCreateRenderPass; vkCreateSampler; vkCreateSamplerYcbcrConversion; # introduced=28 vkCreateSemaphore; @@ -156,8 +168,8 @@ LIBVULKAN { vkFreeMemory; vkGetAndroidHardwareBufferPropertiesANDROID; # introduced=28 vkGetBufferDeviceAddress; # introduced=31 - vkGetBufferMemoryRequirements; vkGetBufferMemoryRequirements2; # introduced=28 + vkGetBufferMemoryRequirements; vkGetBufferOpaqueCaptureAddress; # introduced=31 vkGetDescriptorSetLayoutSupport; # introduced=28 vkGetDeviceBufferMemoryRequirements; #introduced=33 @@ -166,39 +178,41 @@ LIBVULKAN { vkGetDeviceGroupSurfacePresentModesKHR; # introduced=28 vkGetDeviceImageMemoryRequirements; #introduced=33 vkGetDeviceImageSparseMemoryRequirements; #introduced=33 + vkGetDeviceImageSubresourceLayout; #introduced=36 vkGetDeviceMemoryCommitment; vkGetDeviceMemoryOpaqueCaptureAddress; # introduced=31 vkGetDeviceProcAddr; - vkGetDeviceQueue; vkGetDeviceQueue2; # introduced=28 + vkGetDeviceQueue; vkGetEventStatus; vkGetFenceStatus; - vkGetImageMemoryRequirements; vkGetImageMemoryRequirements2; # introduced=28 - vkGetImageSparseMemoryRequirements; + vkGetImageMemoryRequirements; vkGetImageSparseMemoryRequirements2; # introduced=28 - vkGetImageSubresourceLayout; + vkGetImageSparseMemoryRequirements; + vkGetImageSubresourceLayout2; #introduced=36 vkGetImageSubresourceLayout2EXT; # introduced=UpsideDownCake + vkGetImageSubresourceLayout; vkGetInstanceProcAddr; vkGetMemoryAndroidHardwareBufferANDROID; # introduced=28 vkGetPhysicalDeviceExternalBufferProperties; # introduced=28 vkGetPhysicalDeviceExternalFenceProperties; # introduced=28 vkGetPhysicalDeviceExternalSemaphoreProperties; # introduced=28 - vkGetPhysicalDeviceFeatures; vkGetPhysicalDeviceFeatures2; # introduced=28 - vkGetPhysicalDeviceFormatProperties; + vkGetPhysicalDeviceFeatures; vkGetPhysicalDeviceFormatProperties2; # introduced=28 - vkGetPhysicalDeviceImageFormatProperties; + vkGetPhysicalDeviceFormatProperties; vkGetPhysicalDeviceImageFormatProperties2; # introduced=28 - vkGetPhysicalDeviceMemoryProperties; + vkGetPhysicalDeviceImageFormatProperties; vkGetPhysicalDeviceMemoryProperties2; # introduced=28 + vkGetPhysicalDeviceMemoryProperties; vkGetPhysicalDevicePresentRectanglesKHR; # introduced=28 - vkGetPhysicalDeviceProperties; vkGetPhysicalDeviceProperties2; # introduced=28 - vkGetPhysicalDeviceQueueFamilyProperties; + vkGetPhysicalDeviceProperties; vkGetPhysicalDeviceQueueFamilyProperties2; # introduced=28 - vkGetPhysicalDeviceSparseImageFormatProperties; + vkGetPhysicalDeviceQueueFamilyProperties; vkGetPhysicalDeviceSparseImageFormatProperties2; # introduced=28 + vkGetPhysicalDeviceSparseImageFormatProperties; vkGetPhysicalDeviceSurfaceCapabilitiesKHR; vkGetPhysicalDeviceSurfaceFormatsKHR; vkGetPhysicalDeviceSurfacePresentModesKHR; @@ -208,15 +222,17 @@ LIBVULKAN { vkGetPrivateData; #introduced=33 vkGetQueryPoolResults; vkGetRenderAreaGranularity; + vkGetRenderingAreaGranularity; #introduced=36 vkGetSemaphoreCounterValue; # introduced=31 vkGetSwapchainImagesKHR; vkInvalidateMappedMemoryRanges; + vkMapMemory2; #introduced=36 vkMapMemory; vkMergePipelineCaches; vkQueueBindSparse; vkQueuePresentKHR; - vkQueueSubmit; vkQueueSubmit2; #introduced=33 + vkQueueSubmit; vkQueueWaitIdle; vkResetCommandBuffer; vkResetCommandPool; @@ -227,10 +243,12 @@ LIBVULKAN { vkSetEvent; vkSetPrivateData; # introduced=33 vkSignalSemaphore; # introduced=31 + vkTransitionImageLayout; #introduced=36 vkTrimCommandPool; # introduced=28 + vkUnmapMemory2; #introduced=36 vkUnmapMemory; - vkUpdateDescriptorSets; vkUpdateDescriptorSetWithTemplate; # introduced=28 + vkUpdateDescriptorSets; vkWaitForFences; vkWaitSemaphores; # introduced=31 local: diff --git a/vulkan/nulldrv/null_driver.cpp b/vulkan/nulldrv/null_driver.cpp index 973e71c892..48de3d6d33 100644 --- a/vulkan/nulldrv/null_driver.cpp +++ b/vulkan/nulldrv/null_driver.cpp @@ -1767,6 +1767,69 @@ VkResult SetPrivateData(VkDevice device, VkObjectType objectType, uint64_t objec return VK_SUCCESS; } +void GetRenderingAreaGranularity(VkDevice device, const VkRenderingAreaInfo* pRenderingAreaInfo, VkExtent2D* pGranularity) { +} + +void CmdPushDescriptorSet(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites) { +} + +void CmdPushDescriptorSetWithTemplate(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void* pData) { +} + +void CmdSetLineStipple(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern) { +} + +void CmdBindIndexBuffer2(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkDeviceSize size, VkIndexType indexType) { +} + +VkResult CopyMemoryToImage(VkDevice device, const VkCopyMemoryToImageInfo* pCopyMemoryToImageInfo) { + return VK_SUCCESS; +} + +VkResult CopyImageToMemory(VkDevice device, const VkCopyImageToMemoryInfo* pCopyImageToMemoryInfo) { + return VK_SUCCESS; +} + +VkResult CopyImageToImage(VkDevice device, const VkCopyImageToImageInfo* pCopyImageToImageInfo) { + return VK_SUCCESS; +} + +VkResult TransitionImageLayout(VkDevice device, uint32_t transitionCount, const VkHostImageLayoutTransitionInfo* pTransitions) { + return VK_SUCCESS; +} + +void GetImageSubresourceLayout2(VkDevice device, VkImage image, const VkImageSubresource2* pSubresource, VkSubresourceLayout2* pLayout) { +} + +void GetDeviceImageSubresourceLayout(VkDevice device, const VkDeviceImageSubresourceInfo* pInfo, VkSubresourceLayout2* pLayout) { +} + +VkResult MapMemory2(VkDevice device, const VkMemoryMapInfo* pMemoryMapInfo, void** ppData) { + return VK_SUCCESS; +} + +VkResult UnmapMemory2(VkDevice device, const VkMemoryUnmapInfo* pMemoryUnmapInfo) { + return VK_SUCCESS; +} + +void CmdBindDescriptorSets2(VkCommandBuffer commandBuffer, const VkBindDescriptorSetsInfo* pBindDescriptorSetsInfo) { +} + +void CmdPushConstants2(VkCommandBuffer commandBuffer, const VkPushConstantsInfo* pPushConstantsInfo) { +} + +void CmdPushDescriptorSet2(VkCommandBuffer commandBuffer, const VkPushDescriptorSetInfo* pPushDescriptorSetInfo) { +} + +void CmdPushDescriptorSetWithTemplate2(VkCommandBuffer commandBuffer, const VkPushDescriptorSetWithTemplateInfo* pPushDescriptorSetWithTemplateInfo) { +} + +void CmdSetRenderingAttachmentLocations(VkCommandBuffer commandBuffer, const VkRenderingAttachmentLocationInfo* pLocationInfo) { +} + +void CmdSetRenderingInputAttachmentIndices(VkCommandBuffer commandBuffer, const VkRenderingInputAttachmentIndexInfo* pInputAttachmentIndexInfo) { +} + #pragma clang diagnostic pop // clang-format on diff --git a/vulkan/nulldrv/null_driver_gen.cpp b/vulkan/nulldrv/null_driver_gen.cpp index 40a45af94e..30967c2add 100644 --- a/vulkan/nulldrv/null_driver_gen.cpp +++ b/vulkan/nulldrv/null_driver_gen.cpp @@ -75,7 +75,9 @@ const NameProc kInstanceProcs[] = { {"vkCmdBeginRenderPass2", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdBeginRenderPass2>(CmdBeginRenderPass2))}, {"vkCmdBeginRendering", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdBeginRendering>(CmdBeginRendering))}, {"vkCmdBindDescriptorSets", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdBindDescriptorSets>(CmdBindDescriptorSets))}, + {"vkCmdBindDescriptorSets2", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdBindDescriptorSets2>(CmdBindDescriptorSets2))}, {"vkCmdBindIndexBuffer", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdBindIndexBuffer>(CmdBindIndexBuffer))}, + {"vkCmdBindIndexBuffer2", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdBindIndexBuffer2>(CmdBindIndexBuffer2))}, {"vkCmdBindPipeline", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdBindPipeline>(CmdBindPipeline))}, {"vkCmdBindVertexBuffers", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdBindVertexBuffers>(CmdBindVertexBuffers))}, {"vkCmdBindVertexBuffers2", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdBindVertexBuffers2>(CmdBindVertexBuffers2))}, @@ -113,6 +115,11 @@ const NameProc kInstanceProcs[] = { {"vkCmdPipelineBarrier", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdPipelineBarrier>(CmdPipelineBarrier))}, {"vkCmdPipelineBarrier2", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdPipelineBarrier2>(CmdPipelineBarrier2))}, {"vkCmdPushConstants", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdPushConstants>(CmdPushConstants))}, + {"vkCmdPushConstants2", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdPushConstants2>(CmdPushConstants2))}, + {"vkCmdPushDescriptorSet", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdPushDescriptorSet>(CmdPushDescriptorSet))}, + {"vkCmdPushDescriptorSet2", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdPushDescriptorSet2>(CmdPushDescriptorSet2))}, + {"vkCmdPushDescriptorSetWithTemplate", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdPushDescriptorSetWithTemplate>(CmdPushDescriptorSetWithTemplate))}, + {"vkCmdPushDescriptorSetWithTemplate2", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdPushDescriptorSetWithTemplate2>(CmdPushDescriptorSetWithTemplate2))}, {"vkCmdResetEvent", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdResetEvent>(CmdResetEvent))}, {"vkCmdResetEvent2", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdResetEvent2>(CmdResetEvent2))}, {"vkCmdResetQueryPool", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdResetQueryPool>(CmdResetQueryPool))}, @@ -131,10 +138,13 @@ const NameProc kInstanceProcs[] = { {"vkCmdSetEvent", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdSetEvent>(CmdSetEvent))}, {"vkCmdSetEvent2", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdSetEvent2>(CmdSetEvent2))}, {"vkCmdSetFrontFace", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdSetFrontFace>(CmdSetFrontFace))}, + {"vkCmdSetLineStipple", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdSetLineStipple>(CmdSetLineStipple))}, {"vkCmdSetLineWidth", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdSetLineWidth>(CmdSetLineWidth))}, {"vkCmdSetPrimitiveRestartEnable", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdSetPrimitiveRestartEnable>(CmdSetPrimitiveRestartEnable))}, {"vkCmdSetPrimitiveTopology", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdSetPrimitiveTopology>(CmdSetPrimitiveTopology))}, {"vkCmdSetRasterizerDiscardEnable", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdSetRasterizerDiscardEnable>(CmdSetRasterizerDiscardEnable))}, + {"vkCmdSetRenderingAttachmentLocations", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdSetRenderingAttachmentLocations>(CmdSetRenderingAttachmentLocations))}, + {"vkCmdSetRenderingInputAttachmentIndices", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdSetRenderingInputAttachmentIndices>(CmdSetRenderingInputAttachmentIndices))}, {"vkCmdSetScissor", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdSetScissor>(CmdSetScissor))}, {"vkCmdSetScissorWithCount", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdSetScissorWithCount>(CmdSetScissorWithCount))}, {"vkCmdSetStencilCompareMask", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdSetStencilCompareMask>(CmdSetStencilCompareMask))}, @@ -149,6 +159,9 @@ const NameProc kInstanceProcs[] = { {"vkCmdWaitEvents2", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdWaitEvents2>(CmdWaitEvents2))}, {"vkCmdWriteTimestamp", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdWriteTimestamp>(CmdWriteTimestamp))}, {"vkCmdWriteTimestamp2", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdWriteTimestamp2>(CmdWriteTimestamp2))}, + {"vkCopyImageToImage", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCopyImageToImage>(CopyImageToImage))}, + {"vkCopyImageToMemory", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCopyImageToMemory>(CopyImageToMemory))}, + {"vkCopyMemoryToImage", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCopyMemoryToImage>(CopyMemoryToImage))}, {"vkCreateBuffer", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateBuffer>(CreateBuffer))}, {"vkCreateBufferView", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateBufferView>(CreateBufferView))}, {"vkCreateCommandPool", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateCommandPool>(CreateCommandPool))}, @@ -222,6 +235,7 @@ const NameProc kInstanceProcs[] = { {"vkGetDeviceGroupPeerMemoryFeatures", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetDeviceGroupPeerMemoryFeatures>(GetDeviceGroupPeerMemoryFeatures))}, {"vkGetDeviceImageMemoryRequirements", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetDeviceImageMemoryRequirements>(GetDeviceImageMemoryRequirements))}, {"vkGetDeviceImageSparseMemoryRequirements", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetDeviceImageSparseMemoryRequirements>(GetDeviceImageSparseMemoryRequirements))}, + {"vkGetDeviceImageSubresourceLayout", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetDeviceImageSubresourceLayout>(GetDeviceImageSubresourceLayout))}, {"vkGetDeviceMemoryCommitment", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetDeviceMemoryCommitment>(GetDeviceMemoryCommitment))}, {"vkGetDeviceMemoryOpaqueCaptureAddress", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetDeviceMemoryOpaqueCaptureAddress>(GetDeviceMemoryOpaqueCaptureAddress))}, {"vkGetDeviceProcAddr", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetDeviceProcAddr>(GetDeviceProcAddr))}, @@ -234,6 +248,7 @@ const NameProc kInstanceProcs[] = { {"vkGetImageSparseMemoryRequirements", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetImageSparseMemoryRequirements>(GetImageSparseMemoryRequirements))}, {"vkGetImageSparseMemoryRequirements2", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetImageSparseMemoryRequirements2>(GetImageSparseMemoryRequirements2))}, {"vkGetImageSubresourceLayout", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetImageSubresourceLayout>(GetImageSubresourceLayout))}, + {"vkGetImageSubresourceLayout2", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetImageSubresourceLayout2>(GetImageSubresourceLayout2))}, {"vkGetInstanceProcAddr", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetInstanceProcAddr>(GetInstanceProcAddr))}, {"vkGetPhysicalDeviceExternalBufferProperties", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetPhysicalDeviceExternalBufferProperties>(GetPhysicalDeviceExternalBufferProperties))}, {"vkGetPhysicalDeviceExternalFenceProperties", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetPhysicalDeviceExternalFenceProperties>(GetPhysicalDeviceExternalFenceProperties))}, @@ -264,6 +279,7 @@ const NameProc kInstanceProcs[] = { {"vkGetPrivateData", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetPrivateData>(GetPrivateData))}, {"vkGetQueryPoolResults", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetQueryPoolResults>(GetQueryPoolResults))}, {"vkGetRenderAreaGranularity", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetRenderAreaGranularity>(GetRenderAreaGranularity))}, + {"vkGetRenderingAreaGranularity", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetRenderingAreaGranularity>(GetRenderingAreaGranularity))}, {"vkGetSemaphoreCounterValue", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetSemaphoreCounterValue>(GetSemaphoreCounterValue))}, {"vkGetSwapchainGrallocUsage2ANDROID", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetSwapchainGrallocUsage2ANDROID>(GetSwapchainGrallocUsage2ANDROID))}, {"vkGetSwapchainGrallocUsage3ANDROID", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetSwapchainGrallocUsage3ANDROID>(GetSwapchainGrallocUsage3ANDROID))}, @@ -271,6 +287,7 @@ const NameProc kInstanceProcs[] = { {"vkGetSwapchainGrallocUsageANDROID", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetSwapchainGrallocUsageANDROID>(GetSwapchainGrallocUsageANDROID))}, {"vkInvalidateMappedMemoryRanges", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkInvalidateMappedMemoryRanges>(InvalidateMappedMemoryRanges))}, {"vkMapMemory", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkMapMemory>(MapMemory))}, + {"vkMapMemory2", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkMapMemory2>(MapMemory2))}, {"vkMergePipelineCaches", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkMergePipelineCaches>(MergePipelineCaches))}, {"vkQueueBindSparse", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkQueueBindSparse>(QueueBindSparse))}, {"vkQueueSignalReleaseImageANDROID", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkQueueSignalReleaseImageANDROID>(QueueSignalReleaseImageANDROID))}, @@ -286,8 +303,10 @@ const NameProc kInstanceProcs[] = { {"vkSetEvent", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkSetEvent>(SetEvent))}, {"vkSetPrivateData", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkSetPrivateData>(SetPrivateData))}, {"vkSignalSemaphore", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkSignalSemaphore>(SignalSemaphore))}, + {"vkTransitionImageLayout", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkTransitionImageLayout>(TransitionImageLayout))}, {"vkTrimCommandPool", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkTrimCommandPool>(TrimCommandPool))}, {"vkUnmapMemory", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkUnmapMemory>(UnmapMemory))}, + {"vkUnmapMemory2", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkUnmapMemory2>(UnmapMemory2))}, {"vkUpdateDescriptorSetWithTemplate", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkUpdateDescriptorSetWithTemplate>(UpdateDescriptorSetWithTemplate))}, {"vkUpdateDescriptorSets", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkUpdateDescriptorSets>(UpdateDescriptorSets))}, {"vkWaitForFences", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkWaitForFences>(WaitForFences))}, diff --git a/vulkan/nulldrv/null_driver_gen.h b/vulkan/nulldrv/null_driver_gen.h index 0d1e223226..f609e7edb2 100644 --- a/vulkan/nulldrv/null_driver_gen.h +++ b/vulkan/nulldrv/null_driver_gen.h @@ -118,6 +118,7 @@ VKAPI_ATTR void DestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, c VKAPI_ATTR VkResult CreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass); VKAPI_ATTR void DestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR void GetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity); +VKAPI_ATTR void GetRenderingAreaGranularity(VkDevice device, const VkRenderingAreaInfo* pRenderingAreaInfo, VkExtent2D* pGranularity); VKAPI_ATTR VkResult CreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool); VKAPI_ATTR void DestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult ResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags); @@ -187,6 +188,7 @@ VKAPI_ATTR void GetPhysicalDeviceMemoryProperties2(VkPhysicalDevice physicalDevi VKAPI_ATTR void GetPhysicalDeviceMemoryProperties2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties); VKAPI_ATTR void GetPhysicalDeviceSparseImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties); VKAPI_ATTR void GetPhysicalDeviceSparseImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties); +VKAPI_ATTR void CmdPushDescriptorSet(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites); VKAPI_ATTR void TrimCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags); VKAPI_ATTR void GetPhysicalDeviceExternalBufferProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties); VKAPI_ATTR void GetPhysicalDeviceExternalSemaphoreProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, VkExternalSemaphoreProperties* pExternalSemaphoreProperties); @@ -200,6 +202,7 @@ VKAPI_ATTR void CmdDispatchBase(VkCommandBuffer commandBuffer, uint32_t baseGrou VKAPI_ATTR VkResult CreateDescriptorUpdateTemplate(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate); VKAPI_ATTR void DestroyDescriptorUpdateTemplate(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR void UpdateDescriptorSetWithTemplate(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData); +VKAPI_ATTR void CmdPushDescriptorSetWithTemplate(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void* pData); VKAPI_ATTR void GetBufferMemoryRequirements2(VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements); VKAPI_ATTR void GetImageMemoryRequirements2(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements); VKAPI_ATTR void GetImageSparseMemoryRequirements2(VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements); @@ -228,12 +231,14 @@ VKAPI_ATTR void CmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkBuf VKAPI_ATTR uint64_t GetBufferOpaqueCaptureAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo); VKAPI_ATTR VkDeviceAddress GetBufferDeviceAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo); VKAPI_ATTR uint64_t GetDeviceMemoryOpaqueCaptureAddress(VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo); +VKAPI_ATTR void CmdSetLineStipple(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern); VKAPI_ATTR VkResult GetPhysicalDeviceToolProperties(VkPhysicalDevice physicalDevice, uint32_t* pToolCount, VkPhysicalDeviceToolProperties* pToolProperties); VKAPI_ATTR void CmdSetCullMode(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode); VKAPI_ATTR void CmdSetFrontFace(VkCommandBuffer commandBuffer, VkFrontFace frontFace); VKAPI_ATTR void CmdSetPrimitiveTopology(VkCommandBuffer commandBuffer, VkPrimitiveTopology primitiveTopology); VKAPI_ATTR void CmdSetViewportWithCount(VkCommandBuffer commandBuffer, uint32_t viewportCount, const VkViewport* pViewports); VKAPI_ATTR void CmdSetScissorWithCount(VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D* pScissors); +VKAPI_ATTR void CmdBindIndexBuffer2(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkDeviceSize size, VkIndexType indexType); VKAPI_ATTR void CmdBindVertexBuffers2(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes, const VkDeviceSize* pStrides); VKAPI_ATTR void CmdSetDepthTestEnable(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable); VKAPI_ATTR void CmdSetDepthWriteEnable(VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable); @@ -260,8 +265,22 @@ VKAPI_ATTR void CmdWaitEvents2(VkCommandBuffer commandBuffer, uint32_t eventCoun VKAPI_ATTR void CmdPipelineBarrier2(VkCommandBuffer commandBuffer, const VkDependencyInfo* pDependencyInfo); VKAPI_ATTR VkResult QueueSubmit2(VkQueue queue, uint32_t submitCount, const VkSubmitInfo2* pSubmits, VkFence fence); VKAPI_ATTR void CmdWriteTimestamp2(VkCommandBuffer commandBuffer, VkPipelineStageFlags2 stage, VkQueryPool queryPool, uint32_t query); +VKAPI_ATTR VkResult CopyMemoryToImage(VkDevice device, const VkCopyMemoryToImageInfo* pCopyMemoryToImageInfo); +VKAPI_ATTR VkResult CopyImageToMemory(VkDevice device, const VkCopyImageToMemoryInfo* pCopyImageToMemoryInfo); +VKAPI_ATTR VkResult CopyImageToImage(VkDevice device, const VkCopyImageToImageInfo* pCopyImageToImageInfo); +VKAPI_ATTR VkResult TransitionImageLayout(VkDevice device, uint32_t transitionCount, const VkHostImageLayoutTransitionInfo* pTransitions); VKAPI_ATTR void CmdBeginRendering(VkCommandBuffer commandBuffer, const VkRenderingInfo* pRenderingInfo); VKAPI_ATTR void CmdEndRendering(VkCommandBuffer commandBuffer); +VKAPI_ATTR void GetImageSubresourceLayout2(VkDevice device, VkImage image, const VkImageSubresource2* pSubresource, VkSubresourceLayout2* pLayout); +VKAPI_ATTR void GetDeviceImageSubresourceLayout(VkDevice device, const VkDeviceImageSubresourceInfo* pInfo, VkSubresourceLayout2* pLayout); +VKAPI_ATTR VkResult MapMemory2(VkDevice device, const VkMemoryMapInfo* pMemoryMapInfo, void** ppData); +VKAPI_ATTR VkResult UnmapMemory2(VkDevice device, const VkMemoryUnmapInfo* pMemoryUnmapInfo); +VKAPI_ATTR void CmdBindDescriptorSets2(VkCommandBuffer commandBuffer, const VkBindDescriptorSetsInfo* pBindDescriptorSetsInfo); +VKAPI_ATTR void CmdPushConstants2(VkCommandBuffer commandBuffer, const VkPushConstantsInfo* pPushConstantsInfo); +VKAPI_ATTR void CmdPushDescriptorSet2(VkCommandBuffer commandBuffer, const VkPushDescriptorSetInfo* pPushDescriptorSetInfo); +VKAPI_ATTR void CmdPushDescriptorSetWithTemplate2(VkCommandBuffer commandBuffer, const VkPushDescriptorSetWithTemplateInfo* pPushDescriptorSetWithTemplateInfo); +VKAPI_ATTR void CmdSetRenderingAttachmentLocations(VkCommandBuffer commandBuffer, const VkRenderingAttachmentLocationInfo* pLocationInfo); +VKAPI_ATTR void CmdSetRenderingInputAttachmentIndices(VkCommandBuffer commandBuffer, const VkRenderingInputAttachmentIndexInfo* pInputAttachmentIndexInfo); // clang-format on } // namespace null_driver diff --git a/vulkan/scripts/generator_common.py b/vulkan/scripts/generator_common.py index 6b4cbad2e2..aa1e7f2c8d 100644 --- a/vulkan/scripts/generator_common.py +++ b/vulkan/scripts/generator_common.py @@ -379,6 +379,9 @@ def parse_vulkan_registry(): version_dict[cmd_name] = apiversion for feature in root.iter('feature'): + # hack, 'feature' element has multiple meanings.. should be more precise with path match + if feature.get('api') is None: + continue if 'vulkan' not in feature.get('api').split(','): continue diff --git a/vulkan/vkjson/vkjson.cc b/vulkan/vkjson/vkjson.cc index bfb7bd6d6f..9b508aa5ce 100644 --- a/vulkan/vkjson/vkjson.cc +++ b/vulkan/vkjson/vkjson.cc @@ -1050,6 +1050,9 @@ inline bool Iterate(Visitor* visitor, VkJsonDevice* device) { bool ret = true; switch (device->properties.apiVersion ^ VK_API_VERSION_PATCH(device->properties.apiVersion)) { + case VK_API_VERSION_1_4: + // TODO: real 1.4 support here + FALLTHROUGH_INTENDED; case VK_API_VERSION_1_3: ret &= visitor->Visit("core13", &device->core13); FALLTHROUGH_INTENDED; @@ -1110,6 +1113,8 @@ template <typename Visitor> inline bool Iterate(Visitor* visitor, VkJsonInstance* instance) { bool ret = true; switch (instance->api_version ^ VK_API_VERSION_PATCH(instance->api_version)) { + case VK_API_VERSION_1_4: + FALLTHROUGH_INTENDED; case VK_API_VERSION_1_3: FALLTHROUGH_INTENDED; case VK_API_VERSION_1_2: |