Commit Graph

625 Commits

Author SHA1 Message Date
relrelb abb0e33431 chore: Use Rust's `OnceCell`/`OnceLock`
They were stabilized in Rust 1.70.0, which was released yesterday.
This removes the `once_cell` dependency.
2023-06-02 22:21:38 +03:00
Aaron Hill 12e078bb2d wgpu: Fix calculation of image row padding 2023-05-28 23:35:53 -05:00
Nathan Adams b29a784968 wgpu: Remove render callback as it's no longer used 2023-05-24 23:50:48 +02:00
Nathan Adams b9322ba93a desktop: Render game separately to UI, blit both onto surface 2023-05-24 23:50:48 +02:00
Mike Welsh c00b4bf55c desktop: Initial GUI work 2023-05-24 23:50:48 +02:00
renovate[bot] 5d2477fe98 chore(deps): lock file maintenance rust dependencies 2023-05-22 19:12:08 +03:00
Aaron Hill 5d62ef90f2 wgpu: Use intermediate buffer for Context3DCommand::CopyBitmapToTexture
In a previous PR, I introduced an optimization that used
`copy_texture_to_texture` to copy directly from a BitmapData GPU
texture to a Stage3D GPU texture.

Unfortunately, this optimization is incorrect. A BitmapData GPU
texture can be modified at any time by normal AVM2 code - in
particular, in might be modified before we submit the encoded
`copy_texture_to_texture` command. This shows up in Sniper Team,
which re-uses BitmapData objects for multiple distinct textures.
The previous 'optimization' resulted in the wrong BitmapData contents
getting uploaded to a texture (since it was changed before the copy
command was submitted).
2023-05-20 17:38:26 -05:00
Aaron Hill 0864853d44 avm2: Allow passing `null` to `Context3D.setProgram`
This clears the vertex and fragment shader programs
(bringing the Context3D back to its initial state).
2023-05-20 16:23:03 -05:00
Aaron Hill 7004e98b23 avm2: Don't validate Context3DVertexBufferFormat when buffer is null
This matches Flash Player's behavior - some SWFS try to pass in 'null'
for both the buffer and format.
2023-05-18 15:14:29 -05:00
renovate[bot] f969bdce71 fix(deps): update wasm-bindgen 2023-05-17 06:44:50 +03:00
Aaron Hill bd2be88711 wgpu: Fix MSAA and depth buffer handling in SetRenderToTexture
When multisampling is enabled, we should create a new multisampled texture,
and use the existing texture as the resolve buffer. We also need to
call `update_has_depth_texture` to keep our pipeline aware of whether
or not we currently have a depth buffer attached.

Makes progress on #10641 (it has a stack overflow after
this PR, due to an unrelated issue).
2023-05-15 09:34:30 -05:00
renovate[bot] 5b26d1b2ee fix(deps): update wasm-bindgen 2023-05-15 10:00:49 +03:00
Aaron Hill e488cc9f7a wgpu: Allow unaligned writes to IndexBuffer3D
wgpu requires buffer copy sizes and offsets to be 4-byte aligned.
Unfortunately, ActionScript can perform 2-byte aligned uploads
into an IndexBuffer3D.

To support this, we now keep a copy of the IndexBuffer3D on the CPU.
When performing an upload to the buffer, we round the offset down
and the size up to the nearest 4-byte aligned value. The cpu buffer
is used to fill out the write with existing data, so that we don't
corrupt the contents of the GPU buffer.

