mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-15 03:41:34 +00:00
This change adds platform-dependent services that handle creating semaphores and importing image memory. Then, we use them to wrap a texture from an outside source, and release a signal semaphore back when we're done with it. This will be used to allow chrome to render dawn on Vulkan platforms. Bug: chromium:976495 Change-Id: I9f07eaf436e10aa6bd88cffdc74fd23834d62ee0 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8340 Commit-Queue: Idan Raiter <idanr@google.com> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
38 lines
1.4 KiB
C++
38 lines
1.4 KiB
C++
// Copyright 2019 The Dawn Authors
|
|
//
|
|
// 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.
|
|
|
|
#include "dawn_native/vulkan/DeviceVk.h"
|
|
#include "dawn_native/vulkan/external_memory/MemoryService.h"
|
|
|
|
namespace dawn_native { namespace vulkan { namespace external_memory {
|
|
|
|
Service::Service(Device* device) : mDevice(device) {
|
|
DAWN_UNUSED(mDevice);
|
|
DAWN_UNUSED(mSupportedFirstPass);
|
|
}
|
|
|
|
Service::~Service() = default;
|
|
|
|
bool Service::Supported() {
|
|
return false;
|
|
}
|
|
|
|
ResultOrError<VkDeviceMemory> Service::ImportMemory(ExternalMemoryHandle handle,
|
|
VkDeviceSize allocationSize,
|
|
uint32_t memoryTypeIndex) {
|
|
return DAWN_UNIMPLEMENTED_ERROR("Using null semaphore service to interop inside Vulkan");
|
|
}
|
|
|
|
}}} // namespace dawn_native::vulkan::external_memory
|