205 void asc_shader_free_codes(AscShaderCodes codes) { |
205 void asc_shader_free_codes(AscShaderCodes codes) { |
206 cxFreeDefault(codes.vtx); |
206 cxFreeDefault(codes.vtx); |
207 cxFreeDefault(codes.frag); |
207 cxFreeDefault(codes.frag); |
208 } |
208 } |
209 |
209 |
210 const void *asc_shader_register(unsigned int id, asc_shader_create_func create_func) { |
210 const void *asc_shader_register(unsigned int id, asc_shader_create_func create_func, int create_flags) { |
211 AscGLContext *glctx = asc_active_glctx; |
211 AscGLContext *glctx = asc_active_glctx; |
212 #ifndef NDEBUG |
212 #ifndef NDEBUG |
213 { |
213 { |
214 const AscShaderProgram *prog = asc_shader_lookup(id); |
214 const AscShaderProgram *prog = asc_shader_lookup(id); |
215 if (prog != NULL) { |
215 if (prog != NULL) { |
231 if (prog->id == id) return prog; |
231 if (prog->id == id) return prog; |
232 } |
232 } |
233 return NULL; |
233 return NULL; |
234 } |
234 } |
235 |
235 |
236 const void *asc_shader_lookup_or_create(unsigned int id, asc_shader_create_func create_func) { |
236 const void *asc_shader_lookup_or_create(unsigned int id, asc_shader_create_func create_func, int create_flags) { |
237 const AscShaderProgram *prog = asc_shader_lookup(id); |
237 const AscShaderProgram *prog = asc_shader_lookup(id); |
238 if (prog == NULL) { |
238 if (prog == NULL) { |
239 return asc_shader_register(id, create_func); |
239 return asc_shader_register(id, create_func, create_flags); |
240 } |
240 } |
241 return prog; |
241 return prog; |
242 } |
242 } |
243 |
243 |
244 void asc_shader_clear_registry(void) { |
244 void asc_shader_clear_registry(void) { |