Skip to content

Commit

Permalink
🐛 (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
wcandillon authored Oct 14, 2024
1 parent 8d16b29 commit 0b1ddea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/webgpu/cpp/rnwgpu/SurfaceRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ class SurfaceInfo {
return {.width = width, .height = height};
}

wgpu::SurfaceConfiguration getConfig() {
std::shared_lock<std::shared_mutex> lock(_mutex);
return config;
}

wgpu::Device getDevice() {
std::shared_lock<std::shared_mutex> lock(_mutex);
return config.device;
Expand Down
2 changes: 1 addition & 1 deletion packages/webgpu/cpp/rnwgpu/api/GPUCanvasContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void GPUCanvasContext::configure(
void GPUCanvasContext::unconfigure() {}

std::shared_ptr<GPUTexture> GPUCanvasContext::getCurrentTexture() {
auto prevSize = _surfaceInfo->getSize();
auto prevSize = _surfaceInfo->getConfig();
auto width = _canvas->getWidth();
auto height = _canvas->getHeight();
auto sizeHasChanged = prevSize.width != width || prevSize.height != height;
Expand Down

0 comments on commit 0b1ddea

Please sign in to comment.