To avoid introducing a new RefCell, I've changed IndexBuffer3D
to use a `Box` instead of an `Rc` to store the trait object.
This allows us to pass a mutable reference down to the backend.
2023-05-10 18:20:29 -05:00
Nathan Adams 2b6829692c wgpu: Resize textures if they're bigger than the system supports 2023-05-05 19:03:15 +02:00
Aaron Hill 22c13d41da wgpu: Use Context3DCommand by value 2023-05-05 11:43:43 -05:00
Nathan Adams c5293bd981 core: Don't actually apply a filter if it's unsupported, just copy 2023-05-03 21:15:48 +02:00
relrelb 85a9ec77c5 render: Fix wgpu renderer name 2023-05-03 01:12:19 +03:00
iwannabethedev 307f364d6f
web: Log used renderer
Log which renderer-backend was actually used in the
browser console.
2023-05-02 23:59:57 +03:00
Aaron Hill 3bb8c8fb4f wgpu: Update wgpu to 0.16.0 and naga to 0.12.0 2023-04-25 09:24:53 -05:00
Nathan Adams d9241c914e chore: Hold wgpu and naga back until naga_oil updates to naga 0.12 2023-04-24 01:22:07 +02:00
renovate[bot] 3b3c08a354 chore(deps): lock file maintenance rust dependencies 2023-04-24 01:22:07 +02:00
Nathan Adams 4f4327b152 wgpu: Fix drawing a transparent bitmap with MSAA 2023-04-18 23:15:42 +02:00
Aaron Hill 962cf92223 avm2: Implement Context3D.setSamplerStateAt
This fixes pixelated backgrounds in Fancy Pants World 4 Part 3
2023-04-05 16:44:07 -07:00
Mike Welsh 792cfd82c7 avm2: Implement `Context3D.setColorMask` 2023-04-05 12:22:13 -07:00
Nathan Adams 06bc4e1403 wgpu: Fix sync issue introduced in #9753 and added test 2023-04-04 11:11:57 -07:00
TÖRÖK Attila 493971ab8a render: Make RenderBackend::update_texture() take a Bitmap (like register_bitmap()) 2023-04-04 00:15:07 -07:00
Mike Welsh 549a06d00f wgpu: Slight optimization to color shader
The color doesn't change per pixel, so calculate the color in the
vertex stage instead of the fragment stage.
2023-04-03 14:33:37 -07:00
renovate[bot] cd3ad90d61 chore(deps): lock file maintenance rust dependencies 2023-04-02 22:00:49 -07:00
Aaron Hill a2fa362091 wgpu: Implement double buffering for Context3D
This matches the Context3D docs. Calling 'present' swaps
the buffers.

I wasn't certain if we actually need a double-buffered depth
texture, but I included one just to be safe.
2023-04-02 19:24:23 -07:00
Aaron Hill 671ebdfa8f wgpu: Execute Context3D commands immediately
Now that most of the complicated Context3D methods have been
implemented, we can simplify the overall design. Instead of queueing
up commands and having `present` execute them in a loop, we
can execute each command immediately. The key insight is that
a `RenderPass` is only needed for `DrawTriangles`, so we don't
have to store it in `Context3D` and deal with complicated lifetime
issues.

The old behavior gave us implicit double-buffering behavior,
since nothing would get rendered until a 'present' call.
Now that a 'drawTriangles' call will immediately submit
a draw command, we need to implement actual double buffering.
This is done in the next commit.
2023-04-02 19:24:23 -07:00
Aaron Hill 7809000170 wgpu: Fix filter texture copy size calculation
I incorrectly changed this in #10373

Fixes #10380
2023-04-01 11:04:55 -05:00
Nathan Adams adadb8a26d wgpu: Use swap_remove instead of remove for buffer pool 2023-03-31 16:57:52 +02:00
Nathan Adams c51ba098f6 render: Rename PixelRegion's (min|max)_(x|y) to (x|y)_(min|max) 2023-03-31 16:57:52 +02:00
Nathan Adams f0ebefd624 tests: Add bitmapdata recursive draw test 2023-03-31 16:57:52 +02:00
Nathan Adams c85910b46d wgpu: Fixed panic when rendering texture to itself, by always rendering to an intermediary 2023-03-31 16:57:52 +02:00
Nathan Adams 311a165149 wgpu: Reintroduce texture promoting; only preassign buffer when the texture is frequently written/&read 2023-03-31 16:57:52 +02:00
Nathan Adams 6e859891af render: Take in dirty region in update_texture, only upload those pixels 2023-03-31 16:57:52 +02:00
Nathan Adams 137593b6a6 render: Extract (u32, u32, u32, u32) to PixelRegion 2023-03-31 16:57:52 +02:00
Nathan Adams 4ccc75c4d6 wgpu: Changed AlwaysIncompatible to AlwaysCompatible, whoops 2023-03-31 16:57:52 +02:00
Nathan Adams 71ef10b94b wgpu: Reuse buffers for BitmapData.draw, preferring smallest buffer available 2023-03-31 16:57:52 +02:00
Nathan Adams 2cc1db6f8e wgpu: Enable BufferPool to reuse existing buffers if they're compatible 2023-03-31 16:57:52 +02:00
Nathan Adams e0bd911f2f render: Only copy a possible dirty area for bitmapdata.draw & read 2023-03-31 16:57:52 +02:00
relrelb 236a97bf31 render: Replace `ColorTransform` with `swf::ColorTransform` 2023-03-29 23:27:20 -07:00
relrelb d71617209a render: Remove `RenderBackend::register_glyph_shape`
Use just `RenderBackend::register_shape` instead.
2023-03-30 01:46:04 +03:00
renovate[bot] 5052e942b5 chore(deps): lock file maintenance rust dependencies 2023-03-28 09:31:15 +03:00
Aaron Hill a52cb7461e wgpu: Implement MSAA support for Stage3D
When we receieve a nonzero 'antiAlias' parameter, we create
create a non-multisampled resolve buffer to use with WGPU.

