2019-04-28 01:15:43 +00:00
|
|
|
[workspace]
|
|
|
|
members = [
|
2019-04-28 06:08:59 +00:00
|
|
|
"core",
|
2019-12-08 04:53:36 +00:00
|
|
|
"core/macros",
|
2022-06-15 19:00:17 +00:00
|
|
|
"core/build_playerglobal",
|
2019-04-28 01:15:43 +00:00
|
|
|
"desktop",
|
2019-10-03 01:58:58 +00:00
|
|
|
"swf",
|
2019-10-11 14:19:18 +00:00
|
|
|
"web",
|
2022-04-02 02:41:44 +00:00
|
|
|
"web/packages/extension/safari",
|
2022-03-23 14:52:55 +00:00
|
|
|
"wstr",
|
2019-10-11 14:19:18 +00:00
|
|
|
"scanner",
|
2020-05-05 13:27:10 +00:00
|
|
|
"exporter",
|
2020-04-23 22:04:07 +00:00
|
|
|
|
2022-08-13 22:52:16 +00:00
|
|
|
"render",
|
2020-04-23 22:04:07 +00:00
|
|
|
"render/canvas",
|
render: Add 'naga-agal' crate to compile AGAL shaders to Naga
This is the first part of the Stage3D implementation, and can
be reviewed independently.
Stage3D shaders use the Adobe Graphics Assembly Language (AGAL),
which is a binary shader format. It supports vertex attributes,
varying registers, program constants (uniforms), and texture sampling.
This PR only implements a few parts of AGAL:
* The 'mov' and 'm44' opcodes
* Vertex attributes, varying registers, program constants, and 'output'
registers (position or color, depending on shader type)
This is sufficient to get a non-trivial Stage3D program
running (the rotating cube demo from the Adobe docs).
The output of `naga-agal` is a `naga::Module`. This can be passed
directly to wgpu, or compiled into a shader language using
a Naga backend (glsl, wgsl, SPIR-V, etc). The test suite
output WGSL files, and uses the 'insta' crate to compare against
saved files on disk.
Currently, the only real way to write AGAL bytecode is using
the Adobe-provided 'AGALMiniAssembler' flash class.
This class assembles the textual reprentation of AGAL into
the binary format.
To make writing tests easier, I've added a 'agal_compiler' test, which
can easily be modified to add more Agal textual assembly.
2022-09-23 00:44:49 +00:00
|
|
|
"render/naga-agal",
|
2020-04-21 13:32:50 +00:00
|
|
|
"render/wgpu",
|
2020-04-25 02:38:58 +00:00
|
|
|
"render/webgl",
|
2021-05-03 04:30:18 +00:00
|
|
|
|
2022-08-25 22:03:09 +00:00
|
|
|
"video",
|
2022-08-25 22:30:07 +00:00
|
|
|
"video/software",
|
2022-08-25 22:03:09 +00:00
|
|
|
|
2021-05-03 04:30:18 +00:00
|
|
|
"tests",
|
2022-03-08 04:44:36 +00:00
|
|
|
"tests/input-format",
|
2019-04-28 01:15:43 +00:00
|
|
|
]
|
2021-04-23 08:02:08 +00:00
|
|
|
resolver = "2"
|
2020-02-12 23:43:58 +00:00
|
|
|
|
2022-10-14 10:09:22 +00:00
|
|
|
[workspace.package]
|
2022-12-16 23:09:19 +00:00
|
|
|
authors = ["Ruffle LLC <ruffle@ruffle.rs>"]
|
2022-10-14 10:09:22 +00:00
|
|
|
edition = "2021"
|
2022-12-16 23:09:19 +00:00
|
|
|
homepage = "https://ruffle.rs"
|
|
|
|
license = "MIT OR Apache-2.0"
|
|
|
|
repository = "https://github.com/ruffle-rs/ruffle"
|
|
|
|
version = "0.1.0"
|
2022-10-14 10:09:22 +00:00
|
|
|
|
2023-01-04 00:06:57 +00:00
|
|
|
[workspace.dependencies]
|
|
|
|
gc-arena = { git = "https://github.com/kyren/gc-arena", rev = "318b2ea594dcdadd01f7789025e3b3940be96b2c" }
|
|
|
|
|
2020-02-12 23:43:58 +00:00
|
|
|
# Don't optimize build scripts and macros.
|
2020-02-13 23:24:40 +00:00
|
|
|
[profile.release.build-override]
|
2020-02-12 23:43:58 +00:00
|
|
|
opt-level = 0
|
2020-03-16 08:16:15 +00:00
|
|
|
|
|
|
|
[profile.dev]
|
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
|
|
|
panic = "unwind"
|
2020-03-16 08:16:15 +00:00
|
|
|
|
|
|
|
[profile.release]
|
|
|
|
panic = "abort"
|
2021-01-02 03:26:14 +00:00
|
|
|
|
|
|
|
[profile.dev.package.h263-rs]
|
|
|
|
opt-level = 3
|
|
|
|
|
|
|
|
[profile.dev.package.h263-rs-yuv]
|
2021-08-22 16:47:24 +00:00
|
|
|
opt-level = 3
|
|
|
|
|
|
|
|
[profile.dev.package.nihav_core]
|
|
|
|
opt-level = 3
|
|
|
|
|
|
|
|
[profile.dev.package.nihav_codec_support]
|
|
|
|
opt-level = 3
|
|
|
|
|
|
|
|
[profile.dev.package.nihav_duck]
|
|
|
|
opt-level = 3
|
2022-01-13 07:25:34 +00:00
|
|
|
|
|
|
|
# TODO: Set rustflags here instead of in web/core/package.json, when that
|
|
|
|
# feature becomes stable. See: https://github.com/rust-lang/cargo/issues/10271
|
|
|
|
# Until then, these custom profiles let cargo keep the build cache alive
|
|
|
|
# across "dual-wasm" builds, separating it for the two .wasm modules.
|
|
|
|
[profile.web-vanilla-wasm]
|
|
|
|
inherits = "release"
|
|
|
|
|
|
|
|
[profile.web-wasm-extensions]
|
|
|
|
inherits = "release"
|
2023-01-06 22:17:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
[patch.crates-io]
|
|
|
|
naga = { git = "https://github.com/gfx-rs/naga", rev = "e7fc8e6" }
|