FCT
载入中...
搜索中...
未找到
FCT::VK_Context类 参考

#include <VK_Context.h>

类 FCT::VK_Context 继承关系图:
Inheritance graph
FCT::VK_Context 的协作图:
Collaboration graph

Public 成员函数

 VK_Context (VK_ContextCommon *common)
 ~VK_Context () override
RHI::RasterizationPipelinecreateTraditionPipeline () override
uint32_t findMemoryType (uint32_t typeFilter, vk::MemoryPropertyFlags properties)
void createPlatform () override
auto device ()
auto getDevice () const
auto getPhysicalDevice () const
vk::Instance getVkInstance ()
void beginCommandBuffer (int index)
void endCommandBuffer (int index)
void submitCommandBuffer ()
void clear (Vec4 color, float depth=1.0, float stencil=0.0)
uint32_t getGraphicsQueueFamily () const
void createTransferCommandPool ()
vk::CommandBuffer beginSingleTimeTransferCommands ()
void endSingleTimeTransferCommands (vk::CommandBuffer commandBuffer, vk::Fence *outFence)
vk::Queue getGraphicsQueue ()
vk::CommandBuffer beginSingleTimeCommands ()
void endSingleTimeCommands (vk::CommandBuffer commandBuffer)
void transferDataToBuffer (vk::Buffer dstBuffer, size_t size, const void *data)
void transferDataToImage (vk::Image dstImage, uint32_t width, uint32_t height, vk::Format format, const void *data, size_t dataSize, vk::Fence *outFence=nullptr, std::function< void()> *cleanUpCallback=nullptr)
void transferDataToImage (vk::Image dstImage, uint32_t width, uint32_t height, uint32_t depth, vk::Format format, uint32_t mipLevels, uint32_t arrayLayers, vk::ImageAspectFlags aspectMask, const void *data, size_t dataSize, vk::Fence *outFence=nullptr, std::function< void()> *cleanUpCallback=nullptr)
template<typename T>
T * createResource ()
StaticMesh< uint32_t > * createMesh (const ModelMesh *modelMesh, const VertexLayout &layout)
StaticMesh< uint32_t > * loadMesh (const std::string &filename, const std::string &meshName, const VertexLayout &layout)
ImageloadTexture (const std::string &filename)
void submitThread ()
void maxFrameInFlight (uint32_t maxFrameInFlight)
uint32_t maxFrameInFlight () const
uint32_t currentSubmitFrameIndex () const
uint32_t currentFrameIndex ()
RHI::DescriptorPoolgetDescriptorPool ()
uint32_t currentLogicFrameIndex () const
void addRef ()
void release ()
size_t count ()
 operator bool () const
void trigger (const Event &event)
void enqueue (Event &&event)
void update ()
void updateAll ()
SubscribeId subscribe (Func &&func)
void unsubscribe (SubscribeId subscribeId)
void unsubscribeAll ()
初始化与配置 (Initialization & Configuration)
void create (ContextCreateFlags flag=ContextCreateFlag::defaultConfig)
模块管理 (Module Management)
template<typename T>
void addModule ()
template<typename T>
void removeModule ()
template<typename T>
T * getModule ()
流程控制
auto & syncTickers ()
auto & submitTickers ()
void flush ()
窗口管理 (Window Management)
const std::vector< Window * > & getBindWindows ()
void onWindowBound (Window *wnd)
着色器编译 (Shader Compilation)
void createCompiler ()
ShaderCompilergetCompiler ()
ShaderGeneratorgetGenerator ()
SubmitThread内部实现接口

以_开头的函数供自定义或内部使用

void _nextFrame ()
void _currentFlush ()
constexpr void _waitCurrentFlush ()
constexpr void _waitForNextFrame ()
void advanceLogicFrame ()
void advanceSubmitFrame ()

Protected 成员函数

void postLogicTask (const std::function< void()> &task)
virtual void deleteThis ()

Protected 属性