Several tests were already requesting antialiasing, so their
output images are now anti-aliased without any changes to
the tests themselves.
2023-03-26 18:05:41 -07:00
Aaron Hill b140029e95 render: Fix BitmapData.applyFilter with non-full sourceRect
Previously, we were scaling down the source image to fit into
the smaller sourceRect, instead of cropping at the original scale.
This broke the background textures in Fancy Pants World 4 Part 2,
as the scaled-down output image resulted in a smaller rectangle
being returned from 'getColorBoundsRect'

We now crop the image by properly constructing the UV-coordinate
transformation matrix. We were also using the wrong value for the
'destPoint' y coordinate, which I fixed.

This slightly changes the image output of two tests - the new images
now more closely match the Flash output.
2023-03-25 18:44:01 -07:00
relrelb 39b53c76d6 ci: Deny warnings on Web
As suggested in https://github.com/ruffle-rs/ruffle/pull/6935#pullrequestreview-967181111.
2023-03-24 19:16:32 -07:00
Nathan Adams eb44cc5395 render: Made ShapeHandle an Arc of an internal, droppable mesh 2023-03-23 01:44:27 -07:00
Nathan Adams cc8ac4fde1 render: Remove RenderBackend::replace_shape 2023-03-23 01:44:27 -07:00
Mike Welsh 1d12fc6169 render: Fix types depending on `tessellator` feature 2023-03-22 20:30:39 +01:00
renovate[bot] f6f646a756 chore(deps): lock file maintenance rust dependencies 2023-03-19 19:45:30 -07:00
Nathan Adams 078672782c wgpu: Skip Alpha/Erase blends with no parent Layer 2023-03-19 14:59:48 -07:00
Aaron Hill 8425eab1f0 render: Compile a different version of 'bitmap.wgsl' for Stage3D
When using the bitmap.wgsl shader for normal rendering, we need
to saturate immediately after applying the color transformation
to reproduce Flash Player's behavior. This makes the (possibly
transformed) alpha value get multiplied by a in-range color,
instead of a potentially out-of-range color.

However, Stage3D just applies a no-op color transformation,
and should only saturate at the very end
(not after the intermediate division by the original alpha value).

To support both of these requirements, I've added in a new
`early_saturate` ifdef that controls when we apply 'saturate'.
We then compile the shader twice (once with early_saturate=true
and once with early_saturate=false), and use the two versions
in the right pipelines.

We could use a simpler shader for Stage3D - however, it can't just
be a plain copy, as we need to apply the viewport transformation.
For now, I'm re-using the shader code to keep things simple. If
this becomes a performance issue in stage3d, we could revisit this.
2023-03-19 02:15:26 -05:00
Aaron Hill 1e973af747 avm2: Implement Context3D.setRenderToTexture/setRenderToBackBuffer
In the process, I fixed a bug where we were clearing the depth
and stencil buffers with the incorrect value.

This makes Fancy Pants World 4 Part 1 playable to completion
(though there are still some rendering issues that need
to be fixed).
2023-03-17 20:11:59 -05:00
Aaron Hill 1edcbe438d core: Avoid several BitmapData GPU -> CPU sync
We don't need to perform a sync when getting the width/height,
getting or setting the 'disposed' status, or uploading to
a Context3D texture.

The Context3D change (using `copy_texture_to_texture` instead
of relying on the CPU pixels) has the added advantage of avoiding
a validation error when our source image row length isn't aligned
to `COPY_BYTES_PER_ROW_ALIGNMENT`

