mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 15:38:09 +02:00
mesa: make _mesa_reference_shader_program() an inline function
which wraps _mesa_reference_shader_program_(), similar to what we do for other reference-counted objects. Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
parent
3f687e995f
commit
6d9aed19f3
2 changed files with 15 additions and 4 deletions
|
|
@ -193,9 +193,9 @@ _mesa_lookup_shader_err(struct gl_context *ctx, GLuint name, const char *caller)
|
|||
* Then set ptr to point to shProg, incrementing its refcount.
|
||||
*/
|
||||
void
|
||||
_mesa_reference_shader_program(struct gl_context *ctx,
|
||||
struct gl_shader_program **ptr,
|
||||
struct gl_shader_program *shProg)
|
||||
_mesa_reference_shader_program_(struct gl_context *ctx,
|
||||
struct gl_shader_program **ptr,
|
||||
struct gl_shader_program *shProg)
|
||||
{
|
||||
assert(ptr);
|
||||
if (*ptr == shProg) {
|
||||
|
|
|
|||
|
|
@ -62,9 +62,20 @@ _mesa_lookup_shader_err(struct gl_context *ctx, GLuint name, const char *caller)
|
|||
|
||||
|
||||
extern void
|
||||
_mesa_reference_shader_program(struct gl_context *ctx,
|
||||
_mesa_reference_shader_program_(struct gl_context *ctx,
|
||||
struct gl_shader_program **ptr,
|
||||
struct gl_shader_program *shProg);
|
||||
|
||||
static inline void
|
||||
_mesa_reference_shader_program(struct gl_context *ctx,
|
||||
struct gl_shader_program **ptr,
|
||||
struct gl_shader_program *shProg)
|
||||
{
|
||||
if (*ptr != shProg)
|
||||
_mesa_reference_shader_program_(ctx, ptr, shProg);
|
||||
}
|
||||
|
||||
|
||||
extern void
|
||||
_mesa_init_shader(struct gl_context *ctx, struct gl_shader *shader);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue