<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Ryujinx/src/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs, branch master</title>
<subtitle>A backup of the Ryujinx master git branch.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.benis.co.uk/Ryujinx/'/>
<entry>
<title>Add support for bindless textures from shader input (vertex buffer) on Vulkan (#6577)</title>
<updated>2024-04-22T18:05:55+00:00</updated>
<author>
<name>gdkchan</name>
<email>gab.dark.100@gmail.com</email>
</author>
<published>2024-04-22T18:05:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.benis.co.uk/Ryujinx/commit/?id=c6f8bfed904e30f7c5d890a2f0ef531eb9e298e5'/>
<id>c6f8bfed904e30f7c5d890a2f0ef531eb9e298e5</id>
<content type='text'>
* Add support for bindless textures from shader input (vertex buffer)

* Shader cache version bump

* Format whitespace

* Remove cache entries on pool removal, disable for OpenGL

* PR feedback</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Add support for bindless textures from shader input (vertex buffer)

* Shader cache version bump

* Format whitespace

* Remove cache entries on pool removal, disable for OpenGL

* PR feedback</pre>
</div>
</content>
</entry>
<entry>
<title>GPU: Rebind RTs if scale changes when binding textures (#6493)</title>
<updated>2024-03-14T22:59:09+00:00</updated>
<author>
<name>riperiperi</name>
<email>rhy3756547@hotmail.com</email>
</author>
<published>2024-03-14T22:59:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.benis.co.uk/Ryujinx/commit/?id=1217a8e69b9b4feadb34c2d38209d765c9542819'/>
<id>1217a8e69b9b4feadb34c2d38209d765c9542819</id>
<content type='text'>
This fixes a longstanding issue with resolution scale that could result in flickering graphics, typically the first frame something is drawn, or on camera cuts in cutscenes.

The root cause of the issue is that texture scale can be changed when binding textures or images. This typically happens because a texture becomes a view of a larger texture, such as a 400x225 texture becoming a view of a 800x450 texture with two levels. If the 400x225 texture is bound as a render target and has state [1x Undesired], but the storage texture is [2x Scaled], the render target texture's scale is changed to [2x Scaled] to match its new storage. This means the scale changed after the render target state was processed...

This can cause a number of issues. When render target state is processed, texture scales are examined and potentially changed so that they are all the same value. If one texture is scaled, all textures must be. If one texture is blacklisted from scaling, all of them must be. This results in a single resolution scale value being assigned to the TextureManager, which also scales the scissor and viewport values.

If the scale is chosen as 1x, and a later texture binding changes one of the textures to be 2x, the scale in TextureManager no longer matches all of the bound textures. What's worse, the scales in these textures could mismatch entirely. This typically results in the support buffer scale, viewport and scissor being wrong for at least one of the bound render targets.

This PR fixes the issue by re-evaluating render target state if any scale mismatches the expected scale after texture bindings happen. This can actually cause scale to change again, so it must loop back to perform texture bindings again. This can happen as many times as it needs to, but I don't expect it to happen more than once. Problematic bindings will just result in a blacklist, which will propagate to other bound targets.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes a longstanding issue with resolution scale that could result in flickering graphics, typically the first frame something is drawn, or on camera cuts in cutscenes.

The root cause of the issue is that texture scale can be changed when binding textures or images. This typically happens because a texture becomes a view of a larger texture, such as a 400x225 texture becoming a view of a 800x450 texture with two levels. If the 400x225 texture is bound as a render target and has state [1x Undesired], but the storage texture is [2x Scaled], the render target texture's scale is changed to [2x Scaled] to match its new storage. This means the scale changed after the render target state was processed...

This can cause a number of issues. When render target state is processed, texture scales are examined and potentially changed so that they are all the same value. If one texture is scaled, all textures must be. If one texture is blacklisted from scaling, all of them must be. This results in a single resolution scale value being assigned to the TextureManager, which also scales the scissor and viewport values.

If the scale is chosen as 1x, and a later texture binding changes one of the textures to be 2x, the scale in TextureManager no longer matches all of the bound textures. What's worse, the scales in these textures could mismatch entirely. This typically results in the support buffer scale, viewport and scissor being wrong for at least one of the bound render targets.

This PR fixes the issue by re-evaluating render target state if any scale mismatches the expected scale after texture bindings happen. This can actually cause scale to change again, so it must loop back to perform texture bindings again. This can happen as many times as it needs to, but I don't expect it to happen more than once. Problematic bindings will just result in a blacklist, which will propagate to other bound targets.</pre>
</div>
</content>
</entry>
<entry>
<title>Clamp vertex buffer size to mapped size if too high (#6272)</title>
<updated>2024-02-08T17:27:12+00:00</updated>
<author>
<name>gdkchan</name>
<email>gab.dark.100@gmail.com</email>
</author>
<published>2024-02-08T17:27:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.benis.co.uk/Ryujinx/commit/?id=8bb7a3fc977db964b33645166e733b4b29259cb9'/>
<id>8bb7a3fc977db964b33645166e733b4b29259cb9</id>
<content type='text'>
* Clamp vertex buffer size to mapped size if too high

* Update comment</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Clamp vertex buffer size to mapped size if too high

* Update comment</pre>
</div>
</content>
</entry>
<entry>
<title>Fix vertex buffer size when switching between inline and state draw parameters (#6101)</title>
<updated>2024-01-14T08:37:19+00:00</updated>
<author>
<name>gdkchan</name>
<email>gab.dark.100@gmail.com</email>
</author>
<published>2024-01-14T08:37:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.benis.co.uk/Ryujinx/commit/?id=f4b74e9ce18b16f48f4e006d98675798874c3b54'/>
<id>f4b74e9ce18b16f48f4e006d98675798874c3b54</id>
<content type='text'>
* Fix vertex buffer size when switching between inline and state draw parameters

* Format whitespace</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Fix vertex buffer size when switching between inline and state draw parameters

* Format whitespace</pre>
</div>
</content>
</entry>
<entry>
<title>editorconfig: Set default encoding to UTF-8 (#5793)</title>
<updated>2023-12-04T13:17:13+00:00</updated>
<author>
<name>TSRBerry</name>
<email>20988865+TSRBerry@users.noreply.github.com</email>
</author>
<published>2023-12-04T13:17:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.benis.co.uk/Ryujinx/commit/?id=2989c163a891c4ac730e799e1457b1bfb2ecc028'/>
<id>2989c163a891c4ac730e799e1457b1bfb2ecc028</id>
<content type='text'>
* editorconfig: Add default charset

* Change file encoding from UTF-8-BOM to UTF-8</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* editorconfig: Add default charset

* Change file encoding from UTF-8-BOM to UTF-8</pre>
</div>
</content>
</entry>
<entry>
<title>GPU: Add HLE macros for popular NVN macros (#5761)</title>
<updated>2023-10-06T22:55:07+00:00</updated>
<author>
<name>riperiperi</name>
<email>rhy3756547@hotmail.com</email>
</author>
<published>2023-10-06T22:55:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.benis.co.uk/Ryujinx/commit/?id=f460ecc1829c1b34f2198cc41528b1c6de99d976'/>
<id>f460ecc1829c1b34f2198cc41528b1c6de99d976</id>
<content type='text'>
* GPU: Add HLE macros for popular NVN macros

* Remove non-vector equality check

The case where it's not hardware accelerated will do the check integer-wise anyways.

* Whitespace :pensive:

* Address Feedback</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* GPU: Add HLE macros for popular NVN macros

* Remove non-vector equality check

The case where it's not hardware accelerated will do the check integer-wise anyways.

* Whitespace :pensive:

* Address Feedback</pre>
</div>
</content>
</entry>
<entry>
<title>GPU: Discard data when getting texture before full clear (#5719)</title>
<updated>2023-09-25T21:07:03+00:00</updated>
<author>
<name>riperiperi</name>
<email>rhy3756547@hotmail.com</email>
</author>
<published>2023-09-25T21:07:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.benis.co.uk/Ryujinx/commit/?id=f6c3f1cdfdb9145634be3bfc54400f0d408f36dd'/>
<id>f6c3f1cdfdb9145634be3bfc54400f0d408f36dd</id>
<content type='text'>
* GPU: Discard data when getting texture before full clear

* Fix rules and order of clear checks

* Fix formatting</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* GPU: Discard data when getting texture before full clear

* Fix rules and order of clear checks

* Fix formatting</pre>
</div>
</content>
</entry>
<entry>
<title>Geometry shader emulation for macOS (#5551)</title>
<updated>2023-08-30T00:10:34+00:00</updated>
<author>
<name>gdkchan</name>
<email>gab.dark.100@gmail.com</email>
</author>
<published>2023-08-30T00:10:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.benis.co.uk/Ryujinx/commit/?id=f09bba82b9366e5912b639a610ae89cbb1cf352c'/>
<id>f09bba82b9366e5912b639a610ae89cbb1cf352c</id>
<content type='text'>
* Implement vertex and geometry shader conversion to compute

* Call InitializeReservedCounts for compute too

* PR feedback

* Set clip distance mask for geometry and tessellation shaders too

* Transform feedback emulation only for vertex</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Implement vertex and geometry shader conversion to compute

* Call InitializeReservedCounts for compute too

* PR feedback

* Set clip distance mask for geometry and tessellation shaders too

* Transform feedback emulation only for vertex</pre>
</div>
</content>
</entry>
<entry>
<title>Implement scaled vertex format emulation (#5564)</title>
<updated>2023-08-16T11:30:33+00:00</updated>
<author>
<name>gdkchan</name>
<email>gab.dark.100@gmail.com</email>
</author>
<published>2023-08-16T11:30:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.benis.co.uk/Ryujinx/commit/?id=effd546331371928bc38bc8a48b0c26c7c59f3e9'/>
<id>effd546331371928bc38bc8a48b0c26c7c59f3e9</id>
<content type='text'>
* Implement scaled vertex format emulation

* Auto-format (whitespace)

* Delete ToVec4Type</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Implement scaled vertex format emulation

* Auto-format (whitespace)

* Delete ToVec4Type</pre>
</div>
</content>
</entry>
<entry>
<title>GPU: Don't sync/bind index buffer when it's not in use (#5526)</title>
<updated>2023-08-06T19:29:20+00:00</updated>
<author>
<name>riperiperi</name>
<email>rhy3756547@hotmail.com</email>
</author>
<published>2023-08-06T19:29:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.benis.co.uk/Ryujinx/commit/?id=6e784e0aca240b41c83bd3e77aecf5793fdc238d'/>
<id>6e784e0aca240b41c83bd3e77aecf5793fdc238d</id>
<content type='text'>
* GPU: Don't sync/bind index buffer when it's not in use

Sometimes draws don't use an index buffer. It's not necessary to check or upload data for the current index buffer binding as it won't be used.

This fixes Pokemon: Legends Arceus updating a stale index buffer for every draw during its TFB pass, which was all non-indexed draws.

This probably didn't cost much on normal PCs, but it had a large impact on MacOS, which the macos1 release build avoided by mirroring index buffers (the PR currently does not). Needs buffer mirrors still for the rest of the performance.

There are additional cases where index buffers are bound or checked with non-indexed draws on the backend, but this one was straightforward to fix and has the largest impact. Testing is welcome to ensure nothing weird broke.

* Fix case with _rebind</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* GPU: Don't sync/bind index buffer when it's not in use

Sometimes draws don't use an index buffer. It's not necessary to check or upload data for the current index buffer binding as it won't be used.

This fixes Pokemon: Legends Arceus updating a stale index buffer for every draw during its TFB pass, which was all non-indexed draws.

This probably didn't cost much on normal PCs, but it had a large impact on MacOS, which the macos1 release build avoided by mirroring index buffers (the PR currently does not). Needs buffer mirrors still for the rest of the performance.

There are additional cases where index buffers are bound or checked with non-indexed draws on the backend, but this one was straightforward to fix and has the largest impact. Testing is welcome to ensure nothing weird broke.

* Fix case with _rebind</pre>
</div>
</content>
</entry>
</feed>