This dramatically speeds up the Fancy Pants World 4 loading time
(on a branch with my XML prs merged). Without this change, my
machine spends around 10 seconds on a blank white screen after
clicking 'Play'. With this change, the time spent on that screen
is reduced to around 1-2 seconds.
2023-03-17 04:56:03 -05:00
Aaron Hill 53c6011ade render: Support more Context3D texture formats
None of these formats can currently be implemented
correctly with wgpu, so we just use Rgba8Unorm instead.

The handling of opaque compressed textures is a little
sketchy - it should work for 'normal' SWFs that upload
an opaque BitmapData, but we might need to manually
adjust the alpha values if
2023-03-16 17:40:41 -05:00
Aaron Hill 1dd0d237ab render: Correctly handle BYTES_4 vertex data
Each byte gets normalized into a float in the range [0, 1]
2023-03-16 13:20:11 -05:00
Aaron Hill acbc802c94 avm2: Fix VertexBuffer3D.uploadDataFromByteArray size calculation
We were ignoreing 'data32PerVertex'.
To make the code clearer, I've renamed the variable to
'data32_per_vertex', and made it a 'u8' (as it has a maximum of 64)
2023-03-15 19:52:09 -05:00
Aaron Hill fea885f3af render: Implement Context3DTextureFormat.BGRA using an RGBA texture
Webgl doesn't support BGRA textures, so this lets us use
Stage3D textures on the web backend. As a bonus, this speeds up
uploading an BitmapData to a Context3dTextureFormat.BGRA texture,
since we no longer need to change the format before copying.