boost::lockfree::queue< LogicTaskData *, boost::lockfree::capacity< 1024 > > m_logicTask
FlowControlm_flowControl
Devicem_resourceDevice
ModelLoaderm_modelLoader
RenderGraphm_renderGraph
ImageLoaderm_imageLoader
ResourceManagerm_resourceManager
ShaderCompilerm_compiler
ShaderGeneratorm_generator
CommandBufferGraphm_cmdGraph
SubmitTicker m_ticker
std::vector< Window * > m_bindWindows
bool m_nextFrame
bool m_currentFlush
std::thread m_submitThread
bool m_ctxRunning
uint32_t m_maxFrameInFlight
RHI::DescriptorPoolm_descriptorPool
size_t m_frameIndex = 0
size_t m_logicFrameIndex = 0
size_t m_submitFrameIndex = 0
std::thread::id m_submitThreadId
std::atomic< size_t > m_refCount

Private 成员函数

void createCommandPoolAndBuffers ()

静态 Private 成员函数

static constexpr auto getEventTypeId ()

Private 属性

VK_ContextCommonm_common
uint32_t m_graphicsQueueFamilyIndex
vk::Device m_device
vk::PhysicalDevice m_phyDevice
vk::Queue m_graphicsQueue
vk::CommandPool m_commandPool
std::vector< vk::CommandBuffer > m_commandBuffers
uint32_t m_transferQueueFamilyIndex
vk::Queue m_transferQueue
vk::CommandPool m_transferCommandPool
std::conditional_t< EventSystemConfig::TriggerOnly::EventAsData, std::unordered_map< entt::id_type, std::unordered_map< SubscribeId, std::unique_ptr< IEventHandler > > >, std::unordered_map< entt::id_type, std::unordered_map< SubscribeId, std::unique_ptr< IEventIdentifierHandler > > > > m_handlers
std::conditional_t< EventSystemConfig::TriggerOnly::EnableQueue, std::unordered_map< entt::id_type, std::vector< std::function< void()> > >, std::monostate > m_eventQueue
SubscribeId m_nextSubscribeId

详细描述

在文件 VK_Context.h11 行定义.

构造及析构函数说明

◆ VK_Context()

FCT::VK_Context::VK_Context ( VK_ContextCommon * common)

在文件 VK_Context.cpp34 行定义.

函数调用图:

◆ ~VK_Context()

FCT::VK_Context::~VK_Context ( )
override

在文件 VK_Context.cpp22 行定义.

成员函数说明

◆ _currentFlush()

void FCT::Context::_currentFlush ( )
inherited

在文件 Context.cpp14 行定义.

这是这个函数的调用关系图:

◆ _nextFrame()

void FCT::Context::_nextFrame ( )
inherited

在文件 Context.cpp10 行定义.

这是这个函数的调用关系图:

◆ _waitCurrentFlush()

void FCT::Context::_waitCurrentFlush ( )
inlineconstexprinherited

在文件 Context.h184 行定义.

这是这个函数的调用关系图:

◆ _waitForNextFrame()

void FCT::Context::_waitForNextFrame ( )
inlineconstexprinherited

在文件 Context.h188 行定义.

这是这个函数的调用关系图:

◆ addModule()

template<typename T>
void FCT::Context::addModule ( )
inherited

在文件 Context.h275 行定义.

这是这个函数的调用关系图:

◆ addRef()

void FCT::RefCount::addRef ( )
inlineinherited

在文件 RefCount.h10 行定义.

这是这个函数的调用关系图:

◆ advanceLogicFrame()

void FCT::Context::advanceLogicFrame ( )
inlineinherited

在文件 Context.h192 行定义.

这是这个函数的调用关系图:

◆ advanceSubmitFrame()

void FCT::Context::advanceSubmitFrame ( )
inlineinherited

在文件 Context.h196 行定义.

这是这个函数的调用关系图:

◆ beginCommandBuffer()

void FCT::VK_Context::beginCommandBuffer ( int index)

在文件 VK_Context.cpp520 行定义.

◆ beginSingleTimeCommands()

vk::CommandBuffer FCT::VK_Context::beginSingleTimeCommands ( )

在文件 VK_Context.cpp141 行定义.

