Repository navigation
gui_toolkit 0.29.0
Fixes found by the review of render and draw (branch fix/render-draw). 0.30.0 is the font / ui / platform review branch. Each fix has a test that failed before it (tests/lifecycle is new).
Fixed
- Plane pieces with more than 6 cuts (
draw/bsp.odin): a piece bounded by more thanMAX_PLANE_CUTScuts had the extra ones thrown away, so it was drawn over its siblings' region at its own rank and covered planes that had to be in front. It is now divided by a chord between two of its corners into convex halves (the chord is one more cut for each), as often as needed: no cut is lost, no limit. Hidden (skip) items no longer take part in the crossing tests. draw.app_shaderkeepsAppIn.pos,sizeandpxin local units under a uniform scale plus translation (DPI, zoom) asdocs/shaders.mdsays (they were pixels: a scale was baked into the rectangle); any scale now goes through a transform entry. It returns false for a shader that is notrender.app_shader_ready.- Device loss with several windows (Direct3D 11): a
Surfaceset aside bysurface_usekept its swap chain, views and capture copy from the old device (undefined behaviour, then a loop of recoveries); andset_blend_spacegave the new view format to the current window only. The window state carries the device generation and the blend space it was made in, andsurface_useremakes a stale one (render.Renderer.swap_gen,swap_space,space_epoch;Surface.gen,space_epoch).d3d_recoverflushes the old context after releasing its objects (the old HWND swap chain used to keep the window, andCreateSwapChainForHwndcrashed). An offscreen renderer notices a device loss atframe_end. - Captures belong to their window (
Capture_Stateis exchanged with theSurface: the nextframe_endof that window takes it, not whichever window ends a frame first); the staging copy of an old device is released at recovery (a pending copy becomesFailed) instead of being used on the new device. wgpu_destroyread the texture table after freeing it.wgpu_recoverwithout a device (adapter gone) returns false at once instead of creating textures on a null device and dropping the textures and shaders for good. A refused app pipeline on wgpu (the module passed, the pipeline did not) gives the shader up instead of invalidating every frame.- App shaders that cannot be remade after a device loss keep their handle (and name) until
destroy_app_shader; the handle used to be given to the next shader.render.app_shader_ready(r, s)says whether one can be drawn. - Kept layers and planes (
cache_id) followset_text_rendering,set_corner_smoothingand the font atlas settings (they are in the key now), and a result drawn while a color glyph was still pending (Settings.color_async) is not kept (the glyph never came in). A masked layer that lost a target is not kept as the masked result. push_planeinside a recorded picture records nothing (it recorded the content flat, unprojected);current_clipis not empty while recording.- Slug text, when the device refuses the Slug shaders, is not drawn (it was one solid rounded rect per glyph);
d3d_update_texture_r8checks the handle, the block and the pixels like the other uploads.
Docs
docs/webgpu.mdlists the functions the WebGPU backend does not have;docs/draw.mdno longer says 3D is unsupported (planes are);docs/shaders.md:app_shaderandapp_shader_ready.
Not fixed (reported)
bspstill splits the whole context when one pair crosses, with no limit on the number of pieces, andPlane_Item.geomis the texel-aligned rectangle (faces that touch look crossing; Wren works around it); a backdrop of a cut plane is captured once per piece; the hash of an app shader does not coverAPP_BINDINGS(changing it makes every precompiled blob stale: to be done with the applications' blobs);Surfacerelease on a thread, the DirectCompositionPanellifetime, canvas source textures never zeroed (to check).