ruffle/render/naga-agal
Aaron Hill 837143bb12 naga-agal: Fix handling of sampler overrides
After some testing, and looking at OpenFL, I believe I've
determined the correct behavior for AGAL sampling:

Each time a Context3D.setProgram or Context3D.setSamplerStateAt
call is made, the sampler config for the used texture slot(s)
is updated with the new wrapping/filter behavior. For setProgram,
this comes from all of the 'tex' opcodes used within the program.

However, when the 'ignoresampler' flag is set in a 'tex' opcode,
the setProgram call does *not* override the existing sampler config.
As a result, that program will sample with the behavior determined
by the most recent setSamplerStateAt or setProgram call involving
the used texture slot(s).

Previously, we were always overriding the opcode sampler config
with the values from Context3D.setSamplerStateAt. However, I didn't
realize that the order of the calls matter, so none of my tests ended
up observing the effect of 'ignoresampler'.

We now need to process AGAL bytecode twice - a quick initial
parse to determine the sampler configs (which need to be updated
when we call 'setProgram'), and a second time when to build the
Naga module (which needs to wait until we have the vertex attributes
available, which can be changed by ActionScript after setting
the program).
2023-12-15 22:05:30 -07:00
..
agal-helper agal: Add support for indirect register loads 2023-05-21 09:40:11 -05:00
src naga-agal: Fix handling of sampler overrides 2023-12-15 22:05:30 -07:00
tests naga-agal: Fix handling of sampler overrides 2023-12-15 22:05:30 -07:00
Cargo.toml fix(deps): update rust dependencies 2023-10-16 09:51:22 +02:00