这是这个函数的调用关系图:

◆ beginSingleTimeTransferCommands()

vk::CommandBuffer FCT::VK_Context::beginSingleTimeTransferCommands ( )

在文件 VK_Context.cpp104 行定义.

这是这个函数的调用关系图:

◆ clear()

void FCT::VK_Context::clear ( Vec4 color,
float depth = 1.0,
float stencil = 0.0 )
inline

在文件 VK_Context.h35 行定义.

◆ count()

size_t FCT::RefCount::count ( )
inlineinherited

在文件 RefCount.h19 行定义.

这是这个函数的调用关系图:

◆ create()

void FCT::Context::create ( ContextCreateFlags flag = ContextCreateFlag::defaultConfig)
inherited

在文件 Context.cpp131 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ createCommandPoolAndBuffers()

void FCT::VK_Context::createCommandPoolAndBuffers ( )
private

在文件 VK_Context.cpp176 行定义.

这是这个函数的调用关系图:

◆ createCompiler()

void FCT::Context::createCompiler ( )
inherited

在文件 runtime.cpp8 行定义.

这是这个函数的调用关系图:

◆ createMesh()

StaticMesh< uint32_t > * FCT::Context::createMesh ( const ModelMesh * modelMesh,
const VertexLayout & layout )
inherited

在文件 Context.cpp144 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ createPlatform()

void FCT::VK_Context::createPlatform ( )
overridevirtual

实现了 FCT::Context.

在文件 VK_Context.cpp499 行定义.

◆ createResource()

template<typename T>
T * FCT::Context::createResource ( )
inlineinherited

在文件 Context.hpp38 行定义.

这是这个函数的调用关系图:

◆ createTraditionPipeline()

RHI::RasterizationPipeline * FCT::VK_Context::createTraditionPipeline ( )
overridevirtual

实现了 FCT::Context.

在文件 VK_Context.cpp17 行定义.

◆ createTransferCommandPool()

void FCT::VK_Context::createTransferCommandPool ( )

在文件 VK_Context.cpp96 行定义.

这是这个函数的调用关系图:

◆ currentFrameIndex()

uint32_t FCT::Context::currentFrameIndex ( )
inlineinherited

在文件 Context.h255 行定义.

◆ currentLogicFrameIndex()

uint32_t FCT::Context::currentLogicFrameIndex ( ) const
inlineinherited

在文件 Context.h265 行定义.

◆ currentSubmitFrameIndex()

uint32_t FCT::Context::currentSubmitFrameIndex ( ) const
inlineinherited

在文件 Context.h246 行定义.

◆ deleteThis()

virtual void FCT::RefCount::deleteThis ( )
inlineprotectedvirtualinherited

FCT::RHI::Fence , 以及 FCT::RHI::Semaphore 重载.

在文件 RefCount.h27 行定义.

这是这个函数的调用关系图:

◆ device()

auto FCT::VK_Context::device ( )
inline

在文件 VK_Context.h19 行定义.

◆ endCommandBuffer()

void FCT::VK_Context::endCommandBuffer ( int index)

在文件 VK_Context.cpp527 行定义.

◆ endSingleTimeCommands()

void FCT::VK_Context::endSingleTimeCommands ( vk::CommandBuffer commandBuffer)

在文件 VK_Context.cpp157 行定义.

这是这个函数的调用关系图:

◆ endSingleTimeTransferCommands()

void FCT::VK_Context::endSingleTimeTransferCommands ( vk::CommandBuffer commandBuffer,
vk::Fence * outFence )

在文件 VK_Context.cpp119 行定义.

这是这个函数的调用关系图:

◆ enqueue()

void FCT::IEventSystem< EventSystemConfig::TriggerOnly >::enqueue ( Event && event)
inlineinherited

在文件 IEventSystem.h138 行定义.

◆ findMemoryType()

uint32_t FCT::VK_Context::findMemoryType ( uint32_t typeFilter,
vk::MemoryPropertyFlags properties )

在文件 VK_Context.cpp504 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ flush()

void FCT::Context::flush ( )
inlineinherited

