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

xrRender: It's now possible to not duplicate textures in RAM (all renders) #585

Merged
merged 4 commits into from
May 9, 2020

Conversation

ShokerStlk
Copy link
Contributor

@ShokerStlk ShokerStlk commented Apr 26, 2020

Experimental, off by default. Can be moved to game options.
Thnx to iOrange for idea and help.

Added new console command "texture_disable_managed" and new launch key "-nomanagedtex". Both do the same thing.

OpenGL already have such behavior by default.

In vanila engine almost every texture is duplicated to RAM.
It's has point for DX9 since vid_restart require to reload every texture. But for DX10+ it's not needed.

Currently the only drawback i see - R1\R2 on vid_restart require to reload all active textures from HDD. Still it takes ~3 seconds for SSD.

With not vanila gamedata (additional textures) i got RAM usage drop:
R1\R2: from 1.3 GB to 800 Mb (32-bit)
R3\R4: from 2.2 GB to 650-900 Mb (32-bit)

Not tested for Release build. But should be fine.

…ders) - experimental, off by default.

Thnx to iOrange for idea and help.
Added new console command  "texture_disable_managed" and new launch key "-nomanagedtex".
Copy link
Contributor

@vTurbine vTurbine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks well, but personally I'm against adding an additional console command. Or are there some use cases I don't know about?

src/Layers/xrRender/ResourceManager.cpp Show resolved Hide resolved
src/Layers/xrRenderDX10/dx10Texture.cpp Show resolved Hide resolved
src/Layers/xrRenderDX10/dx10Texture.cpp Outdated Show resolved Hide resolved
src/Layers/xrRenderDX9/dx9HW.cpp Outdated Show resolved Hide resolved
src/xrEngine/defines.h Outdated Show resolved Hide resolved
src/xrEngine/xr_ioc_cmd.cpp Outdated Show resolved Hide resolved
src/Layers/xrRenderPC_R1/FStaticRender.cpp Outdated Show resolved Hide resolved
src/Layers/xrRenderPC_R1/FStaticRender.h Outdated Show resolved Hide resolved
Copy link
Member

@Xottab-DUTY Xottab-DUTY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can completely remove -no_staging key and make a new console command r__no_texture_staging that will only apply after vid_restart

@ShokerStlk
Copy link
Contributor Author

ShokerStlk commented Apr 29, 2020

Looks well, but personally I'm against adding an additional console command. Or are there some use cases I don't know about?

For new checkbox in game options (i use it in my fork).

We can completely remove -no_staging key and make a new console command r__no_texture_staging

Should i rename console command like this?
-no_staging here is just for backward compatibility.

... that will only apply after vid_restart

Currently, you need to restart the entire game. I see no profit to bind this to vid_restart, but it's actually may be possible. Still it's just make things more complicated and bugged.

@ShokerStlk
Copy link
Contributor Author

ShokerStlk commented May 1, 2020

Update is here

src/Layers/xrRenderDX10/dx10Texture.cpp Outdated Show resolved Hide resolved
src/Layers/xrRenderDX10/dx10Texture.cpp Outdated Show resolved Hide resolved
src/Layers/xrRender/xrRender_console.cpp Outdated Show resolved Hide resolved
src/Layers/xrRender/xrRender_console.cpp Outdated Show resolved Hide resolved
src/Layers/xrRenderPC_R2/r2.h Outdated Show resolved Hide resolved
src/Layers/xrRenderPC_R2/r2.cpp Outdated Show resolved Hide resolved
src/Layers/xrRender/D3DXRenderBase.cpp Outdated Show resolved Hide resolved
src/Layers/xrRender/D3DXRenderBase.cpp Outdated Show resolved Hide resolved
src/Layers/xrRender/D3DXRenderBase.cpp Outdated Show resolved Hide resolved
src/Layers/xrRender/D3DXRenderBase.cpp Outdated Show resolved Hide resolved
src/Layers/xrRender/D3DXRenderBase.cpp Outdated Show resolved Hide resolved
@ShokerStlk
Copy link
Contributor Author

Updated again

src/Layers/xrRender/D3DXRenderBase.cpp Outdated Show resolved Hide resolved
@Xottab-DUTY Xottab-DUTY merged commit a6c8d77 into OpenXRay:xd_dev May 9, 2020
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.

3 participants