2020-04-23 22:04:07 +00:00
|
|
|
[package]
|
|
|
|
name = "ruffle_render_canvas"
|
|
|
|
version = "0.1.0"
|
2022-03-26 20:57:19 +00:00
|
|
|
authors = ["Ruffle LLC <ruffle@ruffle.rs>"]
|
2022-10-14 10:09:22 +00:00
|
|
|
edition.workspace = true
|
2020-05-26 09:10:44 +00:00
|
|
|
license = "MIT OR Apache-2.0"
|
2020-04-23 22:04:07 +00:00
|
|
|
|
|
|
|
[dependencies]
|
2022-09-13 18:06:53 +00:00
|
|
|
js-sys = "0.3.60"
|
2020-12-04 18:47:20 +00:00
|
|
|
log = "0.4"
|
2020-04-23 22:04:07 +00:00
|
|
|
ruffle_web_common = { path = "../../web/common" }
|
2022-09-13 18:06:53 +00:00
|
|
|
wasm-bindgen = "=0.2.83"
|
2022-06-29 22:16:43 +00:00
|
|
|
fnv = "1.0.7"
|
2022-08-18 23:34:35 +00:00
|
|
|
ruffle_render = { path = "..", features = ["web"] }
|
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-08-13 23:18:52 +00:00
|
|
|
swf = { path = "../../swf" }
|
2020-04-23 22:04:07 +00:00
|
|
|
|
|
|
|
[dependencies.web-sys]
|
2022-09-13 18:06:53 +00:00
|
|
|
version = "0.3.60"
|
2020-04-23 22:04:07 +00:00
|
|
|
features = [
|
2021-11-20 20:01:42 +00:00
|
|
|
"CanvasGradient", "CanvasPattern", "CanvasRenderingContext2d", "CanvasWindingRule", "CssStyleDeclaration",
|
2022-05-17 06:23:00 +00:00
|
|
|
"Document", "DomMatrix", "Element", "HtmlCanvasElement", "ImageData", "Navigator", "Path2d", "SvgMatrix",
|
2020-04-23 22:04:07 +00:00
|
|
|
]
|