在文件 Context.hpp15 行定义.

函数调用图:

◆ getBindWindows()

const std::vector< Window * > & FCT::Context::getBindWindows ( )
inlineinherited

在文件 Context.h162 行定义.

◆ getCompiler()

ShaderCompiler * FCT::Context::getCompiler ( )
inlineinherited

在文件 Context.h174 行定义.

◆ getDescriptorPool()

RHI::DescriptorPool * FCT::Context::getDescriptorPool ( )
inlineinherited

在文件 Context.hpp32 行定义.

◆ getDevice()

auto FCT::VK_Context::getDevice ( ) const
inline

在文件 VK_Context.h23 行定义.

◆ getEventTypeId()

constexpr auto FCT::IEventSystem< EventSystemConfig::TriggerOnly >::getEventTypeId ( )
inlinestaticconstexprprivateinherited

在文件 IEventSystem.h49 行定义.

◆ getGenerator()

ShaderGenerator * FCT::Context::getGenerator ( )
inlineinherited

在文件 Context.h175 行定义.

◆ getGraphicsQueue()

vk::Queue FCT::VK_Context::getGraphicsQueue ( )
inline

在文件 VK_Context.h43 行定义.

◆ getGraphicsQueueFamily()

uint32_t FCT::VK_Context::getGraphicsQueueFamily ( ) const

在文件 VK_Context.cpp93 行定义.

◆ getModule()

template<typename T>
T * FCT::Context::getModule ( )
inherited

在文件 Context.h305 行定义.

这是这个函数的调用关系图:

◆ getPhysicalDevice()

auto FCT::VK_Context::getPhysicalDevice ( ) const
inline

在文件 VK_Context.h26 行定义.

这是这个函数的调用关系图:

◆ getVkInstance()

vk::Instance FCT::VK_Context::getVkInstance ( )

在文件 VK_Context.cpp516 行定义.

◆ loadMesh()

StaticMesh< uint32_t > * FCT::Context::loadMesh ( const std::string & filename,
const std::string & meshName,
const VertexLayout & layout )
inherited

在文件 Context.cpp171 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ loadTexture()

Image * FCT::Context::loadTexture ( const std::string & filename)
inherited

在文件 Context.cpp19 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ maxFrameInFlight() [1/2]

uint32_t FCT::Context::maxFrameInFlight ( ) const
inlineinherited

在文件 Context.h245 行定义.

这是这个函数的调用关系图:

◆ maxFrameInFlight() [2/2]

void FCT::Context::maxFrameInFlight ( uint32_t maxFrameInFlight)
inlineinherited
参数
maxFrameInFlightcpu可以比gpu快多少帧
注解
必须在渲染之前调用

在文件 Context.hpp26 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ onWindowBound()

void FCT::Context::onWindowBound ( Window * wnd)
inlineinherited

在文件 Context.h163 行定义.

函数调用图:

◆ operator bool()

FCT::RefCount::operator bool ( ) const
inlineinherited

在文件 RefCount.h22 行定义.

◆ postLogicTask()

void FCT::Context::postLogicTask ( const std::function< void()> & task)
inlineprotectedinherited

在文件 Context.h151 行定义.

这是这个函数的调用关系图:

◆ release()

void FCT::RefCount::release ( )
inlineinherited

在文件 RefCount.h13 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ removeModule()

template<typename T>
void FCT::Context::removeModule ( )
inherited

在文件 Context.h292 行定义.

这是这个函数的调用关系图:

◆ submitCommandBuffer()

void FCT::VK_Context::submitCommandBuffer ( )

在文件 VK_Context.cpp530 行定义.

◆ submitThread()

void FCT::Context::submitThread ( )
inlineinherited

在文件 Context.hpp7 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ submitTickers()

auto & FCT::Context::submitTickers ( )
inlineinherited

在文件 Context.h142 行定义.

◆ subscribe()

SubscribeId FCT::IEventSystem< EventSystemConfig::TriggerOnly >::subscribe ( Func && func)
inlineinherited

在文件 IEventSystem.h192 行定义.

