2020-04-21 13:32:50 +00:00
|
|
|
[package]
|
|
|
|
name = "ruffle_render_wgpu"
|
|
|
|
authors = ["Nathan Adams <dinnerbone@dinnerbone.com>"]
|
2022-10-14 10:09:22 +00:00
|
|
|
edition.workspace = true
|
2022-12-16 23:09:19 +00:00
|
|
|
homepage.workspace = true
|
|
|
|
license.workspace = true
|
|
|
|
repository.workspace = true
|
|
|
|
version.workspace = true
|
2020-04-21 13:32:50 +00:00
|
|
|
|
|
|
|
[dependencies]
|
2023-01-20 17:24:22 +00:00
|
|
|
wgpu = { git = "https://github.com/gfx-rs/wgpu", rev = "c5851275c59b1d5d949b142d6aa973d0bb638181", features = ["naga"] }
|
2023-01-06 12:17:12 +00:00
|
|
|
tracing = "0.1.37"
|
2022-08-13 23:27:27 +00:00
|
|
|
ruffle_render = { path = "..", features = ["tessellator"] }
|
2023-01-25 01:22:56 +00:00
|
|
|
bytemuck = { version = "1.13.0", features = ["derive"] }
|
2022-10-07 10:17:41 +00:00
|
|
|
raw-window-handle = "0.5"
|
2023-02-27 02:17:55 +00:00
|
|
|
clap = { version = "4.1.6", features = ["derive"], optional = true }
|
2022-12-19 23:49:52 +00:00
|
|
|
enum-map = "2.4.2"
|
2022-06-29 22:16:43 +00:00
|
|
|
fnv = "1.0.7"
|
2022-08-13 23:18:52 +00:00
|
|
|
swf = { path = "../../swf" }
|
2022-11-14 20:49:44 +00:00
|
|
|
image = { version = "0.24.5", default-features = false }
|
2023-01-20 17:24:22 +00:00
|
|
|
naga_oil = { git = "https://github.com/Aaron1011/naga_oil", rev = "f4474b53285a85fe67cc35372c9d7ff4517cb556", features = ["override_any"] }
|
2023-02-27 02:17:55 +00:00
|
|
|
ouroboros = "0.15.6"
|
2023-01-10 15:16:37 +00:00
|
|
|
typed-arena = "2.0.2"
|
2023-02-27 02:17:55 +00:00
|
|
|
once_cell = "1.17.1"
|
2023-01-04 00:06:57 +00:00
|
|
|
gc-arena = { workspace = true }
|
avm2: Partially implement Stage3D for wgpu backend
This PR implements core 'stage3D' APIs. We are now able
to render at least two demos from the Context3D docs - a simple
triangle render, and a rotating cube.
Implemented in this PR:
* Stage3D access and Context3D creation
* IndexBuffer3D and VertexBuffer3D creation, uploading, and usage
* Program3D uploading and usage (via `naga-agal`)
* Context3D: configureBackBuffer, clear, drawTriangles, and present
Not yet implemented:
* Any 'dispose()' methods
* Depth and stencil buffers
* Context3D texture apis
* Scissor rectangle
General implementation strategy:
A new `Object` variant is added for each of the Stage3D objects
(VertexBuffer3D, Program3D, etc). This stores a handle to the
parent `Context3D`, and (depending on the object) a handle
to the underlying native resource, via `Rc<dyn
SomeRenderBackendTrait>`).
Calling methods on Context3D does not usually result in an immediate
call to a `wgpu` method. Instead, we queue up commands in our
`Context3D` instance, and execute them all on a call to `present`.
This avoids some nasty wgpu lifetime issues, and is very similar
to the approah we use for normal rendering.
The actual rendering happens on a `Texture`, with dimensions
determined by `createBackBuffer`. During 'Stage' rendering,
we render all of these Stage3D textures *behind* the normal
stage (but in front of the overall stage background color).
2022-09-18 20:50:21 +00:00
|
|
|
naga-agal = { path = "../naga-agal" }
|
|
|
|
downcast-rs = "1.2.0"
|
2023-01-06 12:17:12 +00:00
|
|
|
profiling = { version = "1.0", default-features = false, optional = true }
|
2022-09-24 03:14:49 +00:00
|
|
|
naga = { version = "0.10.0", features = ["validate", "wgsl-out"] }
|
2020-04-27 20:42:59 +00:00
|
|
|
|
2021-09-09 00:54:13 +00:00
|
|
|
# desktop
|
2022-07-02 12:18:30 +00:00
|
|
|
[target.'cfg(not(target_family = "wasm"))'.dependencies.futures]
|
2023-01-31 15:22:11 +00:00
|
|
|
version = "0.3.26"
|
2021-09-09 00:54:13 +00:00
|
|
|
|
|
|
|
# wasm
|
2022-07-02 12:18:30 +00:00
|
|
|
[target.'cfg(target_family = "wasm")'.dependencies.web-sys]
|
2023-02-13 03:39:30 +00:00
|
|
|
version = "0.3.61"
|
2021-09-09 00:54:13 +00:00
|
|
|
features = ["HtmlCanvasElement"]
|
|
|
|
|
2020-04-27 20:42:59 +00:00
|
|
|
[features]
|
2020-10-10 20:16:32 +00:00
|
|
|
render_debug_labels = []
|
2020-10-14 20:06:36 +00:00
|
|
|
render_trace = ["wgpu/trace"]
|
2022-08-29 04:57:18 +00:00
|
|
|
webgl = ["wgpu/webgl"]
|
2023-01-06 12:17:12 +00:00
|
|
|
profile-with-tracy = ["profiling", "profiling/profile-with-tracy"]
|