Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renderer: rework the enablement of high-precision/float texture formats #1164

Merged
merged 6 commits into from
Jun 1, 2024

Conversation

illwieckz
Copy link
Member

Rework the enablement of high-precision/float texture formats according to available features and enabled options.

@illwieckz illwieckz force-pushed the illwieckz/high-precision branch from 2b7901c to c3eba61 Compare May 29, 2024 13:11
@slipher
Copy link
Member

slipher commented May 29, 2024

LGTM

@illwieckz illwieckz force-pushed the illwieckz/high-precision branch from c3eba61 to 303e06f Compare May 30, 2024 03:24
@illwieckz
Copy link
Member Author

illwieckz commented May 30, 2024

In fact the commit tr_image: also check if high precision is enabled for doing RGBA32UI was wrong. We probably need some GLSL change if float are not available and not used. Problem is… It looks like I added a check elsewhere to not run this code if floats are not available. I removed this commit and added somme ASSERT instead.

The rest works. I added a missing check for the _lighttileRender fallback and it works as expected.

@illwieckz illwieckz force-pushed the illwieckz/high-precision branch 2 times, most recently from 05a69b6 to 1c64967 Compare May 30, 2024 03:36
@illwieckz
Copy link
Member Author

illwieckz commented May 30, 2024

What we can do anyway is to use GL_RGBA16F instead of GL_RGBA32F when r_highPrecisionRendering is disabled. This doesn't break the rendering and can be useful to save on VRAM on low end hardware:

With r_highPrecisionRendering enabled:

]/listImages _*tile*Render
------------------------------------------------------------------
num   width heigth layers mm  type format   wrap.t   wrap.s   name
------------------------------------------------------------------
50      640    360      1 no  2D   RGBA32F  t.1clmp  s.1clmp  _depthtile1Render
51      160     90      1 no  2D   RGBA32F  t.clmp   s.clmp   _depthtile2Render
52      160     90      4 no  3D   RGBA32UI t.clmp   s.clmp   _lighttileRender
------------------------------------------------------------------
302400 total texels (not including mipmaps)
4.61 MB total image memory (estimated)
823 total images
------------------------------------------------------------------

With r_highPrecisionRendering disabled:

]/listImages _*tile*Render
------------------------------------------------------------------
num   width heigth layers mm  type format   wrap.t   wrap.s   name
------------------------------------------------------------------
50      640    360      1 no  2D   RGBA16F  t.1clmp  s.1clmp  _depthtile1Render
51      160     90      1 no  2D   RGBA16F  t.clmp   s.clmp   _depthtile2Render
52      160     90      4 no  3D   RGBA8    t.clmp   s.clmp   _lighttileRender
------------------------------------------------------------------
302400 total texels (not including mipmaps)
2.08 MB total image memory (estimated)
823 total images
------------------------------------------------------------------

The current state of the PR pleases me, I think I have nothing to add.

@illwieckz illwieckz force-pushed the illwieckz/high-precision branch from 93730f8 to 9474dda Compare May 30, 2024 04:23
@illwieckz illwieckz merged commit f42c220 into master Jun 1, 2024
9 checks passed
@illwieckz illwieckz deleted the illwieckz/high-precision branch June 1, 2024 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants