Shaders - Using T_Set in some places
This commit is contained in:
parent
d83743d072
commit
c9155abd12
2 changed files with 12 additions and 9 deletions
2
ebcl
2
ebcl
|
@ -1 +1 @@
|
|||
Subproject commit cdbc81094d266f007b22825d0e5e836804654381
|
||||
Subproject commit 9f666eea4946dd3de23203f6c829a540a2708565
|
19
shaders.cc
19
shaders.cc
|
@ -2,6 +2,8 @@
|
|||
#include "shaders.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#include <ebcl/Sets.hh>
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -585,7 +587,8 @@ T_ShaderPipeline T_ShaderManager::pipeline(
|
|||
|
||||
void T_ShaderManager::update( )
|
||||
{
|
||||
T_Array< T_String > temp;
|
||||
using namespace ebcl;
|
||||
T_Set< T_String > temp{ UseTag< ArrayBacked< 64 > >( ) };
|
||||
T_StringBuilder sb;
|
||||
inputs_.clear( );
|
||||
|
||||
|
@ -610,12 +613,12 @@ void T_ShaderManager::update( )
|
|||
}
|
||||
|
||||
// Remove all marked entries
|
||||
for ( auto const& s : temp ) {
|
||||
missing_.remove( s );
|
||||
for ( auto i = 0u ; i < temp.size( ) ; i ++ ) {
|
||||
missing_.remove( temp[ i ] );
|
||||
}
|
||||
temp.clear( );
|
||||
|
||||
// Reset programs that need to be updated
|
||||
temp.clear( );
|
||||
for ( auto it = updates_.begin( ) ; it.valid( ) ; ) {
|
||||
auto const* p( programIndex_.get( *it ) );
|
||||
if ( p ) {
|
||||
|
@ -636,8 +639,8 @@ void T_ShaderManager::update( )
|
|||
}
|
||||
|
||||
// Reset pipelines affected by the programs above
|
||||
for ( auto const& pName : temp ) {
|
||||
auto& pipeline( *pipelines_.get( pName ) );
|
||||
for ( auto i = 0u ; i < temp.size( ) ; i ++ ) {
|
||||
auto& pipeline( *pipelines_.get( temp[ i ] ) );
|
||||
if ( pipeline.id != 0 ) {
|
||||
glDeleteProgramPipelines( 1 , &pipeline.id );
|
||||
pipeline.id = 0;
|
||||
|
@ -658,8 +661,8 @@ void T_ShaderManager::update( )
|
|||
printf( "%s" , sb.data( ) );
|
||||
|
||||
// Try to initialise all affected pipelines
|
||||
for ( auto const& pName : temp ) {
|
||||
initPipeline( *pipelines_.get( pName ) );
|
||||
for ( auto i = 0u ; i < temp.size( ) ; i ++ ) {
|
||||
initPipeline( *pipelines_.get( temp[ i ] ) );
|
||||
}
|
||||
|
||||
updates_.clear( );
|
||||
|
|
Loading…
Reference in a new issue