◆ syncTickers()

auto & FCT::Context::syncTickers ( )
inlineinherited

在文件 Context.h137 行定义.

◆ transferDataToBuffer()

void FCT::VK_Context::transferDataToBuffer ( vk::Buffer dstBuffer,
size_t size,
const void * data )

在文件 VK_Context.cpp195 行定义.

函数调用图:

◆ transferDataToImage() [1/2]

void FCT::VK_Context::transferDataToImage ( vk::Image dstImage,
uint32_t width,
uint32_t height,
uint32_t depth,
vk::Format format,
uint32_t mipLevels,
uint32_t arrayLayers,
vk::ImageAspectFlags aspectMask,
const void * data,
size_t dataSize,
vk::Fence * outFence = nullptr,
std::function< void()> * cleanUpCallback = nullptr )

在文件 VK_Context.cpp257 行定义.

函数调用图:

◆ transferDataToImage() [2/2]

void FCT::VK_Context::transferDataToImage ( vk::Image dstImage,
uint32_t width,
uint32_t height,
vk::Format format,
const void * data,
size_t dataSize,
vk::Fence * outFence = nullptr,
std::function< void()> * cleanUpCallback = nullptr )

在文件 VK_Context.cpp250 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ trigger()

void FCT::IEventSystem< EventSystemConfig::TriggerOnly >::trigger ( const Event & event)
inlineinherited

在文件 IEventSystem.h110 行定义.

这是这个函数的调用关系图:

◆ unsubscribe()

void FCT::IEventSystem< EventSystemConfig::TriggerOnly >::unsubscribe ( SubscribeId subscribeId)
inlineinherited

在文件 IEventSystem.h226 行定义.

◆ unsubscribeAll()

void FCT::IEventSystem< EventSystemConfig::TriggerOnly >::unsubscribeAll ( )
inlineinherited

在文件 IEventSystem.h239 行定义.

◆ update()

void FCT::IEventSystem< EventSystemConfig::TriggerOnly >::update ( )
inlineinherited

在文件 IEventSystem.h165 行定义.

◆ updateAll()

void FCT::IEventSystem< EventSystemConfig::TriggerOnly >::updateAll ( )
inlineinherited

在文件 IEventSystem.h180 行定义.

类成员变量说明

◆ m_bindWindows

std::vector<Window*> FCT::Context::m_bindWindows
protectedinherited

在文件 Context.h218 行定义.

◆ m_cmdGraph

CommandBufferGraph* FCT::Context::m_cmdGraph
protectedinherited

在文件 Context.h211 行定义.

◆ m_commandBuffers

std::vector<vk::CommandBuffer> FCT::VK_Context::m_commandBuffers
private

在文件 VK_Context.h67 行定义.

◆ m_commandPool

vk::CommandPool FCT::VK_Context::m_commandPool
private

在文件 VK_Context.h66 行定义.

◆ m_common

VK_ContextCommon* FCT::VK_Context::m_common
private

在文件 VK_Context.h61 行定义.

◆ m_compiler

ShaderCompiler* FCT::Context::m_compiler
protectedinherited

在文件 Context.h209 行定义.

◆ m_ctxRunning

bool FCT::Context::m_ctxRunning
protectedinherited

在文件 Context.h222 行定义.

◆ m_currentFlush

bool FCT::Context::m_currentFlush
protectedinherited

在文件 Context.h220 行定义.

◆ m_descriptorPool

RHI::DescriptorPool* FCT::Context::m_descriptorPool
protectedinherited

在文件 Context.h226 行定义.

◆ m_device

vk::Device FCT::VK_Context::m_device
private

在文件 VK_Context.h63 行定义.

◆ m_eventQueue

std::conditional_t<EventSystemConfig::TriggerOnly::EnableQueue, std::unordered_map<entt::id_type, std::vector<std::function<void()> > >, std::monostate> FCT::IEventSystem< EventSystemConfig::TriggerOnly >::m_eventQueue
privateinherited

在文件 IEventSystem.h104 行定义.

◆ m_flowControl

