Commit Graph

46 Commits

Author SHA1 Message Date
Martin Fouilleul c983c39f44 [canvas] removed old begin/end/renderBatch function pointers 2023-07-27 18:11:34 +02:00
martinfouilleul b300cc4d7d [gl canvas] balance dispatch of raster shader along 2 dimensions to avoid hitting the max workgroup count per dimension 2023-07-27 15:24:20 +02:00
martinfouilleul 3c103eeb65 [canvas, gl] compute intermediate glsl structs' sizes according to std430 2023-07-27 14:38:12 +02:00
martinfouilleul ae862b39ba [win32, gl canvas] grow intermediate gl buffers as needed 2023-07-27 12:40:52 +02:00
martinfouilleul 680deb35b0 [win32, gl canvas] grow path and element input buffers as needed 2023-07-27 11:37:39 +02:00
martinfouilleul a4ae1cf214 [win32, surface] Fix auto-selecting surface when first creating one ; checking why smooth resize still doesn't work even though we receive events and draw in a separate thread 2023-07-25 15:55:09 +02:00
martinfouilleul 3816e85592 [win32, surface] always resize surface to parent window's client area 2023-07-25 14:18:02 +02:00
martinfouilleul 2a4e90cf9a [win32, canvas] Fix padding of mg_gl_screen_tile 2023-07-16 17:12:34 +02:00
martinfouilleul bff9a3618f [win32, canvas] use glBindBufferBase() and explicit uniform offset to avoid glBindBufferRange() implementation-specific alignment issues 2023-07-15 15:29:45 +02:00
martinfouilleul 782b7f54ae [win32, canvas] only dispatch raster shader for tiles touched by paths 2023-07-14 18:58:18 +02:00
martinfouilleul 660ad33ddc [win32, gl canvas] persistently map input buffers 2023-07-12 15:54:02 +02:00
martinfouilleul 6944325014 [win32, canvas] rolling input buffers 2023-07-12 15:52:48 +02:00
martinfouilleul 59fdc27ac6 [gl, canvas]
- Haul path color and texture sampling outside of per-sample loop
- Pack gl input structs a bit
- Set correct hint flags for glBufferData()
2023-07-07 15:45:06 +02:00
martinfouilleul bdb9ddf888 [win32, canvas] added back texture atlasing and fixed incorrect culling of solid tiles when using a source texture 2023-07-04 17:24:41 +02:00
martinfouilleul 5c4c8ce505 [wip, win32, canvas] adding back textures 2023-07-04 15:59:45 +02:00
martinfouilleul 311cef65e8 [wip, win32, canvas] dispatch path setup, segment setup and backprop in batches of GL_MAX_COMPUTE_WORK_GROUP_COUNT elements 2023-07-03 16:16:39 +02:00
martinfouilleul e24a872fad [wip, win32, canvas] encode strokes 2023-07-03 15:16:27 +02:00
martinfouilleul d00024b515 [wip, win32, canvas] added MSAA to new canvas renderer 2023-07-03 15:00:40 +02:00
martinfouilleul b61d8868d3 [wip, win32, canvas] wip trying to fix multiple shapes 2023-07-02 12:26:54 +02:00
martinfouilleul 7628138cee [wip, win32, canvas] tiling in per-path tile queues, then merge (no backprop for now) 2023-06-30 16:53:36 +02:00
martinfouilleul f0b7cf32a9 [wip, win32, canvas] winding backprop and right crossing segments 2023-06-30 15:30:05 +02:00
martinfouilleul 0870097262 [wip, win32, canvas] bin segments to screen tile queues 2023-06-30 15:18:37 +02:00
martinfouilleul 15c54b9385 [wip, win32, canvas] segment setup, non tiled 2023-06-29 16:43:38 +02:00
martinfouilleul f76ff94c28 [wip, win32, canvas] raster elements directly per pixel 2023-06-29 15:48:52 +02:00
martinfouilleul b797f187dc [wip, win32, canvas] porting new canvas renderer to opengl 2023-06-27 18:53:09 +02:00
martinfouilleul 83f128fb55 [win32, graphics] adding example to test rendering in a secondary thread 2023-06-21 19:14:56 +02:00
martinfouilleul 2bec7a633a [win32] reflected changes to canvas surface interface on GL backend. But implementation still uses the (slower) Loop-Blinn + triangle fan method. 2023-05-16 18:06:22 +02:00
martinfouilleul 52538248d9 [win32, wip] compile and run simple window example 2023-05-12 16:46:13 +02:00
Martin Fouilleul b27dc615d1 Finish separating graphics_common and graphics_surface + add platform_math, so that we can compile graphics_common to wasm in orca 2023-04-26 14:56:02 +02:00
Martin Fouilleul 794f47b141 abstracting logging for orca 2023-04-18 18:05:54 +02:00
Martin Fouilleul 86a16d3775 modifications to log system to support orca env where stdio is not defined 2023-04-18 14:33:27 +02:00
Martin Fouilleul 592f4cdecd end of line renormalization 2023-03-05 16:05:43 +01:00
Martin Fouilleul 3615775168 [canvas] decompose image atlas API into simple rect atlas API + image atlas helpers. This avoids creating a bunch of new types/handles, and exposes the underlying image/sourceRegion so that user code can freely use these for more complex scenarios (eg drawing only a sub-region of an atlased image, or using an atlas image for arbitrary path filling) 2023-02-28 16:54:39 +01:00
Martin Fouilleul d4bceba7e9 [canvas] basic image atlas API 2023-02-28 13:16:36 +01:00
martinfouilleul 9cb4aedbc5 [canvas, gl] use pre-multiplied alpha in draw shader and when compositing batches 2023-02-27 19:50:18 +01:00
martinfouilleul 8f834fa1a5 [wip, canvas, gl] implementing basic image API 2023-02-27 19:25:41 +01:00
martinfouilleul 20e425494f Use a custom GL loader to allow different versions of GL/GLES APIs to co-exist. The loader fills an api struct with GL functions pointers.
We have a per-thread pointer to select which api struct is used, and GL functions are pound-defined to call the versions in that struct.
GL/GLES surfaces can use one of the loader function to load their api, and the prepare proc of the surface sets its api as the current one
before gl calls are issued.
2023-02-16 19:35:01 +01:00
martinfouilleul 80ea8db687 [surface/canvas cleanup]
- Make build-time and runtime backend selection a bit easier
- Reorganized backend-specific files with slightly more coherent naming scheme
2023-02-10 16:56:10 +01:00
martinfouilleul 08d3521b61 [canvas/surface cleanup]
- properly destroy gl canvas backend
- properly destroy gl surface
2023-02-09 18:40:42 +01:00
martinfouilleul af7cbae1fa [canvas cleanup] cleanup canvas resources on creation failure 2023-02-09 18:18:12 +01:00
martinfouilleul 4e816a838b [Clean canvas/shaders]
- Simplified shader names, prefix embedded strings by "glsl_"
- Extracted shader compilation in common function
- Add shader version string and common structs in canvas code rather than in every shader file
- Renamed zIndex with shapeIndex everywhere
2023-02-09 16:14:15 +01:00
martinfouilleul 4a8c77f023 - Move and Zoom perf_text example with the mouse
- Reverted to using 4 bits of subpixel precision and computing cross products with 32 bits integers, for perf reasons
- Fixed some confusion in tile array size vs number of elements (could still clean-up naming a bit though)
- Fixed bug where triangles on the left or below canvas boundaries where bucketted to the first colum/row of tiles
- Fixed bug in mouse button message handling (was always sending press on left button)
2023-02-09 13:09:41 +01:00
martinfouilleul 7cf4c3d925 opengl surface/renderer: set surface scaling according to dpi of first monitor. Use that dpi to scale backing texture of canvas renderer. Note: changing monitor isn't handled yet! 2023-02-08 18:22:54 +01:00
martinfouilleul 2419ab7889 opengl canvas renderer: splitting vertex data and shape data 2023-02-07 18:59:51 +01:00
martinfouilleul f0bc88c4fb gl canvas renderer with buffer re-specification 2023-02-07 17:00:59 +01:00
martinfouilleul 5788cdbcda Desktop opengl 4.3 canvas 2023-02-07 13:24:14 +01:00