Gawain : Add workaround to fix bad sync of the program_in_use flag.
This commit is contained in:
@@ -65,6 +65,7 @@ int GWN_batch_vertbuf_add_ex(Gwn_Batch*, Gwn_VertBuf*, bool own_vbo);
|
||||
GWN_batch_vertbuf_add_ex(batch, verts, false)
|
||||
|
||||
void GWN_batch_program_set(Gwn_Batch*, GLuint program, const Gwn_ShaderInterface*);
|
||||
void GWN_batch_program_unset(Gwn_Batch*);
|
||||
// Entire batch draws with one shader program, but can be redrawn later with another program.
|
||||
// Vertex shader's inputs must be compatible with the batch's vertex format.
|
||||
|
||||
|
||||
@@ -110,6 +110,14 @@ void GWN_batch_program_set(Gwn_Batch* batch, GLuint program, const Gwn_ShaderInt
|
||||
GWN_batch_program_use_begin(batch); // hack! to make Batch_Uniform* simpler
|
||||
}
|
||||
|
||||
// fclem : hack !
|
||||
// we need this because we don't want to unbind the shader between drawcalls
|
||||
// but we still want the correct shader to be bound outside the draw manager
|
||||
void GWN_batch_program_unset(Gwn_Batch* batch)
|
||||
{
|
||||
batch->program_in_use = false;
|
||||
}
|
||||
|
||||
static void Batch_update_program_bindings(Gwn_Batch* batch)
|
||||
{
|
||||
// disable all as a precaution
|
||||
|
||||
@@ -1809,6 +1809,9 @@ static void draw_geometry_execute(DRWShadingGroup *shgroup, Gwn_Batch *geom)
|
||||
else {
|
||||
GWN_batch_draw_stupid(geom);
|
||||
}
|
||||
/* XXX this just tells gawain we are done with the shader.
|
||||
* This does not unbind the shader. */
|
||||
GWN_batch_program_unset(geom);
|
||||
}
|
||||
|
||||
static void draw_geometry(DRWShadingGroup *shgroup, Gwn_Batch *geom, const float (*obmat)[4], ID *ob_data)
|
||||
|
||||
Reference in New Issue
Block a user