Ryujinx icon indicating copy to clipboard operation
Ryujinx copied to clipboard

GPU: Swap bindings array instead of copying

Open riperiperi opened this issue 3 years ago • 2 comments

Reduces work on UpdateShaderState. Now the cost is a few reference moves for arrays (for stages with bindings), rather than copying data. Cached bindings arrays are created when shaders are loaded.

1-2 fps here on the usual spot in SMO.

Upside: Removes a bunch of redundant code from ComputeClass, cheaper UpdateShaderState. Downside: bindings arrays are no longer readonly (though it was only the top level array that was readonly, not the contained ones).

riperiperi avatar Dec 03 '22 15:12 riperiperi

I'm not sure what to do about the default arrays for textureBindings etc that are created. It could still be possible for these arrays to be used without a shader being set, I guess? Right now they are left in.

riperiperi avatar Dec 03 '22 15:12 riperiperi