samplerobj.h revision 3464ebd5
13464ebd5Sriastradh/*
23464ebd5Sriastradh * Mesa 3-D graphics library
33464ebd5Sriastradh *
43464ebd5Sriastradh * Copyright (C) 2011  VMware, Inc.  All Rights Reserved.
53464ebd5Sriastradh *
63464ebd5Sriastradh * Permission is hereby granted, free of charge, to any person obtaining a
73464ebd5Sriastradh * copy of this software and associated documentation files (the "Software"),
83464ebd5Sriastradh * to deal in the Software without restriction, including without limitation
93464ebd5Sriastradh * the rights to use, copy, modify, merge, publish, distribute, sublicense,
103464ebd5Sriastradh * and/or sell copies of the Software, and to permit persons to whom the
113464ebd5Sriastradh * Software is furnished to do so, subject to the following conditions:
123464ebd5Sriastradh *
133464ebd5Sriastradh * The above copyright notice and this permission notice shall be included
143464ebd5Sriastradh * in all copies or substantial portions of the Software.
153464ebd5Sriastradh *
163464ebd5Sriastradh * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
173464ebd5Sriastradh * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
183464ebd5Sriastradh * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
193464ebd5Sriastradh * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
203464ebd5Sriastradh * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
213464ebd5Sriastradh * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
223464ebd5Sriastradh */
233464ebd5Sriastradh
243464ebd5Sriastradh
253464ebd5Sriastradh
263464ebd5Sriastradh#ifndef SAMPLEROBJ_H
273464ebd5Sriastradh#define SAMPLEROBJ_H
283464ebd5Sriastradh
293464ebd5Sriastradhstruct dd_function_table;
303464ebd5Sriastradh
313464ebd5Sriastradhstatic INLINE struct gl_sampler_object *
323464ebd5Sriastradh_mesa_get_samplerobj(struct gl_context *ctx, GLuint unit)
333464ebd5Sriastradh{
343464ebd5Sriastradh   if (ctx->Texture.Unit[unit].Sampler)
353464ebd5Sriastradh      return ctx->Texture.Unit[unit].Sampler;
363464ebd5Sriastradh   else
373464ebd5Sriastradh      return &ctx->Texture.Unit[unit]._Current->Sampler;
383464ebd5Sriastradh}
393464ebd5Sriastradh
403464ebd5Sriastradhextern void
413464ebd5Sriastradh_mesa_reference_sampler_object(struct gl_context *ctx,
423464ebd5Sriastradh                               struct gl_sampler_object **ptr,
433464ebd5Sriastradh                               struct gl_sampler_object *samp);
443464ebd5Sriastradh
453464ebd5Sriastradhextern void
463464ebd5Sriastradh_mesa_init_sampler_object(struct gl_sampler_object *sampObj, GLuint name);
473464ebd5Sriastradh
483464ebd5Sriastradhextern struct gl_sampler_object *
493464ebd5Sriastradh_mesa_new_sampler_object(struct gl_context *ctx, GLuint name);
503464ebd5Sriastradh
513464ebd5Sriastradhextern void
523464ebd5Sriastradh_mesa_delete_sampler_object(struct gl_context *ctx,
533464ebd5Sriastradh                            struct gl_sampler_object *sampObj);
543464ebd5Sriastradh
553464ebd5Sriastradhextern void
563464ebd5Sriastradh_mesa_init_sampler_object_functions(struct dd_function_table *driver);
573464ebd5Sriastradh
583464ebd5Sriastradhextern void
593464ebd5Sriastradh_mesa_init_sampler_object_dispatch(struct _glapi_table *disp);
603464ebd5Sriastradh
613464ebd5Sriastradh
623464ebd5Sriastradh#endif /* SAMPLEROBJ_H */
63