[Mesa-dev] [PATCH] mesa/main: clean up sampler lookup functions
Samuel Pitoiset
samuel.pitoiset at gmail.com
Thu Mar 9 00:49:45 UTC 2017
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
src/mesa/main/samplerobj.c | 32 ++++----------------------------
1 file changed, 4 insertions(+), 28 deletions(-)
diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c
index c073f4221e..61b73e8905 100644
--- a/src/mesa/main/samplerobj.c
+++ b/src/mesa/main/samplerobj.c
@@ -50,32 +50,8 @@ _mesa_lookup_samplerobj(struct gl_context *ctx, GLuint name)
_mesa_HashLookup(ctx->Shared->SamplerObjects, name);
}
-static struct gl_sampler_object *
-_mesa_lookup_samplerobj_locked(struct gl_context *ctx, GLuint name)
-{
- if (name == 0)
- return NULL;
- else
- return (struct gl_sampler_object *)
- _mesa_HashLookupLocked(ctx->Shared->SamplerObjects, name);
-}
-
-static inline void
-begin_samplerobj_lookups(struct gl_context *ctx)
-{
- _mesa_HashLockMutex(ctx->Shared->SamplerObjects);
-}
-
-
-static inline void
-end_samplerobj_lookups(struct gl_context *ctx)
-{
- _mesa_HashUnlockMutex(ctx->Shared->SamplerObjects);
-}
-
-
static inline struct gl_sampler_object *
-lookup_samplerobj_locked(struct gl_context *ctx, GLuint name)
+_mesa_lookup_samplerobj_locked(struct gl_context *ctx, GLuint name)
{
return (struct gl_sampler_object *)
_mesa_HashLookupLocked(ctx->Shared->SamplerObjects, name);
@@ -363,7 +339,7 @@ _mesa_BindSamplers(GLuint first, GLsizei count, const GLuint *samplers)
* their parameters are valid and no other error occurs."
*/
- begin_samplerobj_lookups(ctx);
+ _mesa_HashLockMutex(ctx->Shared->SamplerObjects);
for (i = 0; i < count; i++) {
const GLuint unit = first + i;
@@ -375,7 +351,7 @@ _mesa_BindSamplers(GLuint first, GLsizei count, const GLuint *samplers)
if (currentSampler && currentSampler->Name == samplers[i])
sampObj = currentSampler;
else
- sampObj = lookup_samplerobj_locked(ctx, samplers[i]);
+ sampObj = _mesa_lookup_samplerobj_locked(ctx, samplers[i]);
/* The ARB_multi_bind spec says:
*
@@ -403,7 +379,7 @@ _mesa_BindSamplers(GLuint first, GLsizei count, const GLuint *samplers)
}
}
- end_samplerobj_lookups(ctx);
+ _mesa_HashUnlockMutex(ctx->Shared->SamplerObjects);
} else {
/* Unbind all samplers in the range <first> through <first>+<count>-1 */
for (i = 0; i < count; i++) {
--
2.12.0
More information about the mesa-dev
mailing list