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

Add r_materialSystemSkip #1478

Merged
merged 1 commit into from
Jan 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/engine/renderer/Material.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2061,6 +2061,10 @@ void MaterialSystem::RenderMaterials( const shaderSort_t fromSort, const shaderS
return;
}

if ( r_materialSystemSkip.Get() ) {
return;
}

if ( frameStart ) {
renderedMaterials.clear();
UpdateDynamicSurfaces();
Expand Down
2 changes: 1 addition & 1 deletion src/engine/renderer/tr_backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4767,7 +4767,7 @@ This is done so various debugging facilities will work properly
*/
static void RB_RenderPostProcess()
{
if ( glConfig2.usingMaterialSystem ) {
if ( glConfig2.usingMaterialSystem && !r_materialSystemSkip.Get() ) {
// Dispatch the cull compute shaders for queued once we're done with post-processing
// We'll only use the results from those shaders in the next frame so we don't block the pipeline
materialSystem.CullSurfaces();
Expand Down
1 change: 1 addition & 0 deletions src/engine/renderer/tr_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Cvar::Cvar<bool> r_materialSystem( "r_materialSystem", "Use Material System", Cvar::NONE, false );
Cvar::Cvar<bool> r_gpuFrustumCulling( "r_gpuFrustumCulling", "Use frustum culling on the GPU for the Material System", Cvar::NONE, true );
Cvar::Cvar<bool> r_gpuOcclusionCulling( "r_gpuOcclusionCulling", "Use occlusion culling on the GPU for the Material System", Cvar::NONE, false );
Cvar::Cvar<bool> r_materialSystemSkip( "r_materialSystemSkip", "Temporarily skip Material System rendering, using only core renderer instead", Cvar::NONE, false );
cvar_t *r_lightStyles;
cvar_t *r_exportTextures;
cvar_t *r_heatHaze;
Expand Down
1 change: 1 addition & 0 deletions src/engine/renderer/tr_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -2912,6 +2912,7 @@ enum class shaderProfilerRenderSubGroupsMode {
extern Cvar::Cvar<bool> r_materialSystem;
extern Cvar::Cvar<bool> r_gpuFrustumCulling;
extern Cvar::Cvar<bool> r_gpuOcclusionCulling;
extern Cvar::Cvar<bool> r_materialSystemSkip;
extern cvar_t *r_lightStyles;
extern cvar_t *r_exportTextures;
extern cvar_t *r_heatHaze;
Expand Down
4 changes: 2 additions & 2 deletions src/engine/renderer/tr_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1999,7 +1999,7 @@ static void R_SortDrawSurfs()
// check for any pass through drawing, which
// may cause another view to be rendered first
// Material system does its own handling of portal surfaces
if ( glConfig2.usingMaterialSystem ) {
if ( glConfig2.usingMaterialSystem && !r_materialSystemSkip.Get() ) {
if ( tr.viewParms.portalLevel == 0 ) {
materialSystem.AddPortalSurfaces();
currentView = 0;
Expand Down Expand Up @@ -2524,7 +2524,7 @@ void R_RenderView( viewParms_t *parms )

R_SetupFrustum();

if ( glConfig2.usingMaterialSystem ) {
if ( glConfig2.usingMaterialSystem && !r_materialSystemSkip.Get() ) {
tr.viewParms.viewID = tr.viewCount;
materialSystem.QueueSurfaceCull( tr.viewCount, tr.viewParms.pvsOrigin, (frustum_t*) tr.viewParms.frustums[0] );
materialSystem.AddAutospriteSurfaces();
Expand Down
Loading