Renderer: Refactor transient resources (allow access at any time)
This commit is contained in:
committed by
Jérôme Leclercq
parent
de68033a0e
commit
4db5b59ec9
@@ -156,22 +156,6 @@ namespace Nz
|
||||
#endif
|
||||
}
|
||||
|
||||
void OpenGLDevice::Execute(const FunctionRef<void(CommandBufferBuilder& builder)>& callback, QueueType /*queueType*/)
|
||||
{
|
||||
const GL::Context* activeContext = GL::Context::GetCurrentContext();
|
||||
if (!activeContext || activeContext->GetDevice() != this)
|
||||
{
|
||||
if (!GL::Context::SetCurrentContext(m_referenceContext.get()))
|
||||
throw std::runtime_error("failed to activate context");
|
||||
}
|
||||
|
||||
OpenGLCommandBuffer commandBuffer; //< TODO: Use a pool and remove default constructor
|
||||
OpenGLCommandBufferBuilder builder(commandBuffer);
|
||||
callback(builder);
|
||||
|
||||
commandBuffer.Execute();
|
||||
}
|
||||
|
||||
const RenderDeviceInfo& OpenGLDevice::GetDeviceInfo() const
|
||||
{
|
||||
return m_deviceInfo;
|
||||
|
||||
Reference in New Issue
Block a user