#include "dawn/native/SharedResourceMemory.h"
#include <algorithm>
#include <utility>
#include "dawn/native/Buffer.h"
#include "dawn/native/ChainUtils.h"
#include "dawn/native/Device.h"
#include "dawn/native/Queue.h"
#include "dawn/native/Texture.h"
namespace dawn::native {
SharedResource::~SharedResource() = default;
SharedResourceMemoryContents* SharedResource::GetSharedResourceMemoryContents() const { … }
SharedResourceMemory::SharedResourceMemory(DeviceBase* device,
ObjectBase::ErrorTag tag,
const char* label)
: … { … }
SharedResourceMemory::~SharedResourceMemory() = default;
void SharedResourceMemory::DestroyImpl() { … }
bool SharedResourceMemoryContents::HasWriteAccess() const { … }
bool SharedResourceMemoryContents::HasExclusiveReadAccess() const { … }
int SharedResourceMemoryContents::GetReadAccessCount() const { … }
void SharedResourceMemory::Initialize() { … }
Ref<SharedResourceMemoryContents> SharedResourceMemory::CreateContents() { … }
SharedResourceMemoryContents* SharedResourceMemory::GetContents() const { … }
MaybeError SharedResourceMemory::ValidateResourceCreatedFromSelf(SharedResource* resource) { … }
wgpu::Status SharedResourceMemory::APIBeginAccess(
TextureBase* texture,
const SharedTextureMemoryBeginAccessDescriptor* descriptor) { … }
wgpu::Status SharedResourceMemory::APIBeginAccess(
BufferBase* buffer,
const SharedBufferMemoryBeginAccessDescriptor* descriptor) { … }
template <typename Resource, typename BeginAccessDescriptor>
MaybeError SharedResourceMemory::BeginAccess(Resource* resource,
const BeginAccessDescriptor* rawDescriptor) { … }
wgpu::Status SharedResourceMemory::APIEndAccess(TextureBase* texture,
SharedTextureMemoryEndAccessState* state) { … }
wgpu::Status SharedResourceMemory::APIEndAccess(BufferBase* buffer,
SharedBufferMemoryEndAccessState* state) { … }
MaybeError SharedResourceMemory::BeginAccessImpl(
TextureBase* texture,
const UnpackedPtr<SharedTextureMemoryBeginAccessDescriptor>& descriptor) { … }
MaybeError SharedResourceMemory::BeginAccessImpl(
BufferBase* buffer,
const UnpackedPtr<SharedBufferMemoryBeginAccessDescriptor>& descriptor) { … }
ResultOrError<FenceAndSignalValue> SharedResourceMemory::EndAccessImpl(
TextureBase* texture,
ExecutionSerial lastUsageSerial,
UnpackedPtr<SharedTextureMemoryEndAccessState>& state) { … }
ResultOrError<FenceAndSignalValue> SharedResourceMemory::EndAccessImpl(
BufferBase* buffer,
ExecutionSerial lastUsageSerial,
UnpackedPtr<SharedBufferMemoryEndAccessState>& state) { … }
bool SharedResourceMemory::APIIsDeviceLost() const { … }
template <typename Resource, typename EndAccessState>
MaybeError SharedResourceMemory::EndAccess(Resource* resource, EndAccessState* state) { … }
template <typename Resource, typename EndAccessState>
ResultOrError<FenceAndSignalValue> SharedResourceMemory::EndAccessInternal(
ExecutionSerial lastUsageSerial,
Resource* resource,
EndAccessState* rawState) { … }
SharedResourceMemoryContents::SharedResourceMemoryContents(
WeakRef<SharedResourceMemory> sharedResourceMemory)
: … { … }
const WeakRef<SharedResourceMemory>& SharedResourceMemoryContents::GetSharedResourceMemory() const { … }
void SharedResourceMemoryContents::AcquirePendingFences(PendingFenceList* fences) { … }
}