Skip to content

Commit

Permalink
Merge pull request #218 from RagnarokResearchLab/wgpu-surface-suboptimal
Browse files Browse the repository at this point in the history
Fix an incorrect assertion in the WebGPU renderer
  • Loading branch information
rdw-software authored Dec 14, 2023
2 parents 5933c0e + 15fc36c commit 037f214
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Core/NativeClient/Renderer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function Renderer:RenderNextFrame()
local surfaceTexture = self.wgpuSurfaceTexture
webgpu.bindings.wgpu_surface_get_current_texture(self.wgpuSurface, surfaceTexture)
assert(surfaceTexture.status == ffi.C.WGPUSurfaceGetCurrentTextureStatus_Success, "Unexpected surface status") -- Probably minimized/resized? A problem for future me...
assert(surfaceTexture.suboptimal, "Surface texture should be optimal") -- Same :3
assert(tonumber(surfaceTexture.suboptimal) == 0, "Surface texture should be optimal") -- Same :3

local textureViewDescriptor = self.wgpuSurfaceTextureViewDescriptor
textureViewDescriptor.aspect = (self.viewportHeight / self.viewportWidth)
Expand Down

0 comments on commit 037f214

Please sign in to comment.