X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Frender%2Fprogramdata.cpp;h=b21c395cf04c27f1084492294dbd2635993af5df;hb=f1244e29afd2a36aafc2373d485457b4cb0411ff;hp=f3c6108c767284a9e158ee88df7fdd9a5986873d;hpb=bb386d895f5fce2f0099886fdf7e7073b18246e8;p=libs%2Fgl.git diff --git a/source/render/programdata.cpp b/source/render/programdata.cpp index f3c6108c..b21c395c 100644 --- a/source/render/programdata.cpp +++ b/source/render/programdata.cpp @@ -565,7 +565,14 @@ void ProgramData::update_block_uniform_indices(SharedBlock &block, const Program if(info.bind_point>=0) { if(!buffer) - buffer = new Buffer(UNIFORM_BUFFER); + { + buffer = new Buffer(); + +#ifdef DEBUG + if(!debug_name.empty()) + buffer->set_debug_name(debug_name); +#endif + } BufferBackedUniformBlock *bb_block = new BufferBackedUniformBlock(info.data_size); block.block = bb_block; @@ -650,11 +657,6 @@ void ProgramData::apply() const prog_begin->masks.dirty = 0; - /* If any blocks stored in the buffer were updated, bind the buffer here - to avoid state thrashing. */ - if(buffered_blocks_updated && !ARB_direct_state_access) - buffer->bind(); - if(last_buffer_block!=old_last_block) { unsigned required_size = last_buffer_block->get_required_buffer_size(); @@ -663,8 +665,13 @@ void ProgramData::apply() const if(buffer->get_size()>0) { delete buffer; - buffer = new Buffer(UNIFORM_BUFFER); + buffer = new Buffer(); last_buffer_block->change_buffer(buffer); + +#ifdef DEBUG + if(!debug_name.empty()) + buffer->set_debug_name(debug_name); +#endif } buffer->storage(required_size); @@ -677,6 +684,17 @@ void ProgramData::apply() const i->block->apply(i->bind_point); } +void ProgramData::set_debug_name(const string &name) +{ +#ifdef DEBUG + debug_name = name; + if(buffer) + buffer->set_debug_name(name); +#else + (void)name; +#endif +} + ProgramData::TaggedUniform::TaggedUniform(): value(0)