-
Notifications
You must be signed in to change notification settings - Fork 152
Fix texture copy when using multiple canvas #1481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
a0215b7
96b0c81
dd3952e
5d307c2
aeb967f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1431,11 +1431,12 @@ namespace Babylon | |
| { | ||
| const auto textureDestination = info[0].As<Napi::Pointer<Graphics::Texture>>().Get(); | ||
| const auto textureSource = info[1].As<Napi::Pointer<Graphics::Texture>>().Get(); | ||
|
|
||
|
|
||
| // Append a task instead of calling blit immediately or blit happens before drawcalls. | ||
| arcana::make_task(m_update.Scheduler(), *m_cancellationSource, [this, textureDestination, textureSource, cancellationSource = m_cancellationSource]() { | ||
|
||
| return arcana::make_task(m_runtimeScheduler, *m_cancellationSource, [this, textureDestination, textureSource, updateToken = m_update.GetUpdateToken(), cancellationSource = m_cancellationSource]() { | ||
| bgfx::Encoder* encoder = m_update.GetUpdateToken().GetEncoder(); | ||
| GetBoundFrameBuffer(*encoder).Blit(*encoder, textureDestination->Handle(), 0, 0, textureSource->Handle()); | ||
| m_deviceContext.Blit(*encoder, textureDestination->Handle(), 0, 0, textureSource->Handle()); | ||
| }).then(arcana::inline_scheduler, *m_cancellationSource, [this, cancellationSource{m_cancellationSource}](const arcana::expected<void, std::exception_ptr>& result) { | ||
| if (!cancellationSource->cancelled() && result.has_error()) | ||
| { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we have to expose this new function because
FrameBufferhas to tellDeviceContextthis needs to be done when aSubmithappens. Is there any other case (other thanSubmit) where we would need to do this, or is this really tied toFrameBuffer::Submit?If we need to expose this as a new function, would
InvalidateViewbe a better name?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, Framebuffer tells device context the view contains draw call. I've added a call for
Clear.InvalidateViewworks for me!