Commit Graph

14 Commits

Author SHA1 Message Date
Aaron Hill 742ee4052d naga-pixelbender: Implement Opcode::LogicalAnd 2023-09-30 15:58:06 -04:00
Aaron Hill 1c0ae0b6d8 render: Bump wgpu to 0.17 and naga to 0.13 2023-09-07 18:49:59 -04:00
Aaron Hill ccf42c3614 naga-pixelbender: Stub out Opcode::Loop
Some experimentation with Pixel Bender Studio shows
that Opcode::Loop has a 23-byte payload. I haven't tried to
figure out how to interpet the payload yet, but we can now
skip over the opcode instead of bailing out entirely.
2023-08-30 17:36:31 -04:00
renovate[bot] 1f4bfcf10d fix(deps): update rust dependencies 2023-08-18 23:32:15 +02:00
renovate[bot] 93f08d7738 chore(deps): lock file maintenance rust dependencies 2023-08-14 23:58:45 +02:00
Aaron Hill b8562bdb91 naga-pixelbender: Implement Opcode::Fract 2023-07-23 16:34:38 -04:00
Aaron Hill 3607a5fb23 naga-pixelbender: Implement Opcode::LessThanEqual 2023-07-20 20:09:07 -04:00
renovate[bot] 268403faad chore(deps): lock file maintenance rust dependencies 2023-07-17 09:55:56 +03:00
Aaron Hill 9d3e96e3a4
render: Implement more Pixelbender opcodes, and fix matrices (#11896) 2023-07-09 16:54:26 +00:00
Aaron Hill 852367b09b wgpu: Use a vec4f for pixelbender ZEROED_OUT_OF_RANGE_MODE_INDEX
This could really be a single f32 (or even a boolean), but wgpu
on web requires a minimum size of 16 bytes for uniforms.
2023-07-05 21:23:22 +02:00
renovate[bot] 13b1078142 chore(deps): lock file maintenance rust dependencies 2023-07-03 08:28:13 +03:00
Aaron Hill 6e1f00edf2
render: Implement more PixelBender features (#11800) 2023-07-01 13:50:43 -04:00
renovate[bot] 7a21756ddb chore(deps): lock file maintenance rust dependencies 2023-06-17 11:00:52 -05:00
Aaron Hill 69fce3f7f8
wpgu: Initial implementation of PixelBender shader execution (#11441)
* wpgu: Initial implementation of PixelBender shader execution

The implementation is split across four crates:
* `ruffle_render` now holds the main PixelBender bytecode parsing
   implementation (previously, this was in `ruffle_core`).
* `ruffle_core` holds some helper functions for converting between
   AVM2 `Value`s and the PixelBender vector types.
* `naga-pixelbender` (newly created) constructs a Naga `Module`
  from parsed PixelBender bytecode
* `ruffle_render_wgpu` sets up the render pipeline for the shader
  constructed by `naga-pixelbender`, and actually executes the shader.

The Actionscript-side shader parameters are passed in through uniforms.
This allows us to cache the compiled `naga::Module` and associated
wgpu types inside `ShaderData`, when it's first created. Each invocation
of a `ShaderJob` only needs to create a bind group and render pass.

Limitations:

* Only a few of the PixelBender opcodes are implemented - however, this is
enough to get Stemlands cannon rotation working, as well as a cool
"donut" shader that I found and included as a test.
* PixelBender matrix types are not supported.
* Only BitmapData is supported as an input/output type - Flash Player
  also supports using Vector and ByteArray
* ShaderJob execution is always synchronous.

* Adjust comments

* Address review comments
2023-06-15 22:50:24 +00:00