Implement Zero-Configuration Resolution Scaling (#1365)

* Initial implementation of Render Target Scaling

Works with most games I have. No GUI option right now, it is hardcoded.

Missing handling for texelFetch operation.

* Realtime Configuration, refactoring.

* texelFetch scaling on fragment shader (WIP)

* Improve Shader-Side changes.

* Fix potential crash when no color/depth bound

* Workaround random uses of textures in compute.

This was blacklisting textures in a few games despite causing no bugs. Will eventually add full support so this doesn't break anything.

* Fix scales oscillating when changing between non-native scales.

* Scaled textures on compute, cleanup, lazier uniform update.

* Cleanup.

* Fix stupidity

* Address Thog Feedback.

* Cover most of GDK's feedback (two comments remain)

* Fix bad rename

* Move IsDepthStencil to FormatExtensions, add docs.

* Fix default config, square texture detection.

* Three final fixes:

- Nearest copy when texture is integer format.
- Texture2D -> Texture3D copy correctly blacklists the texture before trying an unscaled copy (caused driver error)
- Discount small textures.

* Remove scale threshold.

Not needed right now - we'll see if we run into problems.

* All CPU modification blacklists scale.

* Fix comment.
This commit is contained in:
riperiperi 2020-07-07 03:41:07 +01:00 committed by GitHub
parent 43b78ae157
commit 484eb645ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 1163 additions and 131 deletions

View file

@ -1677,6 +1677,70 @@
<property name="margin_left">10</property>
<property name="margin_right">10</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Resolution Scale applied to applicable render targets.</property>
<property name="label" translatable="yes">Resolution Scale:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">5</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="_resScaleCombo">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Resolution Scale applied to applicable render targets.</property>
<property name="active_id">1</property>
<items>
<item id="1" translatable="yes">Native (720p/1080p)</item>
<item id="2" translatable="yes">2x (1440p/2160p)</item>
<item id="3" translatable="yes">3x (2160p/3240p)</item>
<item id="4" translatable="yes">4x (2880p/4320p)</item>
<item id="-1" translatable="yes">Custom (not recommended)</item>
</items>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="_resScaleText">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Floating point resolution scale, such as 1.5. Non-integral scales are more likely to cause issues or crash.</property>
<property name="valign">center</property>
<property name="caps_lock_warning">False</property>
<property name="placeholder-text">1.0</property>
<property name="input-purpose">GTK_INPUT_PURPOSE_NUMBER</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">5</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
@ -1722,7 +1786,7 @@
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">5</property>
<property name="position">0</property>
<property name="position">1</property>
</packing>
</child>
</object>