Home | History | Annotate | Download | only in main

Lines Matching refs:Texture

28  * Texture state handling.
47 * Default texture combine environment state. This is used to initialize
48 * a context's texture units and as the basis for converting "classic"
49 * texture environmnets to ARB_texture_env_combine style values.
64 * Used by glXCopyContext to copy texture state from one context to another.
74 dst->Texture.CurrentUnit = src->Texture.CurrentUnit;
75 dst->Texture._GenFlags = src->Texture._GenFlags;
76 dst->Texture._TexGenEnabled = src->Texture._TexGenEnabled;
77 dst->Texture._TexMatEnabled = src->Texture._TexMatEnabled;
81 dst->Texture.Unit[u].Enabled = src->Texture.Unit[u].Enabled;
82 dst->Texture.Unit[u].EnvMode = src->Texture.Unit[u].EnvMode;
83 COPY_4V(dst->Texture.Unit[u].EnvColor, src->Texture.Unit[u].EnvColor);
84 dst->Texture.Unit[u].TexGenEnabled = src->Texture.Unit[u].TexGenEnabled;
85 dst->Texture.Unit[u].GenS = src->Texture.Unit[u].GenS;
86 dst->Texture.Unit[u].GenT = src->Texture.Unit[u].GenT;
87 dst->Texture.Unit[u].GenR = src->Texture.Unit[u].GenR;
88 dst->Texture.Unit[u].GenQ = src->Texture.Unit[u].GenQ;
89 dst->Texture.Unit[u].LodBias = src->Texture.Unit[u].LodBias;
92 dst->Texture.Unit[u].Combine = src->Texture.Unit[u].Combine;
95 dst->Texture.Unit[u].BumpTarget = src->Texture.Unit[u].BumpTarget;
96 COPY_4V(dst->Texture.Unit[u].RotMatrix, src->Texture.Unit[u].RotMatrix);
99 * XXX strictly speaking, we should compare texture names/ids and
105 /* copy texture object bindings, not contents of texture objects */
109 _mesa_reference_texobj(&dst->Texture.Unit[u].CurrentTex[tex],
110 src->Texture.Unit[u].CurrentTex[tex]);
124 const struct gl_texture_unit *texUnit = ctx->Texture.Unit + unit;
125 printf("Texture Unit %d\n", unit);
149 /* Texture Environment */
153 * Convert "classic" texture environment to ARB_texture_env_combine style
157 * \param mode Classic texture environment mode (i.e., \c GL_REPLACE,
159 * \param texBaseFormat Base format of the texture associated with the
160 * texture unit.
273 "Invalid texture env mode 0x%x in calculate_derived_texenv",
289 _mesa_ActiveTextureARB(GLenum texture)
291 const GLuint texUnit = texture - GL_TEXTURE0;
299 ASSERT(k <= Elements(ctx->Texture.Unit));
305 _mesa_lookup_enum_by_nr(texture));
308 _mesa_error(ctx, GL_INVALID_ENUM, "glActiveTexture(texture=%s)",
309 _mesa_lookup_enum_by_nr(texture));
313 if (ctx->Texture.CurrentUnit == texUnit)
318 ctx->Texture.CurrentUnit = texUnit;
328 _mesa_ClientActiveTextureARB(GLenum texture)
331 GLuint texUnit = texture - GL_TEXTURE0;
336 _mesa_lookup_enum_by_nr(texture));
339 _mesa_error(ctx, GL_INVALID_ENUM, "glClientActiveTexture(texture)");
358 * \note This routine refers to derived texture attribute values to
370 ctx->Texture._TexMatEnabled = 0x0;
377 if (ctx->Texture.Unit[u]._ReallyEnabled &&
379 ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(u);
386 * Examine texture unit's combine/env state to update derived state.
485 * \note This routine refers to derived texture matrix values to
505 * texture fetches:
518 /* FINISHME: Geometry shader texture
525 ctx->Texture._EnabledUnits = 0x0;
526 ctx->Texture._GenFlags = 0x0;
527 ctx->Texture._TexMatEnabled = 0x0;
528 ctx->Texture._TexGenEnabled = 0x0;
531 * Update texture unit state.
534 struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
540 /* Get the bitmask of texture target enables.
542 * which texture targets are enabled (fixed function) or referenced
567 /* Look for the highest priority texture target that's enabled (or used
592 /* If we get here it means the shader is expecting a texture
594 * fallback texture.
606 /* invalid fallback texture: don't enable the texture unit */
614 /* fixed-function: texture unit is really disabled */
619 /* if we get here, we know this texture unit is enabled */
621 ctx->Texture._EnabledUnits |= (1 << unit);
630 /* Determine which texture coordinate sets are actually needed */
633 ctx->Texture._EnabledCoordUnits
637 ctx->Texture._EnabledCoordUnits = enabledFragUnits;
640 /* Setup texgen for those texture coordinate sets that are in use */
642 struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
646 if (!(ctx->Texture._EnabledCoordUnits & (1 << unit)))
663 ctx->Texture._TexGenEnabled |= ENABLE_TEXGEN(unit);
664 ctx->Texture._GenFlags |= texUnit->_GenFlags;
669 ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(unit);
675 * Update texture-related derived state.
726 if (!(ctx->Texture.ProxyTex[tgt]
730 ctx->Driver.DeleteTexture(ctx, ctx->Texture.ProxyTex[tgt]);
736 assert(ctx->Texture.ProxyTex[0]->RefCount == 1); /* sanity check */
742 * Initialize a texture unit.
745 * \param unit texture unit number to be initialized.
750 struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
784 /* initialize current texture object ptrs to the shared default objects */
793 * Initialize texture state for the given context.
800 /* Texture group */
801 ctx->Texture.CurrentUnit = 0; /* multitexture */
802 ctx->Texture._EnabledUnits = 0x0;
804 for (u = 0; u < Elements(ctx->Texture.Unit); u++)
807 /* After we're done initializing the context's texture state the default
808 * texture objects' refcounts should be at least
819 _mesa_reference_buffer_object(ctx, &ctx->Texture.BufferObject,
827 * Free dynamically-allocted texture data attached to the given context.
835 for (u = 0; u < Elements(ctx->Texture.Unit); u++) {
836 /* The _Current texture could account for another reference */
837 _mesa_reference_texobj(&ctx->Texture.Unit[u]._Current, NULL);
840 _mesa_reference_texobj(&ctx->Texture.Unit[u].CurrentTex[tgt], NULL);
844 /* Free proxy texture objects */
846 ctx->Driver.DeleteTexture(ctx, ctx->Texture.ProxyTex[tgt]);
849 _mesa_reference_buffer_object(ctx, &ctx->Texture.BufferObject, NULL);
852 for (u = 0; u < Elements(ctx->Texture.Unit); u++) {
853 _mesa_reference_sampler_object(ctx, &ctx->Texture.Unit[u].Sampler, NULL);
860 * Update the default texture objects in the given context to reference those
869 for (u = 0; u < Elements(ctx->Texture.Unit); u++) {
870 struct gl_texture_unit *texUnit = &ctx->Texture.Unit[u];