$(graphics_src_dir)/vulkan/vulkan-shader.cpp \
$(graphics_src_dir)/vulkan/vulkan-swapchain.cpp \
$(graphics_src_dir)/vulkan/vulkan-sampler.cpp \
+ $(graphics_src_dir)/vulkan/vulkan-resource-cache.cpp \
$(graphics_src_dir)/vulkan/vulkan-graphics-texture.cpp \
$(graphics_src_dir)/vulkan/api/vulkan-api-controller.cpp \
$(graphics_src_dir)/vulkan/api/vulkan-api-shader.cpp \
bool Buffer::Initialise()
{
- auto type = Vulkan::Buffer::Type{};
+ Vulkan::Buffer::Type type;
if( mUsage == vk::BufferUsageFlagBits::eUniformBuffer )
{
type = Vulkan::Buffer::Type::UNIFORM;
std::vector<vk::PipelineShaderStageCreateInfo> shaderStages =
{
vk::PipelineShaderStageCreateInfo{}
- .setModule(vertexShader->GetVkShaderModule())
+ .setModule(vertexShader->GetVkHandle())
.setStage(vk::ShaderStageFlagBits::eVertex)
.setPName("main"),
vk::PipelineShaderStageCreateInfo{}
- .setModule(fragmentShader->GetVkShaderModule())
+ .setModule(fragmentShader->GetVkHandle())
.setStage(vk::ShaderStageFlagBits::eFragment)
.setPName("main")
};
vk::GraphicsPipelineCreateInfo pipelineInfo;
pipelineInfo
.setSubpass(0)
- .setRenderPass(fb->GetVkRenderPass()) // based on render target
+ .setRenderPass(fb->GetRenderPassVkHandle()) // based on render target
.setBasePipelineHandle(nullptr)
.setBasePipelineIndex(0)
.setLayout(pipelineLayout)
*/
virtual GpuMemoryBlockRef Allocate( const Handle<Buffer>& buffer, vk::MemoryPropertyFlags memoryProperties ) override
{
- return Allocate( mGraphics.GetDevice().getBufferMemoryRequirements( buffer->GetVkBuffer() ),
+ return Allocate( mGraphics.GetDevice().getBufferMemoryRequirements(buffer->GetVkHandle() ),
memoryProperties );
}
*/
GpuMemoryBlockRef Allocate( const ImageRef& image, vk::MemoryPropertyFlags memoryProperties ) override
{
- return Allocate( mGraphics.GetDevice().getImageMemoryRequirements( image->GetVkImage() ),
+ return Allocate( mGraphics.GetDevice().getImageMemoryRequirements(image->GetVkHandle() ),
memoryProperties );
}
*
* @return
*/
- vk::Buffer GetVkBuffer() const
+ vk::Buffer GetVkHandle() const
{
return mBuffer;
}
return U32(mImpl->GetSize());
}
-vk::Buffer Buffer::GetVkBuffer() const
+vk::Buffer Buffer::GetVkHandle() const
{
- return mImpl->GetVkBuffer();
+ return mImpl->GetVkHandle();
}
void Buffer::BindMemory( const GpuMemoryBlockRef& handle )
* Returns Vulkan VkBuffer object associated with this buffer
* @return
*/
- vk::Buffer GetVkBuffer() const;
+ vk::Buffer GetVkHandle() const;
/**
* Returns handle to the allocated memory
~Impl()
{
- mGraphics.GetDevice().freeCommandBuffers( mOwnerCommandPool.GetPool(),
+ mGraphics.GetDevice().freeCommandBuffers(mOwnerCommandPool.GetVkHandle(),
1, &mCommandBuffer );
}
// Render pass is obtained from the default framebuffer
// it's a legacy but little nicer
auto swapchain = mGraphics.GetSwapchainForFBID( 0u );
- inheritance.setRenderPass( swapchain->GetCurrentFramebuffer()->GetVkRenderPass() );
+ inheritance.setRenderPass(swapchain->GetCurrentFramebuffer()->GetRenderPassVkHandle() );
info.setPInheritanceInfo( &inheritance );
}
void Free()
{
assert( mCommandBuffer && "Invalid command buffer!" );
- mGraphics.GetDevice().freeCommandBuffers( mOwnerCommandPool.GetPool(), mCommandBuffer );
+ mGraphics.GetDevice().freeCommandBuffers(mOwnerCommandPool.GetVkHandle(), mCommandBuffer );
}
vkBuffers.reserve( buffers.size() );
for( auto&& buffer : buffers )
{
- vkBuffers.emplace_back( buffer->GetVkBuffer() );
+ vkBuffers.emplace_back(buffer->GetVkHandle() );
PushResource( buffer );
}
"The buffer used as index buffer has wrong usage flags!" );
PushResource( buffer );
- mCommandBuffer.bindIndexBuffer( buffer->GetVkBuffer(), offset, indexType );
+ mCommandBuffer.bindIndexBuffer(buffer->GetVkHandle(), offset, indexType );
}
void BindGraphicsPipeline( Handle<Pipeline> pipeline )
{
PushResource( pipeline );
mCurrentPipeline = pipeline;
- mCommandBuffer.bindPipeline( vk::PipelineBindPoint::eGraphics, pipeline->GetVkPipeline() );
+ mCommandBuffer.bindPipeline( vk::PipelineBindPoint::eGraphics, pipeline->GetVkHandle() );
}
void BindDescriptorSets( std::vector<Dali::Graphics::Vulkan::Handle<DescriptorSet>> descriptorSets,
auto swapchain = mGraphics.GetSwapchainForFBID( 0u );
auto surface = mGraphics.GetSurface( 0u );
auto frameBuffer = swapchain->GetCurrentFramebuffer();
- auto renderPass = frameBuffer->GetVkRenderPass();
+ auto renderPass = frameBuffer->GetRenderPassVkHandle();
auto clearValues = frameBuffer->GetDefaultClearValues();
auto info = vk::RenderPassBeginInfo{};
- info.setFramebuffer( frameBuffer->GetVkFramebuffer() );
+ info.setFramebuffer(frameBuffer->GetVkHandle() );
info.setRenderPass( renderPass );
info.setClearValueCount( U32( clearValues.size() ) );
info.setPClearValues( clearValues.data() );
PushResource( srcBuffer );
PushResource( dstImage );
- mCommandBuffer.copyBufferToImage( srcBuffer->GetVkBuffer(), dstImage->GetVkImage(), dstLayout, regions );
+ mCommandBuffer.copyBufferToImage(srcBuffer->GetVkHandle(), dstImage->GetVkHandle(), dstLayout, regions );
}
vk::ImageMemoryBarrier ImageLayoutTransitionBarrier( ImageRef image,
{
return vk::ImageMemoryBarrier{}
.setNewLayout( newLayout )
- .setImage( image->GetVkImage() )
+ .setImage(image->GetVkHandle() )
.setOldLayout( oldLayout )
.setSrcAccessMask( srcAccessMask )
.setDstAccessMask( dstAccessMask )
auto allocateInfo = vk::CommandBufferAllocateInfo{}
.setCommandBufferCount( U32(diff) )
- .setCommandPool( mOwner.GetPool() )
+ .setCommandPool(mOwner.GetVkHandle() )
.setLevel( mIsPrimary ? vk::CommandBufferLevel::ePrimary : vk::CommandBufferLevel::eSecondary );
auto newBuffers = AllocateVkCommandBuffers( allocateInfo );
CommandPool::~CommandPool() = default;
-vk::CommandPool CommandPool::GetPool() const
+vk::CommandPool CommandPool::GetVkHandle() const
{
return mImpl->mCommandPool;
}
*
* @return
*/
- vk::CommandPool GetPool() const;
+ vk::CommandPool GetVkHandle() const;
/**
*
DescriptorPool::~DescriptorPool() = default;
-vk::DescriptorPool DescriptorPool::GetVkDescriptorPool() const
+vk::DescriptorPool DescriptorPool::GetVkHandle() const
{
return mImpl->mVkDescriptorPool;
}
if(mVkDescriptorSet)
{
// TODO: @todo non freeable!!!
- //mGraphics.GetDevice().freeDescriptorSets( mPool.GetVkDescriptorPool(), 1, &mVkDescriptorSet );
+ //mGraphics.GetDevice().freeDescriptorSets( mPool.GetVkHandle(), 1, &mVkDescriptorSet );
}
}
auto bufferInfo = vk::DescriptorBufferInfo{}
.setOffset( U32(offset) )
.setRange( U32(size) )
- .setBuffer( buffer->GetVkBuffer() );
+ .setBuffer(buffer->GetVkHandle() );
auto write = vk::WriteDescriptorSet{}.setPBufferInfo( &bufferInfo )
.setDescriptorType( vk::DescriptorType::eUniformBuffer )
auto imageViewInfo = vk::DescriptorImageInfo{}
.setImageLayout( vk::ImageLayout::eShaderReadOnlyOptimal )
.setImageView( imageView->GetVkImageView() )
- .setSampler( sampler->GetVkSampler() );
+ .setSampler(sampler->GetVkHandle() );
auto write = vk::WriteDescriptorSet{}.setPImageInfo( &imageViewInfo )
.setDescriptorType( vk::DescriptorType::eCombinedImageSampler )
~DescriptorPool() override;
- vk::DescriptorPool GetVkDescriptorPool() const;
+ vk::DescriptorPool GetVkHandle() const;
std::vector<DescriptorSetHandle> AllocateDescriptorSets( vk::DescriptorSetAllocateInfo allocateInfo );
mImpl->Commit();
}
-vk::RenderPass Framebuffer::GetVkRenderPass() const
+vk::RenderPass Framebuffer::GetRenderPassVkHandle() const
{
return mImpl->mVkRenderPass;
}
-vk::Framebuffer Framebuffer::GetVkFramebuffer() const
+vk::Framebuffer Framebuffer::GetVkHandle() const
{
return mImpl->mVkFramebuffer;
}
void Commit();
- vk::RenderPass GetVkRenderPass() const;
+ vk::RenderPass GetRenderPassVkHandle() const;
- vk::Framebuffer GetVkFramebuffer() const;
+ vk::Framebuffer GetVkHandle() const;
const std::vector<vk::ClearValue>& GetDefaultClearValues() const;
mSampler->SetFilter( vk::Filter::eLinear, vk::Filter::eLinear );
mSampler->SetMipmapMode( vk::SamplerMipmapMode::eLinear );
- mSampler->GetVkSampler();
+ mSampler->GetVkHandle();
}
SamplerRef GetSampler() const
#include <dali/graphics/vulkan/vulkan-framebuffer.h>
#include <dali/graphics/vulkan/api/vulkan-api-controller.h>
#include <dali/graphics/vulkan/vulkan-pipeline-cache.h>
+#include <dali/graphics/vulkan/vulkan-sampler.h>
+#include <dali/graphics/vulkan/vulkan-resource-cache.h>
#include <dali/graphics-api/graphics-api-controller.h>
assert(!mSurfaceFBIDMap.empty() &&
"At least one surface has to be created before creating VkDevice!");
- auto queueInfos = std::vector< vk::DeviceQueueCreateInfo >{};
+ std::vector< vk::DeviceQueueCreateInfo > queueInfos{};
constexpr uint8_t MAX_QUEUE_TYPES = 3;
// find suitable family for each type of queue
info.setPQueuePriorities( priorities.data() );
}
- auto extensions = std::vector< const char* >{VK_KHR_SWAPCHAIN_EXTENSION_NAME};
+ std::vector< const char* > extensions{VK_KHR_SWAPCHAIN_EXTENSION_NAME};
auto info = vk::DeviceCreateInfo{};
info.setEnabledExtensionCount(U32(extensions.size()))
}
mPipelineDatabase = std::make_unique<PipelineCache>( *this );
+ mResourceCache = MakeUnique<ResourceCache>();
}
vk::Device Graphics::GetDevice() const
// this will change in the future
assert(index == 0u && "Each type of queue may use only one, indices greater than 0 are invalid!");
- return *mGraphicsQueues[0].get(); // will be mGraphicsQueues[index]
+ return *mGraphicsQueues[0]; // will be mGraphicsQueues[index]
}
Queue& Graphics::GetTransferQueue(uint32_t index) const
// this will change in the future
assert(index == 0u && "Each type of queue may use only one, indices greater than 0 are invalid!");
- return *mTransferQueues[0].get(); // will be mGraphicsQueues[index]
+ return *mTransferQueues[0]; // will be mGraphicsQueues[index]
}
Queue& Graphics::GetComputeQueue(uint32_t index) const
// this will change in the future
assert(index == 0u && "Each type of queue may use only one, indices greater than 0 are invalid!");
- return *mComputeQueues[0].get(); // will be mGraphicsQueues[index]
+ return *mComputeQueues[0]; // will be mGraphicsQueues[index]
}
Queue& Graphics::GetPresentQueue() const
void Graphics::AddBuffer( Handle<Buffer> buffer )
{
- mBuffersCache.push_back( buffer );
+ mResourceCache->AddBuffer(std::move(buffer));
}
void Graphics::AddImage( Handle<Image> image )
{
- mImageCache.push_back( image );
+ mResourceCache->AddImage(std::move(image));
}
void Graphics::AddPipeline( Handle<Pipeline> pipeline )
{
- mPipelineCache.push_back( pipeline );
+ mResourceCache->AddPipeline(std::move(pipeline));
}
void Graphics::AddShader( Handle<Shader> shader )
{
- mShaderCache.push_back( shader );
+ mResourceCache->AddShader(std::move(shader));
}
void Graphics::AddCommandPool( Handle<CommandPool> pool )
{
- mCommandPoolCache.push_back( pool );
+ mResourceCache->AddCommandPool(std::move(pool));
}
void Graphics::AddDescriptorPool( Handle<DescriptorPool> pool )
{
- mDescriptorPoolCache.push_back( pool );
+ mResourceCache->AddDescriptorPool(std::move(pool));
}
void Graphics::AddFramebuffer( Handle<Framebuffer> framebuffer )
{
- mFramebufferCache.push_back( framebuffer );
+ mResourceCache->AddFramebuffer(std::move(framebuffer));
}
void Graphics::RemoveBuffer( Buffer& buffer )
{
- auto index = 0u;
- for( auto&& iter : mBuffersCache )
- {
- if( &*iter == &buffer )
- {
- iter.Reset();
- mBuffersCache.erase( mBuffersCache.begin()+index );
- return;
- }
- }
+ mResourceCache->RemoveBuffer(buffer);
}
void Graphics::RemoveShader( Shader& shader )
{
- auto index = 0u;
- for( auto&& iter : mShaderCache )
- {
- if( &*iter == &shader )
- {
- iter.Reset();
- mShaderCache.erase( mShaderCache.begin()+index );
- return;
- }
- ++index;
- }
+ mResourceCache->RemoveShader(shader);
}
void Graphics::RemoveCommandPool( CommandPool& commandPool )
{
- NotImplemented();
+ mResourceCache->RemoveCommandPool(commandPool);
+}
+
+void Graphics::RemoveDescriptorPool( DescriptorPool& pool )
+{
+ mResourceCache->RemoveDescriptorPool(pool);
}
-void Graphics::RemoveDescriptorPool( std::unique_ptr<DescriptorPool> pool )
+void Graphics::RemoveFramebuffer( Framebuffer& framebuffer )
{
- NotImplemented();
+ mResourceCache->RemoveFramebuffer(framebuffer);
+}
+
+void Graphics::RemoveSampler( Sampler& sampler )
+{
+ mResourceCache->RemoveSampler(sampler);
}
ShaderRef Graphics::FindShader( vk::ShaderModule shaderModule )
{
- for( auto&& iter : mShaderCache )
- {
- if( iter->GetVkShaderModule() == shaderModule )
- {
- return Handle<Shader>(&*iter);
- }
- }
- return Handle<Shader>();
+ return mResourceCache->FindShader(shaderModule);
}
ImageRef Graphics::FindImage( vk::Image image )
{
- for( auto&& iter : mImageCache )
- {
- if( iter->GetVkImage() == image )
- {
- return ImageRef(&*iter);
- }
- }
- return ImageRef();
+ return mResourceCache->FindImage(image);
}
-
} // namespace Vulkan
} // namespace Graphics
} // namespace Dali
class DescriptorPool;
class GpuMemoryManager;
class PipelineCache;
+class ResourceCache;
struct SwapchainSurfacePair
{
void RemoveBuffer( Buffer& buffer );
void RemoveShader( Shader& shader );
void RemoveCommandPool( CommandPool& commandPool );
- void RemoveDescriptorPool( std::unique_ptr<DescriptorPool> pool );
-
-private:
- std::vector<BufferRef> mBuffersCache;
- std::vector<ImageRef> mImageCache;
- std::vector<PipelineRef> mPipelineCache;
- std::vector<ShaderRef> mShaderCache;
- std::vector<CommandPoolRef> mCommandPoolCache;
- std::vector<DescriptorPoolRef> mDescriptorPoolCache;
- std::vector<FramebufferRef> mFramebufferCache;
+ void RemoveDescriptorPool( DescriptorPool& pool );
+ void RemoveFramebuffer( Framebuffer& framebuffer );
+ void RemoveSampler( Sampler& sampler );
private:
std::unique_ptr<Dali::Graphics::API::Controller> mGfxController;
// TODO: rename
std::unique_ptr<PipelineCache> mPipelineDatabase;
+ std::unique_ptr<ResourceCache> mResourceCache;
public:
PipelineCache& GetPipelineCache()
{
- return *mPipelineDatabase.get();
+ return *mPipelineDatabase;
}
};
mImpl = MakeUnique<Impl>( *this, graphics, createInfo, externalImage );
}
-vk::Image Image::GetVkImage() const
+vk::Image Image::GetVkHandle() const
{
return mImpl->mVkImage;
}
.setFormat( image->GetVkFormat() )
.setSubresourceRange(subresourceRange)
.setComponents( componentsMapping )
- .setImage( image->GetVkImage() )));
+ .setImage(image->GetVkHandle() )));
if(!retval->mImpl->Initialise())
{
return ImageViewRef();
* Returns underlying Vulkan object
* @return
*/
- vk::Image GetVkImage() const;
+ vk::Image GetVkHandle() const;
/**
* Returns VkImageLayout associated with the image
operator InternalVkImage() const
{
- return GetVkImage();
+ return GetVkHandle();
}
private:
{
- Impl( Vulkan::Graphics& graphics, const vk::GraphicsPipelineCreateInfo& info ) :
- mInfo( info ),
+ Impl( Vulkan::Graphics& graphics, vk::GraphicsPipelineCreateInfo info ) :
+ mInfo( std::move(info) ),
mGraphics( graphics )
{
};
*
* @return
*/
- vk::Pipeline GetVkPipeline() const
+ vk::Pipeline GetVkHandle() const
{
return mPipeline;
}
// in place of swapchain structures!
if( !mInfo.renderPass )
{
- SetRenderPass( mGraphics.GetSwapchainForFBID(0u)->
- GetCurrentFramebuffer()->GetVkRenderPass());
+ SetRenderPass(mGraphics.GetSwapchainForFBID(0u)->
+ GetCurrentFramebuffer()->GetRenderPassVkHandle());
}
if(!mInfo.pRasterizationState)
mImpl = MakeUnique<Pipeline::Impl>( graphics, info );
}
-vk::Pipeline Pipeline::GetVkPipeline() const
+vk::Pipeline Pipeline::GetVkHandle() const
{
- return mImpl->GetVkPipeline();
+ return mImpl->GetVkHandle();
}
bool Pipeline::OnDestroy()
* Returns Vulkan VkPipeline object associated with Pipeline
* @return
*/
- vk::Pipeline GetVkPipeline() const;
+ vk::Pipeline GetVkHandle() const;
/**
* Returns Vulkan VkPipelineLayout object associated with Pipeline
#include <dali/graphics/vulkan/vulkan-shader.h>
#include <dali/graphics/vulkan/vulkan-descriptor-set.h>
#include <dali/graphics/vulkan/vulkan-framebuffer.h>
+#include <dali/graphics/vulkan/vulkan-command-pool.h>
+#include <dali/graphics/vulkan/vulkan-sampler.h>
#include <algorithm>
{
auto iterator = std::find_if(mPipelines.begin(),
mPipelines.end(),
- [&](const PipelineRef entry) { return &*entry == pipeline; });
+ [&](const PipelineRef entry) { return entry->GetVkHandle() == pipeline; });
return iterator == mPipelines.end() ? PipelineRef() : PipelineRef(&**iterator);
}
{
auto iterator = std::find_if(mShaders.begin(),
mShaders.end(),
- [&](const ShaderRef entry) { return &*entry == shaderModule; });
+ [&](const ShaderRef entry) { return entry->GetVkHandle() == shaderModule; });
return iterator == mShaders.end() ? ShaderRef() : ShaderRef(&**iterator);
}
{
auto iterator = std::find_if(mCommandPools.begin(),
mCommandPools.end(),
- [&](const CommandPoolRef entry) { return &*entry == commandPool; });
+ [&](const CommandPoolRef entry) { return entry->GetVkHandle() == commandPool; });
return iterator == mCommandPools.end() ? CommandPoolRef() : CommandPoolRef(&**iterator);
}
{
auto iterator = std::find_if(mDescriptorPools.begin(),
mDescriptorPools.end(),
- [&](const DescriptorPoolRef entry) { return &*entry == descriptorPool; });
+ [&](const DescriptorPoolRef entry) { return entry->GetVkHandle() == descriptorPool; });
return iterator == mDescriptorPools.end() ? DescriptorPoolRef() : DescriptorPoolRef(&**iterator);
}
{
auto iterator = std::find_if(mFramebuffers.begin(),
mFramebuffers.end(),
- [&](const FramebufferRef entry) { return &*entry == framebuffer; });
+ [&](const FramebufferRef entry) { return entry->GetVkHandle() == framebuffer; });
return iterator == mFramebuffers.end() ? FramebufferRef() : FramebufferRef(&**iterator);
}
{
auto iterator = std::find_if(mSamplers.begin(),
mSamplers.end(),
- [&](const SamplerRef entry) { return &*entry == sampler; });
+ [&](const SamplerRef entry) { return entry->GetVkHandle() == sampler; });
return iterator == mSamplers.end() ? SamplerRef() : SamplerRef(&**iterator);
}
{
auto iterator = std::find_if(mBuffers.begin(),
mBuffers.end(),
- [&](const BufferRef entry) { return &*entry == buffer; });
+ [&](const BufferRef entry) { return entry->GetVkHandle() == buffer; });
return iterator == mBuffers.end() ? BufferRef() : BufferRef(&**iterator);
}
{
auto iterator = std::find_if(mImages.begin(),
mImages.end(),
- [&](const ImageRef entry) { return &*entry == image; });
+ [&](const ImageRef entry) { return entry->GetVkHandle() == image; });
return iterator == mImages.end() ? ImageRef() : ImageRef(&**iterator);
}
mShaders.end(),
[&](const ShaderRef entry) { return &*entry == &shader; });
- std::iter_swap(iterator, std::prev(mShaders.end());
+ std::iter_swap(iterator, std::prev(mShaders.end()));
mShaders.back().Reset();
mShaders.pop_back();
}
return *this;
}
-ResourceCache& ResourceCache::RemoveDescriptorPool( std::unique_ptr<DescriptorPool> descriptorPool )
+ResourceCache& ResourceCache::RemoveDescriptorPool( DescriptorPool& descriptorPool )
{
if( !mDescriptorPools.empty() )
{
auto iterator = std::find_if(mDescriptorPools.begin(),
mDescriptorPools.end(),
- [&](const DescriptorPoolRef entry) { return &*entry == &*descriptorPool; });
+ [&](const DescriptorPoolRef entry) { return &*entry == &descriptorPool; });
std::iter_swap(iterator, std::prev(mDescriptorPools.end()));
mDescriptorPools.back().Reset();
* @param descriptorPool The DescriptorPool to be removed
* @return A reference to the ResourceCache
*/
- ResourceCache& RemoveDescriptorPool( std::unique_ptr<DescriptorPool> descriptorPool );
+ ResourceCache& RemoveDescriptorPool( DescriptorPool& descriptorPool );
/**
* Removes the specified Framebuffer from the cache
*/
ResourceCache& RemoveSampler( Sampler& sampler );
+ ResourceCache() = default;
// The cache should not be copyable
ResourceCache( const ResourceCache& other ) = delete;
mImpl->mModified = true;
}
-vk::Sampler Sampler::GetVkSampler() const
+vk::Sampler Sampler::GetVkHandle() const
{
// if no sampler yet, create it now
if( mImpl->mModified )
* Returns VkSampler object
* @return
*/
- vk::Sampler GetVkSampler() const;
+ vk::Sampler GetVkHandle() const;
private:
return vk::Result::eErrorInitializationFailed;
}
- vk::ShaderModule GetVkShaderModule() const
+ vk::ShaderModule GetVkHandle() const
{
return mShaderModule;
}
Shader::~Shader() = default;
-vk::ShaderModule Shader::GetVkShaderModule() const
+vk::ShaderModule Shader::GetVkHandle() const
{
- return mImpl->GetVkShaderModule();
+ return mImpl->GetVkHandle();
}
bool Shader::OnDestroy()
static Handle<Shader> New( Graphics& graphics, const vk::ShaderModuleCreateInfo& info );
/**
- * Creates new shader module from SPIRV code
+ * Creates new shader module from SPIR-V code
* @param graphics
* @param bytes
* @param size
*/
~Shader() override;
- vk::ShaderModule GetVkShaderModule() const;
+ vk::ShaderModule GetVkHandle() const;
const SpirV::SPIRVShader& GetSPIRVReflection() const;
operator vk::ShaderModule() const
{
- return GetVkShaderModule();
+ return GetVkHandle();
}
/**
.setFormat(vk::Format::eR32G32B32A32Sfloat)
.setComponents(vk::ComponentMapping(
vk::ComponentSwizzle::eR, vk::ComponentSwizzle::eG, vk::ComponentSwizzle::eB, vk::ComponentSwizzle::eA))
- .setImage(image->GetVkImage())
+ .setImage(image->GetVkHandle())
.setSubresourceRange(vk::ImageSubresourceRange{}
.setLayerCount(1)
.setLevelCount(1)
for( auto&& colorImageView : colorImages )
{
auto image = colorImageView->GetImage();
- auto vkImage = image->GetVkImage();
+ auto vkImage = image->GetVkHandle();
vk::ImageSubresourceRange range;
range.setLayerCount( image->GetLayerCount() )
if( depthStencilImage )
{
auto image = depthStencilImage->GetImage();
- auto vkImage = image->GetVkImage();
+ auto vkImage = image->GetVkHandle();
vk::ImageSubresourceRange range;
range.setLayerCount( image->GetLayerCount() )
// start recording
auto inheritanceInfo = vk::CommandBufferInheritanceInfo{}
- .setFramebuffer( swapBuffer.framebuffer->GetVkFramebuffer() )
- .setRenderPass(swapBuffer.framebuffer->GetVkRenderPass())
+ .setFramebuffer(swapBuffer.framebuffer->GetVkHandle() )
+ .setRenderPass(swapBuffer.framebuffer->GetRenderPassVkHandle())
.setSubpass( 0 );
swapBuffer.masterCmdBuffer->Reset();
swapBuffer.masterCmdBuffer->Begin( vk::CommandBufferUsageFlagBits::eRenderPassContinue, &inheritanceInfo );
auto& currentBuffer = mSwapchainBuffer[mCurrentBufferIndex];
vk::RenderPassBeginInfo rpInfo{};
- rpInfo.setRenderPass( currentBuffer.framebuffer->GetVkRenderPass() )
- .setFramebuffer( currentBuffer.framebuffer->GetVkFramebuffer() )
+ rpInfo.setRenderPass(currentBuffer.framebuffer->GetRenderPassVkHandle() )
+ .setFramebuffer(currentBuffer.framebuffer->GetVkHandle() )
.setPClearValues( currentBuffer.framebuffer->GetDefaultClearValues().data() )
.setClearValueCount( U32( currentBuffer.framebuffer->GetDefaultClearValues().size() ) )
.setRenderArea( vk::Rect2D( {0, 0}, mSurface->GetSize() ) );