2022-08-13 22:52:16 +00:00
|
|
|
[package]
|
|
|
|
name = "ruffle_render"
|
2022-12-16 23:09:19 +00:00
|
|
|
authors.workspace = true
|
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
|
2022-08-13 22:52:16 +00:00
|
|
|
|
|
|
|
[dependencies]
|
2022-09-02 12:53:42 +00:00
|
|
|
swf = { path = "../swf"}
|
2022-08-13 22:52:16 +00:00
|
|
|
log = "0.4"
|
2022-11-21 20:09:09 +00:00
|
|
|
gif = "0.12.0"
|
2022-10-31 20:07:49 +00:00
|
|
|
png = { version = "0.17.7" }
|
2022-11-25 16:17:44 +00:00
|
|
|
flate2 = "1.0.25"
|
2022-10-03 22:15:49 +00:00
|
|
|
smallvec = { version = "1.10.0", features = ["union"] }
|
2022-08-13 23:16:17 +00:00
|
|
|
downcast-rs = "1.2.0"
|
2022-11-07 22:26:57 +00:00
|
|
|
lyon = { version = "1.0.1", optional = true }
|
2022-08-18 23:34:35 +00:00
|
|
|
thiserror = "1.0"
|
2022-09-13 18:06:53 +00:00
|
|
|
wasm-bindgen = { version = "=0.2.83", optional = 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
|
|
|
gc-arena = { git = "https://github.com/ruffle-rs/gc-arena" }
|
2022-12-25 00:20:57 +00:00
|
|
|
enum-map = "2.4.2"
|
2022-08-13 22:58:40 +00:00
|
|
|
|
|
|
|
[dependencies.jpeg-decoder]
|
2022-10-24 20:09:45 +00:00
|
|
|
version = "0.3.0"
|
2022-08-13 22:58:40 +00:00
|
|
|
default-features = false # can't use rayon on web
|
2022-08-13 22:52:16 +00:00
|
|
|
|
2022-08-13 23:16:17 +00:00
|
|
|
[dev-dependencies]
|
|
|
|
approx = "0.5.1"
|
|
|
|
|
2022-08-13 23:27:27 +00:00
|
|
|
[features]
|
|
|
|
default = []
|
2022-08-18 23:34:35 +00:00
|
|
|
tessellator = ["lyon"]
|
2022-09-02 12:53:42 +00:00
|
|
|
web = ["wasm-bindgen"]
|