FlowControl* FCT::Context::m_flowControl
protectedinherited

在文件 Context.h203 行定义.

◆ m_frameIndex

size_t FCT::Context::m_frameIndex = 0
protectedinherited

在文件 Context.h227 行定义.

◆ m_generator

ShaderGenerator* FCT::Context::m_generator
protectedinherited

在文件 Context.h210 行定义.

◆ m_graphicsQueue

vk::Queue FCT::VK_Context::m_graphicsQueue
private

在文件 VK_Context.h65 行定义.

◆ m_graphicsQueueFamilyIndex

uint32_t FCT::VK_Context::m_graphicsQueueFamilyIndex
private

在文件 VK_Context.h62 行定义.

◆ m_handlers

std::conditional_t<EventSystemConfig::TriggerOnly::EventAsData, std::unordered_map<entt::id_type, std::unordered_map<SubscribeId, std::unique_ptr<IEventHandler> > >, std::unordered_map<entt::id_type, std::unordered_map<SubscribeId, std::unique_ptr<IEventIdentifierHandler> > > > FCT::IEventSystem< EventSystemConfig::TriggerOnly >::m_handlers
privateinherited

在文件 IEventSystem.h100 行定义.

◆ m_imageLoader

ImageLoader* FCT::Context::m_imageLoader
protectedinherited

在文件 Context.h207 行定义.

◆ m_logicFrameIndex

size_t FCT::Context::m_logicFrameIndex = 0
protectedinherited

在文件 Context.h228 行定义.

◆ m_logicTask

boost::lockfree::queue<LogicTaskData*,boost::lockfree::capacity<1024> > FCT::Context::m_logicTask
protectedinherited

在文件 Context.h150 行定义.

◆ m_maxFrameInFlight

uint32_t FCT::Context::m_maxFrameInFlight
protectedinherited

在文件 Context.h224 行定义.

◆ m_modelLoader

ModelLoader* FCT::Context::m_modelLoader
protectedinherited

在文件 Context.h205 行定义.

◆ m_nextFrame

bool FCT::Context::m_nextFrame
protectedinherited

在文件 Context.h219 行定义.

◆ m_nextSubscribeId

SubscribeId FCT::IEventSystem< EventSystemConfig::TriggerOnly >::m_nextSubscribeId
privateinherited

在文件 IEventSystem.h106 行定义.

◆ m_phyDevice

vk::PhysicalDevice FCT::VK_Context::m_phyDevice
private

在文件 VK_Context.h64 行定义.

◆ m_refCount

std::atomic<size_t> FCT::RefCount::m_refCount
protectedinherited

在文件 RefCount.h30 行定义.

◆ m_renderGraph

RenderGraph* FCT::Context::m_renderGraph
protectedinherited

在文件 Context.h206 行定义.

◆ m_resourceDevice

Device* FCT::Context::m_resourceDevice
protectedinherited

在文件 Context.h204 行定义.

◆ m_resourceManager

ResourceManager* FCT::Context::m_resourceManager
protectedinherited

在文件 Context.h208 行定义.

◆ m_submitFrameIndex

size_t FCT::Context::m_submitFrameIndex = 0
protectedinherited

在文件 Context.h229 行定义.

◆ m_submitThread

std::thread FCT::Context::m_submitThread
protectedinherited

在文件 Context.h221 行定义.

◆ m_submitThreadId

std::thread::id FCT::Context::m_submitThreadId
protectedinherited

在文件 Context.h230 行定义.

◆ m_ticker

SubmitTicker FCT::Context::m_ticker
protectedinherited

在文件 Context.h217 行定义.

◆ m_transferCommandPool

vk::CommandPool FCT::VK_Context::m_transferCommandPool
private

在文件 VK_Context.h71 行定义.

◆ m_transferQueue

vk::Queue FCT::VK_Context::m_transferQueue
private

在文件 VK_Context.h70 行定义.

◆ m_transferQueueFamilyIndex

uint32_t FCT::VK_Context::m_transferQueueFamilyIndex
private

在文件 VK_Context.h69 行定义.


该类的文档由以下文件生成: