ReactOS  r76032
texparam.c
Go to the documentation of this file.
1 /*
2  * Mesa 3-D graphics library
3  * Version: 7.5
4  *
5  * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
6  * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining a
9  * copy of this software and associated documentation files (the "Software"),
10  * to deal in the Software without restriction, including without limitation
11  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12  * and/or sell copies of the Software, and to permit persons to whom the
13  * Software is furnished to do so, subject to the following conditions:
14  *
15  * The above copyright notice and this permission notice shall be included
16  * in all copies or substantial portions of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21  * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
22  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24  */
25 
32 #include <precomp.h>
33 
38 static GLboolean
40 {
41  switch (wrap) {
42  case GL_CLAMP:
43  case GL_REPEAT:
44  case GL_MIRRORED_REPEAT:
45  return GL_TRUE;
46  default:
47  break;
48  }
49 
50  _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(param=0x%x)", wrap );
51  return GL_FALSE;
52 }
53 
54 
62 static struct gl_texture_object *
64 {
65  struct gl_texture_unit *texUnit;
66 
67  texUnit = &ctx->Texture.Unit;
68 
69  switch (target) {
70  case GL_TEXTURE_1D:
71  return texUnit->CurrentTex[TEXTURE_1D_INDEX];
72  case GL_TEXTURE_2D:
73  return texUnit->CurrentTex[TEXTURE_2D_INDEX];
75  if (ctx->Extensions.ARB_texture_cube_map) {
76  return texUnit->CurrentTex[TEXTURE_CUBE_INDEX];
77  }
78  break;
79  default:
80  ;
81  }
82 
84  "gl%sTexParameter(target)", get ? "Get" : "");
85  return NULL;
86 }
87 
88 
93 static inline void
94 flush(struct gl_context *ctx)
95 {
97 }
98 
99 
108 static inline void
109 incomplete(struct gl_context *ctx, struct gl_texture_object *texObj)
110 {
112  texObj->_Complete = GL_FALSE;
113 }
114 
115 
120 static GLboolean
122  struct gl_texture_object *texObj,
123  GLenum pname, const GLint *params)
124 {
125  switch (pname) {
127  if (texObj->Sampler.MinFilter == params[0])
128  return GL_FALSE;
129  switch (params[0]) {
130  case GL_NEAREST:
131  case GL_LINEAR:
132  incomplete(ctx, texObj);
133  texObj->Sampler.MinFilter = params[0];
134  return GL_TRUE;
139  incomplete(ctx, texObj);
140  texObj->Sampler.MinFilter = params[0];
141  return GL_TRUE;
142  /* fall-through */
143  default:
144  goto invalid_param;
145  }
146  return GL_FALSE;
147 
149  if (texObj->Sampler.MagFilter == params[0])
150  return GL_FALSE;
151  switch (params[0]) {
152  case GL_NEAREST:
153  case GL_LINEAR:
154  flush(ctx); /* does not effect completeness */
155  texObj->Sampler.MagFilter = params[0];
156  return GL_TRUE;
157  default:
158  goto invalid_param;
159  }
160  return GL_FALSE;
161 
162  case GL_TEXTURE_WRAP_S:
163  if (texObj->Sampler.WrapS == params[0])
164  return GL_FALSE;
165  if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) {
166  flush(ctx);
167  texObj->Sampler.WrapS = params[0];
168  return GL_TRUE;
169  }
170  return GL_FALSE;
171 
172  case GL_TEXTURE_WRAP_T:
173  if (texObj->Sampler.WrapT == params[0])
174  return GL_FALSE;
175  if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) {
176  flush(ctx);
177  texObj->Sampler.WrapT = params[0];
178  return GL_TRUE;
179  }
180  return GL_FALSE;
181 
182  case GL_TEXTURE_WRAP_R:
183  if (texObj->Sampler.WrapR == params[0])
184  return GL_FALSE;
185  if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) {
186  flush(ctx);
187  texObj->Sampler.WrapR = params[0];
188  return GL_TRUE;
189  }
190  return GL_FALSE;
191 
192  default:
193  goto invalid_pname;
194  }
195 
196 invalid_pname:
197  _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=%s)",
198  _mesa_lookup_enum_by_nr(pname));
199  return GL_FALSE;
200 
201 invalid_param:
202  _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(param=%s)",
203  _mesa_lookup_enum_by_nr(params[0]));
204  return GL_FALSE;
205 }
206 
207 
212 static GLboolean
214  struct gl_texture_object *texObj,
215  GLenum pname, const GLfloat *params)
216 {
217  switch (pname) {
218 
219  case GL_TEXTURE_PRIORITY:
220  flush(ctx);
221  texObj->Priority = CLAMP(params[0], 0.0F, 1.0F);
222  return GL_TRUE;
223 
225  if (ctx->Extensions.EXT_texture_filter_anisotropic) {
226  if (texObj->Sampler.MaxAnisotropy == params[0])
227  return GL_FALSE;
228  if (params[0] < 1.0) {
229  _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
230  return GL_FALSE;
231  }
232  flush(ctx);
233  /* clamp to max, that's what NVIDIA does */
234  texObj->Sampler.MaxAnisotropy = MIN2(params[0],
235  ctx->Const.MaxTextureMaxAnisotropy);
236  return GL_TRUE;
237  }
238  else {
239  static GLuint count = 0;
240  if (count++ < 10)
242  "glTexParameter(pname=GL_TEXTURE_MAX_ANISOTROPY_EXT)");
243  }
244  return GL_FALSE;
245 
247  flush(ctx);
248  texObj->Sampler.BorderColor.f[RCOMP] = CLAMP(params[0], 0.0F, 1.0F);
249  texObj->Sampler.BorderColor.f[GCOMP] = CLAMP(params[1], 0.0F, 1.0F);
250  texObj->Sampler.BorderColor.f[BCOMP] = CLAMP(params[2], 0.0F, 1.0F);
251  texObj->Sampler.BorderColor.f[ACOMP] = CLAMP(params[3], 0.0F, 1.0F);
252  return GL_TRUE;
253 
254  default:
255  _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname);
256  }
257  return GL_FALSE;
258 }
259 
260 
261 void GLAPIENTRY
263 {
264  GLboolean need_update;
265  struct gl_texture_object *texObj;
266  GET_CURRENT_CONTEXT(ctx);
268 
269  texObj = get_texobj(ctx, target, GL_FALSE);
270  if (!texObj)
271  return;
272 
273  switch (pname) {
276  case GL_TEXTURE_WRAP_S:
277  case GL_TEXTURE_WRAP_T:
278  case GL_TEXTURE_WRAP_R:
283  {
284  /* convert float param to int */
285  GLint p[4];
286  p[0] = (GLint) param;
287  p[1] = p[2] = p[3] = 0;
288  need_update = set_tex_parameteri(ctx, texObj, pname, p);
289  }
290  break;
295  {
296  GLint p[4];
297  p[0] = (GLint) param;
298  p[1] = p[2] = p[3] = 0;
299  need_update = set_tex_parameteri(ctx, texObj, pname, p);
300  }
301  break;
302  default:
303  {
304  /* this will generate an error if pname is illegal */
305  GLfloat p[4];
306  p[0] = param;
307  p[1] = p[2] = p[3] = 0.0F;
308  need_update = set_tex_parameterf(ctx, texObj, pname, p);
309  }
310  }
311 
312  if (ctx->Driver.TexParameter && need_update) {
313  ctx->Driver.TexParameter(ctx, target, texObj, pname, &param);
314  }
315 }
316 
317 
318 void GLAPIENTRY
320 {
321  GLboolean need_update;
322  struct gl_texture_object *texObj;
323  GET_CURRENT_CONTEXT(ctx);
325 
326  texObj = get_texobj(ctx, target, GL_FALSE);
327  if (!texObj)
328  return;
329 
330  switch (pname) {
333  case GL_TEXTURE_WRAP_S:
334  case GL_TEXTURE_WRAP_T:
335  case GL_TEXTURE_WRAP_R:
340  {
341  /* convert float param to int */
342  GLint p[4];
343  p[0] = (GLint) params[0];
344  p[1] = p[2] = p[3] = 0;
345  need_update = set_tex_parameteri(ctx, texObj, pname, p);
346  }
347  break;
348 
354  {
355  GLint p[4] = {0, 0, 0, 0};
356  p[0] = (GLint) params[0];
357  if (pname == GL_TEXTURE_SWIZZLE_RGBA_EXT) {
358  p[1] = (GLint) params[1];
359  p[2] = (GLint) params[2];
360  p[3] = (GLint) params[3];
361  }
362  need_update = set_tex_parameteri(ctx, texObj, pname, p);
363  }
364  break;
365  default:
366  /* this will generate an error if pname is illegal */
367  need_update = set_tex_parameterf(ctx, texObj, pname, params);
368  }
369 
370  if (ctx->Driver.TexParameter && need_update) {
371  ctx->Driver.TexParameter(ctx, target, texObj, pname, params);
372  }
373 }
374 
375 
376 void GLAPIENTRY
378 {
379  GLboolean need_update;
380  struct gl_texture_object *texObj;
381  GET_CURRENT_CONTEXT(ctx);
383 
384  texObj = get_texobj(ctx, target, GL_FALSE);
385  if (!texObj)
386  return;
387 
388  switch (pname) {
389  case GL_TEXTURE_MIN_LOD:
390  case GL_TEXTURE_MAX_LOD:
391  case GL_TEXTURE_PRIORITY:
393  case GL_TEXTURE_LOD_BIAS:
395  {
396  GLfloat fparam[4];
397  fparam[0] = (GLfloat) param;
398  fparam[1] = fparam[2] = fparam[3] = 0.0F;
399  /* convert int param to float */
400  need_update = set_tex_parameterf(ctx, texObj, pname, fparam);
401  }
402  break;
403  default:
404  /* this will generate an error if pname is illegal */
405  {
406  GLint iparam[4];
407  iparam[0] = param;
408  iparam[1] = iparam[2] = iparam[3] = 0;
409  need_update = set_tex_parameteri(ctx, texObj, pname, iparam);
410  }
411  }
412 
413  if (ctx->Driver.TexParameter && need_update) {
414  GLfloat fparam = (GLfloat) param;
415  ctx->Driver.TexParameter(ctx, target, texObj, pname, &fparam);
416  }
417 }
418 
419 
420 void GLAPIENTRY
422 {
423  GLboolean need_update;
424  struct gl_texture_object *texObj;
425  GET_CURRENT_CONTEXT(ctx);
427 
428  texObj = get_texobj(ctx, target, GL_FALSE);
429  if (!texObj)
430  return;
431 
432  switch (pname) {
434  {
435  /* convert int params to float */
436  GLfloat fparams[4];
437  fparams[0] = INT_TO_FLOAT(params[0]);
438  fparams[1] = INT_TO_FLOAT(params[1]);
439  fparams[2] = INT_TO_FLOAT(params[2]);
440  fparams[3] = INT_TO_FLOAT(params[3]);
441  need_update = set_tex_parameterf(ctx, texObj, pname, fparams);
442  }
443  break;
444  case GL_TEXTURE_MIN_LOD:
445  case GL_TEXTURE_MAX_LOD:
446  case GL_TEXTURE_PRIORITY:
448  case GL_TEXTURE_LOD_BIAS:
450  {
451  /* convert int param to float */
452  GLfloat fparams[4];
453  fparams[0] = (GLfloat) params[0];
454  fparams[1] = fparams[2] = fparams[3] = 0.0F;
455  need_update = set_tex_parameterf(ctx, texObj, pname, fparams);
456  }
457  break;
458  default:
459  /* this will generate an error if pname is illegal */
460  need_update = set_tex_parameteri(ctx, texObj, pname, params);
461  }
462 
463  if (ctx->Driver.TexParameter && need_update) {
464  GLfloat fparams[4];
465  fparams[0] = INT_TO_FLOAT(params[0]);
466  if (pname == GL_TEXTURE_BORDER_COLOR ||
467  pname == GL_TEXTURE_CROP_RECT_OES) {
468  fparams[1] = INT_TO_FLOAT(params[1]);
469  fparams[2] = INT_TO_FLOAT(params[2]);
470  fparams[3] = INT_TO_FLOAT(params[3]);
471  }
472  ctx->Driver.TexParameter(ctx, target, texObj, pname, fparams);
473  }
474 }
475 
476 
482 void GLAPIENTRY
484 {
485  struct gl_texture_object *texObj;
486  GET_CURRENT_CONTEXT(ctx);
488 
489  texObj = get_texobj(ctx, target, GL_FALSE);
490  if (!texObj)
491  return;
492 
493  switch (pname) {
496  /* set the integer-valued border color */
497  COPY_4V(texObj->Sampler.BorderColor.i, params);
498  break;
499  default:
500  _mesa_TexParameteriv(target, pname, params);
501  break;
502  }
503  /* XXX no driver hook for TexParameterIiv() yet */
504 }
505 
506 
512 void GLAPIENTRY
514 {
515  struct gl_texture_object *texObj;
516  GET_CURRENT_CONTEXT(ctx);
518 
519  texObj = get_texobj(ctx, target, GL_FALSE);
520  if (!texObj)
521  return;
522 
523  switch (pname) {
526  /* set the unsigned integer-valued border color */
527  COPY_4V(texObj->Sampler.BorderColor.ui, params);
528  break;
529  default:
530  _mesa_TexParameteriv(target, pname, (const GLint *) params);
531  break;
532  }
533  /* XXX no driver hook for TexParameterIuiv() yet */
534 }
535 
536 
537 void GLAPIENTRY
540 {
541  GLint iparam;
542  _mesa_GetTexLevelParameteriv( target, level, pname, &iparam );
543  *params = (GLfloat) iparam;
544 }
545 
546 
547 void GLAPIENTRY
550 {
551  struct gl_texture_object *texObj;
552  const struct gl_texture_image *img = NULL;
553  GLint maxLevels;
554  gl_format texFormat;
555  GET_CURRENT_CONTEXT(ctx);
557 
558  /* this will catch bad target values */
559  maxLevels = _mesa_max_texture_levels(ctx, target);
560  if (maxLevels == 0) {
562  "glGetTexLevelParameter[if]v(target=0x%x)", target);
563  return;
564  }
565 
566  if (level < 0 || level >= maxLevels) {
567  _mesa_error( ctx, GL_INVALID_VALUE, "glGetTexLevelParameter[if]v" );
568  return;
569  }
570 
571  texObj = _mesa_select_tex_object(ctx, target);
572 
573  img = _mesa_select_tex_image(ctx, texObj, target, level);
574  if (!img || img->TexFormat == MESA_FORMAT_NONE) {
575  /* undefined texture image */
576  if (pname == GL_TEXTURE_COMPONENTS)
577  *params = 1;
578  else
579  *params = 0;
580  return;
581  }
582 
583  texFormat = img->TexFormat;
584 
585  switch (pname) {
586  case GL_TEXTURE_WIDTH:
587  *params = img->Width;
588  break;
589  case GL_TEXTURE_HEIGHT:
590  *params = img->Height;
591  break;
592  case GL_TEXTURE_DEPTH:
593  *params = img->Depth;
594  break;
596  *params = img->InternalFormat;
597  break;
598  case GL_TEXTURE_BORDER:
599  *params = img->Border;
600  break;
601  case GL_TEXTURE_RED_SIZE:
606  *params = _mesa_get_format_bits(texFormat, pname);
607  else
608  *params = 0;
609  break;
612  if (_mesa_base_format_has_channel(img->_BaseFormat, pname)) {
613  *params = _mesa_get_format_bits(texFormat, pname);
614  if (*params == 0) {
615  /* intensity or luminance is probably stored as RGB[A] */
616  *params = MIN2(_mesa_get_format_bits(texFormat,
618  _mesa_get_format_bits(texFormat,
620  }
621  }
622  else {
623  *params = 0;
624  }
625  break;
626 
627  default:
628  goto invalid_pname;
629  }
630 
631  /* no error if we get here */
632  return;
633 
634 invalid_pname:
636  "glGetTexLevelParameter[if]v(pname=%s)",
637  _mesa_lookup_enum_by_nr(pname));
638 }
639 
640 
641 
642 void GLAPIENTRY
644 {
645  struct gl_texture_object *obj;
646  GET_CURRENT_CONTEXT(ctx);
648 
649  obj = get_texobj(ctx, target, GL_TRUE);
650  if (!obj)
651  return;
652 
653  _mesa_lock_texture(ctx, obj);
654  switch (pname) {
656  *params = ENUM_TO_FLOAT(obj->Sampler.MagFilter);
657  break;
659  *params = ENUM_TO_FLOAT(obj->Sampler.MinFilter);
660  break;
661  case GL_TEXTURE_WRAP_S:
662  *params = ENUM_TO_FLOAT(obj->Sampler.WrapS);
663  break;
664  case GL_TEXTURE_WRAP_T:
665  *params = ENUM_TO_FLOAT(obj->Sampler.WrapT);
666  break;
667  case GL_TEXTURE_WRAP_R:
668  *params = ENUM_TO_FLOAT(obj->Sampler.WrapR);
669  break;
671  if (ctx->NewState & _NEW_BUFFERS)
673  params[0] = obj->Sampler.BorderColor.f[0];
674  params[1] = obj->Sampler.BorderColor.f[1];
675  params[2] = obj->Sampler.BorderColor.f[2];
676  params[3] = obj->Sampler.BorderColor.f[3];
677  break;
678  case GL_TEXTURE_RESIDENT:
679  *params = 1.0F;
680  break;
681  case GL_TEXTURE_PRIORITY:
682  *params = obj->Priority;
683  break;
685  if (!ctx->Extensions.EXT_texture_filter_anisotropic)
686  goto invalid_pname;
687  *params = obj->Sampler.MaxAnisotropy;
688  break;
689 
691  if (!ctx->Extensions.ARB_texture_storage)
692  goto invalid_pname;
693  *params = (GLfloat) obj->Immutable;
694  break;
695 
696  default:
697  goto invalid_pname;
698  }
699 
700  /* no error if we get here */
701  _mesa_unlock_texture(ctx, obj);
702  return;
703 
704 invalid_pname:
705  _mesa_unlock_texture(ctx, obj);
706  _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameterfv(pname=0x%x)", pname);
707 }
708 
709 
710 void GLAPIENTRY
712 {
713  struct gl_texture_object *obj;
714  GET_CURRENT_CONTEXT(ctx);
716 
717  obj = get_texobj(ctx, target, GL_TRUE);
718  if (!obj)
719  return;
720 
721  _mesa_lock_texture(ctx, obj);
722  switch (pname) {
724  *params = (GLint) obj->Sampler.MagFilter;
725  break;;
727  *params = (GLint) obj->Sampler.MinFilter;
728  break;;
729  case GL_TEXTURE_WRAP_S:
730  *params = (GLint) obj->Sampler.WrapS;
731  break;;
732  case GL_TEXTURE_WRAP_T:
733  *params = (GLint) obj->Sampler.WrapT;
734  break;;
735  case GL_TEXTURE_WRAP_R:
736  *params = (GLint) obj->Sampler.WrapR;
737  break;;
739  {
740  GLfloat b[4];
741  b[0] = CLAMP(obj->Sampler.BorderColor.f[0], 0.0F, 1.0F);
742  b[1] = CLAMP(obj->Sampler.BorderColor.f[1], 0.0F, 1.0F);
743  b[2] = CLAMP(obj->Sampler.BorderColor.f[2], 0.0F, 1.0F);
744  b[3] = CLAMP(obj->Sampler.BorderColor.f[3], 0.0F, 1.0F);
745  params[0] = FLOAT_TO_INT(b[0]);
746  params[1] = FLOAT_TO_INT(b[1]);
747  params[2] = FLOAT_TO_INT(b[2]);
748  params[3] = FLOAT_TO_INT(b[3]);
749  }
750  break;;
751  case GL_TEXTURE_RESIDENT:
752  *params = 1;
753  break;;
754  case GL_TEXTURE_PRIORITY:
755  *params = FLOAT_TO_INT(obj->Priority);
756  break;
758  if (!ctx->Extensions.EXT_texture_filter_anisotropic)
759  goto invalid_pname;
760  *params = (GLint) obj->Sampler.MaxAnisotropy;
761  break;
762 
764  if (!ctx->Extensions.ARB_texture_storage)
765  goto invalid_pname;
766  *params = (GLint) obj->Immutable;
767  break;
768 
769  default:
770  goto invalid_pname;
771  }
772 
773  /* no error if we get here */
775  return;
776 
777 invalid_pname:
779  _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameteriv(pname=0x%x)", pname);
780 }
781 
782 
784 void GLAPIENTRY
786 {
787  struct gl_texture_object *texObj;
788  GET_CURRENT_CONTEXT(ctx);
790 
791  texObj = get_texobj(ctx, target, GL_TRUE);
792  if (!texObj)
793  return;
794 
795  switch (pname) {
797  COPY_4V(params, texObj->Sampler.BorderColor.i);
798  break;
799  default:
800  _mesa_GetTexParameteriv(target, pname, params);
801  }
802 }
803 
804 
806 void GLAPIENTRY
808 {
809  struct gl_texture_object *texObj;
810  GET_CURRENT_CONTEXT(ctx);
812 
813  texObj = get_texobj(ctx, target, GL_TRUE);
814  if (!texObj)
815  return;
816 
817  switch (pname) {
819  COPY_4V(params, texObj->Sampler.BorderColor.i);
820  break;
821  default:
822  {
823  GLint ip[4];
824  _mesa_GetTexParameteriv(target, pname, ip);
825  params[0] = ip[0];
826  if (pname == GL_TEXTURE_SWIZZLE_RGBA_EXT ||
827  pname == GL_TEXTURE_CROP_RECT_OES) {
828  params[1] = ip[1];
829  params[2] = ip[2];
830  params[3] = ip[3];
831  }
832  }
833  }
834 }
void GLAPIENTRY _mesa_GetTexParameterIuiv(GLenum target, GLenum pname, GLuint *params)
Definition: texparam.c:807
struct gl_texture_object * CurrentTex[NUM_TEXTURE_TARGETS]
Definition: mtypes.h:1050
GLint level
Definition: gl.h:1546
#define GL_TEXTURE_COMPARE_FUNC_ARB
Definition: glext.h:1372
void GLAPIENTRY _mesa_GetTexParameterfv(GLenum target, GLenum pname, GLfloat *params)
Definition: texparam.c:643
#define RCOMP
Definition: internal.h:77
gl_format
Definition: formats.h:60
GLuint Depth
Definition: mtypes.h:898
#define GL_TEXTURE_ALPHA_SIZE
Definition: gl.h:664
static GLboolean set_tex_parameteri(struct gl_context *ctx, struct gl_texture_object *texObj, GLenum pname, const GLint *params)
Definition: texparam.c:121
#define BCOMP
Definition: internal.h:79
static GLboolean set_tex_parameterf(struct gl_context *ctx, struct gl_texture_object *texObj, GLenum pname, const GLfloat *params)
Definition: texparam.c:213
#define GL_TEXTURE_LOD_BIAS
Definition: glext.h:295
#define GL_TEXTURE_DEPTH
Definition: gl.h:1517
#define GL_TEXTURE_SWIZZLE_A_EXT
Definition: glext.h:4865
#define GL_FALSE
Definition: gl.h:173
#define INT_TO_FLOAT(I)
Definition: macros.h:99
#define GL_NEAREST
Definition: gl.h:678
#define GL_NEAREST_MIPMAP_NEAREST
Definition: gl.h:667
#define FLUSH_VERTICES(ctx, newstate)
Definition: context.h:204
#define GL_REPEAT
Definition: gl.h:679
#define GET_CURRENT_CONTEXT(__ctx__)
Definition: glheader.h:68
#define GL_TEXTURE_BLUE_SIZE
Definition: gl.h:663
#define GL_TEXTURE_INTERNAL_FORMAT
Definition: gl.h:732
#define GL_TEXTURE_RESIDENT
Definition: gl.h:729
#define GL_TEXTURE_MAX_LOD
Definition: gl.h:1502
GLuint Width
Definition: mtypes.h:896
#define _NEW_BUFFERS
Definition: mtypes.h:1609
#define GL_TEXTURE_LUMINANCE_SIZE
Definition: gl.h:665
GLint _mesa_max_texture_levels(struct gl_context *ctx, GLenum target)
Definition: teximage.c:463
#define GL_TEXTURE_INTENSITY_SIZE
Definition: gl.h:666
GLsizei GLsizei GLuint * obj
Definition: glext.h:6042
struct gl_extensions Extensions
Definition: mtypes.h:1798
#define ASSERT_OUTSIDE_BEGIN_END(ctx)
Definition: context.h:253
#define GL_TEXTURE_GREEN_SIZE
Definition: gl.h:662
#define GL_TEXTURE_BORDER
Definition: gl.h:659
void GLAPIENTRY _mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param)
Definition: texparam.c:262
#define GL_TEXTURE_WRAP_R
Definition: gl.h:1518
GLuint Height
Definition: mtypes.h:897
#define GL_TEXTURE_MAX_ANISOTROPY_EXT
Definition: glext.h:3366
GLenum const GLfloat * params
Definition: glext.h:5645
#define GL_TEXTURE_1D
Definition: gl.h:644
#define GL_NEAREST_MIPMAP_LINEAR
Definition: gl.h:668
struct gl_constants Const
Definition: mtypes.h:1778
#define CLAMP(f, min, max)
Definition: tif_color.c:179
unsigned char GLboolean
Definition: gl.h:151
static void _mesa_lock_texture(struct gl_context *ctx, struct gl_texture_object *texObj)
Definition: teximage.h:135
GLint InternalFormat
Definition: mtypes.h:886
void GLAPIENTRY _mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params)
Definition: texparam.c:421
GLboolean _Complete
Definition: mtypes.h:966
void GLAPIENTRY _mesa_GetTexParameterIiv(GLenum target, GLenum pname, GLint *params)
Definition: texparam.c:785
#define F(i)
Definition: internal.h:87
smooth NULL
Definition: ftsmooth.c:557
#define GL_TEXTURE_HEIGHT
Definition: gl.h:658
#define GL_TEXTURE_WRAP_T
Definition: gl.h:647
static void flush(struct gl_context *ctx)
Definition: texparam.c:94
#define ACOMP
Definition: internal.h:80
gl_format TexFormat
Definition: mtypes.h:893
#define GL_TEXTURE_SWIZZLE_R_EXT
Definition: glext.h:4862
GLint _mesa_get_format_bits(gl_format format, GLenum pname)
Definition: formats.c:801
float GLfloat
Definition: gl.h:161
void GLAPIENTRY _mesa_TexParameterIiv(GLenum target, GLenum pname, const GLint *params)
Definition: texparam.c:483
GLenum Target
Definition: mtypes.h:957
#define GL_TEXTURE_MIN_FILTER
Definition: gl.h:649
struct gl_texture_attrib Texture
Definition: mtypes.h:1833
#define FLOAT_TO_INT(X)
Definition: macros.h:106
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
Definition: dhcpd.h:61
void GLAPIENTRY _mesa_TexParameteri(GLenum target, GLenum pname, GLint param)
Definition: texparam.c:377
if(!(yy_init))
Definition: macro.lex.yy.c:704
GLuint Border
Definition: mtypes.h:895
GLint GLvoid * img
Definition: gl.h:1956
#define GL_TEXTURE_COMPARE_MODE_ARB
Definition: glext.h:1371
#define GL_TEXTURE_SWIZZLE_RGBA_EXT
Definition: glext.h:4866
GLboolean _mesa_base_format_has_channel(GLenum base_format, GLenum pname)
Definition: image.c:854
#define GL_TEXTURE_SWIZZLE_B_EXT
Definition: glext.h:4864
#define GL_TEXTURE_WRAP_S
Definition: gl.h:646
void GLAPIENTRY _mesa_GetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params)
Definition: texparam.c:548
GLfloat param
Definition: glext.h:5796
#define GCOMP
Definition: internal.h:78
#define GL_TEXTURE_WIDTH
Definition: gl.h:657
GLuint GLuint GLsizei count
Definition: gl.h:1545
void GLAPIENTRY _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
Definition: texparam.c:319
#define GL_LINEAR
Definition: gl.h:421
#define ENUM_TO_FLOAT(E)
Definition: macros.h:678
static void _mesa_unlock_texture(struct gl_context *ctx, struct gl_texture_object *texObj)
Definition: teximage.h:143
#define GL_INVALID_VALUE
Definition: gl.h:695
#define GL_TEXTURE_COMPONENTS
Definition: gl.h:660
static GLboolean validate_texture_wrap_mode(struct gl_context *ctx, GLenum target, GLenum wrap)
Definition: texparam.c:39
#define GL_TEXTURE_CUBE_MAP
Definition: gl.h:1788
struct gl_texture_object * _mesa_select_tex_object(struct gl_context *ctx, GLenum target)
Definition: teximage.c:326
struct gl_sampler_object Sampler
Definition: mtypes.h:959
GLenum _BaseFormat
Definition: mtypes.h:887
#define GL_TEXTURE_PRIORITY
Definition: gl.h:728
const char * _mesa_lookup_enum_by_nr(int nr)
Definition: enums.c:6332
#define _NEW_TEXTURE
Definition: mtypes.h:1603
#define GL_MIRRORED_REPEAT
Definition: glext.h:293
void GLAPIENTRY _mesa_GetTexParameteriv(GLenum target, GLenum pname, GLint *params)
Definition: texparam.c:711
unsigned int GLuint
Definition: gl.h:159
#define GL_TEXTURE_MAG_FILTER
Definition: gl.h:648
void _mesa_update_state_locked(struct gl_context *ctx)
Definition: state.c:216
#define GL_TEXTURE_CROP_RECT_OES
Definition: glheader.h:111
#define GL_TRUE
Definition: gl.h:174
#define GL_TEXTURE_CUBE_MAP_SEAMLESS
Definition: glext.h:1913
void GLAPIENTRY _mesa_TexParameterIuiv(GLenum target, GLenum pname, const GLuint *params)
Definition: texparam.c:513
#define GL_INVALID_ENUM
Definition: gl.h:694
#define GL_TEXTURE_BORDER_COLOR
Definition: gl.h:656
#define GL_LINEAR_MIPMAP_LINEAR
Definition: gl.h:670
static void incomplete(struct gl_context *ctx, struct gl_texture_object *texObj)
Definition: texparam.c:109
#define GL_TEXTURE_2D
Definition: gl.h:645
#define GL_LINEAR_MIPMAP_NEAREST
Definition: gl.h:669
#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB
Definition: glext.h:1377
struct gl_texture_image * _mesa_select_tex_image(struct gl_context *ctx, const struct gl_texture_object *texObj, GLenum target, GLint level)
Definition: teximage.c:358
#define GL_TEXTURE_RED_SIZE
Definition: gl.h:661
#define MIN2(A, B)
Definition: macros.h:624
static struct gl_texture_object * get_texobj(struct gl_context *ctx, GLenum target, GLboolean get)
Definition: texparam.c:63
GLfloat Priority
Definition: mtypes.h:961
#define GL_DEPTH_TEXTURE_MODE_ARB
Definition: glext.h:1367
#define wrap(journal, var)
Definition: recovery.c:207
#define GL_CLAMP
Definition: gl.h:680
GLfloat GLfloat p
Definition: glext.h:8902
GLboolean Immutable
Definition: mtypes.h:968
#define GL_TEXTURE_SWIZZLE_G_EXT
Definition: glext.h:4863
#define GL_TEXTURE_IMMUTABLE_FORMAT
Definition: glext.h:2399
#define GLAPIENTRY
Definition: glu.h:44
void GLAPIENTRY _mesa_GetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat *params)
Definition: texparam.c:538
#define COPY_4V(DST, SRC)
Definition: macros.h:210
#define GL_TEXTURE_MIN_LOD
Definition: gl.h:1501
const GLint const GLsizei GLint
Definition: dispatch.h:5271
void _mesa_error(struct gl_context *ctx, GLenum error, const char *fmtString,...)
Definition: imports.c:832