This makes Solarmax2 playable on the web backend.
2023-03-13 13:30:15 -05:00
Nathan Adams b527054a1e
render: Make retrieve_offscreen_texture pass the raw buffer (#9936) 2023-03-13 00:00:42 +00:00
Aaron Hill de8448e00a
avm2: Implement Stage3D depth test, blend factors, and fix bugs (#9845) 2023-03-12 23:43:58 +00:00
TÖRÖK Attila 109e151fa6 render/all: Clamp gradient focal point to be between -/+0.98 2023-03-12 23:54:59 +01:00
TÖRÖK Attila 0f7c362069 wgpu: Update to wgpu 0.15.1, naga 0.11.0, and naga_oil 0.5.0 2023-03-12 16:30:13 -05:00
TÖRÖK Attila 7d3a2d14b7 render/wgpu: Delete the now unused buffer bug detection shader 2023-03-12 15:53:16 -05:00
TÖRÖK Attila d356b7258a wgpu: Fix gradient regression 2023-03-07 20:35:29 +01:00
Nathan Adams 0cca4983e4 wgpu: Merge gradient shaders together 2023-03-06 23:22:09 +01:00
Nathan Adams 622abe60d1 wgpu: Extract T->Color lookup from gradient shader to Mesh construction 2023-03-06 23:22:09 +01:00
renovate[bot] 130144a76d fix(deps): update rust dependencies 2023-03-05 20:43:46 -06:00
Aaron Hill 2748b95c86 avm2: Improve Stage3D support for textures, register types, and opcodes
This is a very large diff, but most of it comes from test files and
output.

This PR ads partial support for the following Stage3D shader features:
* Normal (square), rectangle, and cube textures
* Varying and temporary registers
* Lots of opcodes

The combination of these allows us to get a raytracing program
fully working in Ruffle. I've included it as image test.
Currently, this test is very slow (about 90 seconds on my machine),
as the code I'm using (https://github.com/saharan/OGSL) includes
its own shader language and compiler. THe raytracing demo
first compiles its own shader language to AGAL, and then starts
rendering the scene.

Limitations:
* Many opcodes are still unimplemented
* Most non-default texture options (e.g. mipmaps) are not implemented
2023-03-03 15:58:46 -06:00
Nathan Adams f79015e201 render: Use swf Filter types where possible. Gradient types had to be split into duplicate classes to allow for different trait impls based on which gradient filter type it is. 2023-02-28 16:25:12 +01:00
Nathan Adams 9c1f6ea129 render: Add Filter::BevelFilter 2023-02-28 16:25:12 +01:00
renovate[bot] 71e24eedba fix(deps): update rust dependencies 2023-02-27 11:48:53 +02:00
Nathan Adams edd7f80341 wgpu: Fix blown out colors when transforming them above 100% - fixes #9698 2023-02-24 19:01:41 +01:00
Aaron Hill 455124d3ba render: Fix blending onto BitmapData contents
When rendering to an offscreen texture for `Bitmapdata.draw`,
we first render to a temporary frame buffer, and then copy the contents
of the frame buffer back to the target texture. However, this results
in blend modes being incorrectly applied - for example, rendering with
BlendMode.SUBTRACT will subtract against the framebuffer (which starts
with each pixel as 0x00000000), instead of the previous BitmapData
contents.

To fix this, we now use our texture target as the frame buffer
when performing `render_offscreen`. This ensure that we blend
over existing pixels (taking into account the `blendMode` provided
in the `BitmapData.draw` call).

When multisampling is enabled, we use a copy pipeline to copy
the existing contents of our texture to a fresh multisampled frame
buffer (the non-multisampled texture target becomes our resolve buffer).
2023-02-23 09:52:56 -06:00
Nathan Adams 6539262db7 render: Add Quality option to RenderBackend::render_offscreen 2023-02-22 17:36:55 +01:00
renovate[bot] a27bd66b58 fix(deps): update rust dependency patches 2023-02-13 04:59:31 +01:00
Aaron Hill c597f9f996 core: Fix Clippy lints on nightly 2023-02-13 03:38:54 +01:00
Nathan Adams 0e9b1e4a77 wgpu: Better support for 2x and 8x msaa 2023-02-06 16:08:04 +01:00
Nathan Adams 1cb3ea7bf9 wgpu: Store quality, not sample_count, and calculate the correct sample count per format 2023-02-06 16:08:04 +01:00
Nathan Adams b95983b492 wgpu: Hook up set_quality 2023-02-06 16:08:04 +01:00
Nathan Adams d8e924affc render: Add RenderBackend::set_quality method, and call it from core 2023-02-06 16:08:04 +01:00
Nathan Adams 3411a04cef render: Made render specific Filter enum & structs, as swf ones don't map 1:1 to potential filters 2023-02-05 18:41:43 +01:00
Nathan Adams b5a250e16f render: Changed render_offscreen to return an Option instead of an Result 2023-02-05 18:41:43 +01:00
Nathan Adams e73389aa71 wgpu: Implement blur filter 2023-02-05 18:41:43 +01:00
Nathan Adams 284a58c817 avm2: Implement BitmapData.apply_filter for ColorMatrixFilter 2023-02-05 18:41:43 +01:00
Nathan Adams 72bfd499f8 wgpu: Reuse whole-mesh uniform buffer for gradients 2023-02-05 18:02:19 +01:00
Nathan Adams 013a2424ef wgpu: Only use uniform buffers for gradients, we don't need storage buffers now that we squeeze the ratios into alignment 2023-02-05 18:02:19 +01:00
Nathan Adams 3bc7d44e9c wgpu: Reuse the same vertex and index buffer for an entire mesh 2023-02-05 18:02:19 +01:00
Nathan Adams 571a1780e2 wgpu: Provide usage and alignment to BufferBuilder 2023-02-05 18:02:19 +01:00
Nathan Adams cbc227b0a0 wgpu: Split up mesh creation into a 2 step process so we can reuse the same buffer for each draw 2023-02-05 18:02:19 +01:00
Nathan Adams f9b378b29a wgpu: Changed most pipelines & shaders to only use Pos, not Pos and Color, as vertex attribs 2023-02-05 18:02:19 +01:00
renovate[bot] caaf6d5c87 fix(deps): update rust dependencies 2023-01-31 09:39:42 -06:00
Nathan Adams 5dd3060a28 wgpu: Ensure we clear before blending an object onto nothing 2023-01-29 20:45:01 +01:00
Nathan Adams 7b1c101c81 wgpu: Fix repeat & reflect gradients 2023-01-29 17:17:44 +01:00
Nathan Adams 9b43836d1d tests: Allow executing of with_renderer tests always, but image comparison is still gated 2023-01-28 12:15:59 -07:00
renovate[bot] 8b6eef1715 fix(deps): update rust dependencies 2023-01-24 20:10:40 -06:00
Nathan Adams 1bfa69ade2 wgpu: Guard against infinite loops in gradient shader - fixes #9260 2023-01-23 23:25:30 +01:00
Aaron Hill ffc393e3e8 render: Work around naga_oil duplicate definition bug 2023-01-23 11:31:04 +01:00
Aaron Hill fc3c2a2297 Update wgpu
This requires us to bump naga as well, and switch to a fork
of naga_oil that compiles against the latest naga.
2023-01-23 11:31:04 +01:00
Aaron Hill a71d14d31c Fix wasm build 2023-01-23 11:31:04 +01:00
Aaron Hill 0fe8ef6c2d Get naga_oil shaders working 2023-01-23 11:31:04 +01:00
Aaron Hill 6fe7af58d5 Move back to upstream wgpu repository
We're relying on unreleased changes, so we depend on the latest commit
from their repository.
2023-01-23 11:31:04 +01:00
Aaron Hill e2954821ea
core: Take two - delay reading image back from render backend using `SyncHandle` (#9184)
* Take two: Delay reading image back from render backend using `SyncHandle`

This allows us to avoid blocking immediately after a `BitmapData.draw` call.
Instead, we only attempt to use the `SyncHandle` when performing an operation
that requires the CPU-side pixels (e.g. BitmapData.getPixel or BitmapData.setPixel).

In the best case, the SWF will never explicitly access the pixels of
the target BitmapData, removing the need to ever copy back the render backend
image to our BitmapData. If the SWF doesn't require access to the pixels immediately,
we can delay copying the pixels until they're actually needed, hopefully allowing
the render backend to finish processing the BitmapData.draw operation in
the backenground before we need the result.

Now that the CPU and GPU pixels can be intentionally out of sync with
each other, we need to ensure that we don't accidentally expose 'stale'
CPU-side pixels to ActionScript (which needs to remain unaware of
our internal laziness). We now use a wrapper type `BitmapDataWrapper`
to enforce that the `SyncHandle` is consumed before accessing the
underlying `BitmapData.

* core: Skip GPU->CPU sync for source and target BitmapData during draw

* Introduce DirtyState enum
2023-01-21 21:08:04 +00:00
Nathan Adams b5c6d5debe wgpu: Don't panic if rendering a None bitmap - fixes #9188 2023-01-17 19:34:51 +01:00
Nathan Adams 580cce29db wgpu: Update to wgpu fork with buffer bug fix 2023-01-17 05:59:55 +01:00
Nathan Adams 3c4710cfb5 wgpu: Only show current limits in debug info 2023-01-16 23:18:42 +01:00
Nathan Adams 6138714fa7 wgpu: Fix buffer bug detection 2023-01-16 17:22:04 +01:00
Nathan Adams 3279a920b4 wgpu: Use a temporary wgpu fork that increases push constants limit on webgl & speeds up start time 2023-01-15 18:19:11 +01:00
Nathan Adams 1b42ad0ab4 wgpu: Keep globals cache across the buffer pool 2023-01-14 19:35:16 +01:00
Nathan Adams 2e7201334d wgpu: Detect if buffers are unusable on web and fail to create wgpu renderer if so 2023-01-12 18:37:28 +01:00
Nathan Adams 8db8e4669a wgpu: Implement Multiply blend mode as a trivial blend 2023-01-12 10:54:03 -05:00
Nathan Adams 09608c2abc wgpu: Implement Screen blend mode as a trivial blend 2023-01-12 10:54:03 -05:00
Nathan Adams 9cd850d30e render: Make render_offscreen return a sync handle which can be used to get the texture at a later time 2023-01-11 16:53:33 -05:00
renovate[bot] 630558a936 fix(deps): update rust dependencies 2023-01-10 16:37:40 +01:00
Nathan Adams 62f9b11417 wgpu: Fixed color shader working in correct color space 2023-01-10 09:39:28 +01:00
Nathan Adams ae75a3c166 wgpu: Use push constants for both Transforms and ColorAdjustments, when available 2023-01-10 09:39:28 +01:00
Nathan Adams fb78a39125 wgpu: Switch to experimental crate naga_oil for combining shaders 2023-01-10 09:39:28 +01:00
Nathan Adams 4e5749a7e4 wgpu: When push constants are available, use those for Transforms 2023-01-10 09:39:28 +01:00
Nathan Adams fa9db9145d wgpu: Removed double references 2023-01-10 09:39:28 +01:00
Nathan Adams ad3060e70c wgpu: Specialcase draw_rect with white as that's just identity color transform 2023-01-10 09:39:28 +01:00
Nathan Adams b07a01da57 wgpu: Cache texture views along side their owned textures in texture pool 2023-01-09 20:40:45 +01:00
Nathan Adams 4d85b6a75b wgpu: Hook up wgpu renderer, and wgpu's profiling, to tracy 2023-01-08 20:02:26 +01:00
Moulins d332a174c3 Bump `gc-arena` to current master revision
This required small changes to some Debug impls that were missed in #8964
2023-01-06 18:22:43 -05:00
Nathan Adams b7bc835def wgpu: Use Stencil8 2023-01-06 06:29:43 +01:00
Nathan Adams 69e98d23ad wgpu: Update to wgpu 630c12fe47a7bc0dc9ec6217f3903ec6fd6e3fac 2023-01-06 06:29:43 +01:00
Nathan Adams a69d30bb67 render: Add debug info method to renderer backends 2023-01-05 05:51:32 +01:00
dependabot[bot] b15c1bbfa3 build(deps): bump once_cell from 1.16.0 to 1.17.0
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.16.0 to 1.17.0.
- [Release notes](https://github.com/matklad/once_cell/releases)
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.16.0...v1.17.0)

---
updated-dependencies:
- dependency-name: once_cell
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-03 10:11:05 +02:00
Nathan Adams 3b209bd6aa wgpu: Use frame-temporary buffer for offscreen rendering 2023-01-03 03:39:13 +01:00
Nathan Adams 533d104337 wgpu: Don't load or store the depth side of the depth buffer, we only care for stencil 2023-01-03 03:39:13 +01:00
Nathan Adams eaff82ea7e wgpu: Cleaned up some buffer binding api 2023-01-03 03:39:13 +01:00
Nathan Adams 28768f2ad8 render: Make CommandList a struct instead of a tuple 2023-01-03 03:39:13 +01:00
Nathan Adams 3dd9c4daa3 wgpu: Moved ColorAdjustments into its own bind group, and reuse ColorAdjustments::IDENTITY where we can 2023-01-03 03:39:13 +01:00
Nathan Adams 353a3116a4 wgpu: Define the sizes of uniforms upfront instead of at each call 2023-01-03 03:39:13 +01:00
Nathan Adams ae5d92693f wgpu: Moved DrawCommand handling to CommandRenderer::execute 2023-01-03 03:39:13 +01:00
Nathan Adams 7944b6dd9e wgpu: Inlined CommandRenderer::execute into Surface::draw_commands 2023-01-03 03:39:13 +01:00
Nathan Adams a71b5b4570 wgpu: Move command renderer to surface/commands.rs 2023-01-03 03:39:13 +01:00
Nathan Adams 0272eda121 wgpu: Refactor surface command target to its own file 2023-01-03 03:39:13 +01:00
Nathan Adams a657feadae wgpu: Clear out texture pool when resized 2023-01-03 03:39:13 +01:00
Nathan Adams cb6d72b49b wgpu: Split up gradient shader based on type and repeat 2023-01-03 03:39:13 +01:00
Nathan Adams a79e73fb12 wgpu: Clean up gradient shaders by bringing out common shared source into a same file 2023-01-03 03:39:13 +01:00
Nathan Adams b4c2030af8 wgpu: Appease beta clippy. again. 2023-01-03 03:39:13 +01:00
Nathan Adams 91561e8c35 wgpu: Reduce gradient.ratios uniform memory by 4x 2023-01-03 03:39:13 +01:00
Nathan Adams 312e72451f wgpu: Reduce gradient.colors uniform memory by 4x 2023-01-03 03:39:13 +01:00
Nathan Adams 986b95c50c wgpu: Share texture pool across all frames, and ensure targets are cleared properly 2023-01-03 03:39:13 +01:00
Nathan Adams c0ec5c5010 wgpu: Split up blend modes into their own shaders for performance 2023-01-03 03:39:13 +01:00
Nathan Adams 92a6c6bc76 wgpu: Add more debug labels within render passes 2023-01-03 03:39:13 +01:00
Nathan Adams 1863c93be1 wgpu: Add some more debug labels 2023-01-03 03:39:13 +01:00
Nathan Adams 257bbc8ec9 wgpu: Revert using same pool for whole frame - breaks bitmapdata.draw and I'm not sure why yet 2023-01-03 03:39:13 +01:00
Nathan Adams 0f676fc6ce wgpu: Simplify blend_buffers map creation 2023-01-03 03:39:13 +01:00