diff options
| author | Andre Weissflog <floooh@gmail.com> | 2019-08-24 15:46:06 +0200 |
|---|---|---|
| committer | Andre Weissflog <floooh@gmail.com> | 2019-08-24 15:46:06 +0200 |
| commit | 3601a496890f6fe6df2c633ba22545c406ae1df4 (patch) | |
| tree | 26e2641c4ad05a056faeada4f5f8322ad6aefb02 /util | |
| parent | 73061bd22fdc582c7c6cd40f020e073674c50043 (diff) | |
sokol_gl.h: allow to override shader in sgl_make_pipeline()
Diffstat (limited to 'util')
| -rw-r--r-- | util/sokol_gl.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/util/sokol_gl.h b/util/sokol_gl.h index e1db6b53..0c846db1 100644 --- a/util/sokol_gl.h +++ b/util/sokol_gl.h @@ -1343,7 +1343,9 @@ static void _sgl_init_pipeline(sgl_pipeline pip_id, const sg_pipeline_desc* in_d rgba->offset = offsetof(_sgl_vertex_t, rgba); rgba->format = SG_VERTEXFORMAT_UBYTE4N; } - desc.shader = _sgl.shd; + if (in_desc->shader.id == SG_INVALID_ID) { + desc.shader = _sgl.shd; + } desc.index_type = SG_INDEXTYPE_NONE; desc.blend.color_format = _sgl.desc.color_format; desc.blend.depth_format = _sgl.desc.depth_format; @@ -1832,6 +1834,7 @@ SOKOL_API_IMPL void sgl_shutdown(void) { sg_destroy_image(_sgl.def_img); sg_destroy_shader(_sgl.shd); _sgl_destroy_pipeline(_sgl.def_pip); + // FIXME: need to destroy ALL valid pipeline objects in pool here _sgl_discard_pipeline_pool(); _sgl.init_cookie = 0; } |