2 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-handle.h>
19 #include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-allocator.h>
28 void GpuMemoryBlock::OnRelease( uint32_t refcount )
30 mAllocator.Release( *this );
33 void GpuMemoryBlock::OnRetain( uint32_t refcount )
35 mAllocator.Retain( *this );
38 bool GpuMemoryBlock::OnDestroy()
40 // don't use default delete
44 GpuMemoryBlock::operator vk::DeviceMemory()
46 return mAllocator.GetVkDeviceMemory( *this );
49 void* GpuMemoryBlock::Map()
51 return mAllocator.Map( *this, 0, 0 );
54 void* GpuMemoryBlock::Map( uint32_t offset, uint32_t size )
56 return mAllocator.Map( *this, offset, size );
59 void GpuMemoryBlock::Unmap()
61 mAllocator.Unmap( *this );
64 void GpuMemoryBlock::Flush()