Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
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
Next Next commit
Some material system clean-up
  • Loading branch information
VReaperV committed Mar 2, 2025
commit 300f36bcfae9e3277537c4f752a21b87b1fb0d8c
8 changes: 3 additions & 5 deletions src/engine/renderer/Material.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1604,9 +1604,11 @@ void MaterialSystem::UpdateDynamicSurfaces() {

void MaterialSystem::UpdateFrameData() {
atomicCommandCountersBuffer.BindBufferBase( GL_SHADER_STORAGE_BUFFER, Util::ordinal( BufferBind::COMMAND_COUNTERS_STORAGE ) );

gl_clearSurfacesShader->BindProgram( 0 );
gl_clearSurfacesShader->SetUniform_Frame( nextFrame );
gl_clearSurfacesShader->DispatchCompute( MAX_VIEWS, 1, 1 );

atomicCommandCountersBuffer.UnBindBufferBase( GL_SHADER_STORAGE_BUFFER, Util::ordinal( BufferBind::COMMAND_COUNTERS_STORAGE ) );

GL_CheckErrors();
Expand Down Expand Up @@ -1774,11 +1776,8 @@ void MaterialSystem::StartFrame() {
if ( !generatedWorldCommandBuffer ) {
return;
}

frames[nextFrame].viewCount = 0;

// renderedMaterials.clear();
// UpdateDynamicSurfaces();
// UpdateFrameData();
}

void MaterialSystem::EndFrame() {
Expand Down Expand Up @@ -2059,7 +2058,6 @@ void MaterialSystem::RenderMaterials( const shaderSort_t fromSort, const shaderS
renderedMaterials.clear();
UpdateDynamicSurfaces();
UpdateFrameData();
// StartFrame();

// Make sure compute dispatches from the last frame finished writing to memory
glMemoryBarrier( GL_COMMAND_BARRIER_BIT );
Expand Down