Lines Matching full:texture
28 * with texture mapping and glClear() can be done with polygon rendering.
201 * Temporary texture used for glBlitFramebuffer, glDrawPixels, etc.
209 GLsizei MinSize; /**< Min texture size to allocate */
210 GLsizei MaxSize; /**< Max possible texture size */
212 GLsizei Width, Height; /**< Current texture size */
273 struct temp_texture Tex; /**< separate texture from other meta ops */
277 * State for GLSL texture sampler which is used to generate fragment
306 * State for texture decompression
343 struct decompress_state Decompress; /**< For texture decompression */
659 save->ActiveUnit = ctx->Texture.CurrentUnit;
661 save->EnvMode = ctx->Texture.Unit[0].EnvMode;
663 /* Disable all texture units */
666 save->TexEnabled[u] = ctx->Texture.Unit[u].Enabled;
667 save->TexGenEnabled[u] = ctx->Texture.Unit[u].TexGenEnabled;
668 if (ctx->Texture.Unit[u].Enabled ||
669 ctx->Texture.Unit[u].TexGenEnabled) {
693 /* save current texture objects for unit[0] only */
696 ctx->Texture.Unit[0].CurrentTex[tgt]);
708 GLuint activeTexture = ctx->Texture.CurrentUnit;
1010 ASSERT(ctx->Texture.CurrentUnit == 0);
1017 /* restore texture objects for unit[0] only */
1019 if (ctx->Texture.Unit[0].CurrentTex[tgt] != save->CurrentTexture[tgt]) {
1021 _mesa_reference_texobj(&ctx->Texture.Unit[0].CurrentTex[tgt],
1027 texture enables, texgen */
1030 if (ctx->Texture.Unit[u].Enabled != save->TexEnabled[u]) {
1032 ctx->Texture.Unit[u].Enabled = save->TexEnabled[u];
1035 if (ctx->Texture.Unit[u].TexGenEnabled != save->TexGenEnabled[u]) {
1037 ctx->Texture.Unit[u].TexGenEnabled = save->TexGenEnabled[u];
1048 GLuint activeTexture = ctx->Texture.CurrentUnit;
1174 /* prefer texture rectangle */
1181 /* use 2D texture, NPOT if possible */
1221 * We use a separate texture for bitmaps to reduce texture
1238 * Compute the width/height of texture needed to draw an image of the
1239 * given size. Return a flag indicating whether the current texture
1240 * can be re-used (glTexSubImage2D) or if a new texture needs to be
1244 * \return GL_TRUE if new texture is needed, GL_FALSE otherwise
1258 /* alloc new texture (larger or different format) */
1297 * Setup/load texture for glCopyPixels or glBlitFramebuffer.
1311 /* copy framebuffer image to texture */
1320 /* create empty texture */
1338 * Setup/load texture for glDrawPixels.
1354 /* copy pixel data to texture */
1368 /* create empty texture */
1396 "TEX result.depth, fragment.texcoord[0], texture[0], %s; \n"
1422 * We can do this when the src renderbuffer is actually a texture.
1442 if (readAtt && readAtt->Texture) {
1443 const struct gl_texture_object *texObj = readAtt->Texture;
1450 ctx->Texture.Unit[ctx->Texture.CurrentUnit].Sampler ?
1451 ctx->Texture.Unit[ctx->Texture.CurrentUnit].Sampler->Name : 0;
1453 if (drawAtt->Texture == readAtt->Texture) {
1454 /* Can't use same texture as both the source and dest. We need
1462 /* Can't handle other texture types at this time */
1467 _mesa_BindSampler(ctx->Texture.CurrentUnit, sampler);
1470 printf("Blit from texture!\n");
1472 printf(" srcTex %p dstText %p\n", texObj, drawAtt->Texture);
1475 /* Prepare src texture state */
1546 /* Restore texture object state, the texture binding will
1557 _mesa_BindSampler(ctx->Texture.CurrentUnit, samplerSave);
1571 * of texture mapping and polygon rendering.
1595 * texture size, fallback if the source is multisampled. This fallback can
1645 /* Try faster, direct texture approach first */
1654 * into a temporary texture and is "blitted" by drawing a textured quad.
1659 /* vertex positions/texcoords (after texture allocation!) */
2098 * of texture mapping and polygon rendering and GLSL shaders.
2161 /* vertex positions, texcoords (after texture allocation!) */
2194 /* Alloc/setup texture */
2212 * texture size we use this function to break the glDrawPixels() image
2213 * into tiles which fit into the max texture size.
2255 * The stencil values to draw are found in an 8-bit alpha texture.
2256 * We read the texture/stencil value and test if bit 'b' is set.
2274 "TEX t, fragment.texcoord[0], texture[0], %s; \n" /* NOTE %s here! */
2321 "TEX result.depth, fragment.texcoord[0], texture[0], %s; \n"
2348 * of texture mapping and polygon rendering.
2371 * Determine if we can do the glDrawPixels with texture mapping.
2389 * promote our texture to fully float. We could do better by
2438 * Check image size against max texture size, draw as tiles if needed.
2460 /* vertex positions, texcoords (after texture allocation!) */
2615 * Do glBitmap with a alpha texture quad. Use the alpha test to cull
2643 ctx->Texture._EnabledUnits ||
2694 /* vertex positions, texcoords, colors (after texture allocation!) */
2774 * software fallback. The fallback path will require that the texture
2804 /* The texture format is sRGB but we can't turn off sRGB->linear
2805 * texture sample conversion. So we won't be able to generate the
2812 * Test that we can actually render in the texture's format.
2852 * Compute the texture coordinates for the four vertices of a quad for
2853 * drawing a 2D texture image or slice of a cube/3D texture.
2855 * \param slice slice of a 1D/2D array texture or 3D texture
2856 * \param width width of the texture image
2857 * \param height height of the texture image
3074 _mesa_problem(NULL, "Unexpected texture target 0x%x in"
3113 /* Generate a fragment shader program appropriate for the texture target */
3174 " out_color = texture(texSampler, %s);\n"
3229 * Note: We don't yet support 3D textures, 1D/2D array textures or texture
3247 const GLuint currentTexUnitSave = ctx->Texture.CurrentUnit;
3287 samplerSave = ctx->Texture.Unit[ctx->Texture.CurrentUnit].Sampler ?
3288 ctx->Texture.Unit[ctx->Texture.CurrentUnit].Sampler->Name : 0;
3299 _mesa_BindSampler(ctx->Texture.CurrentUnit, mipmap->Sampler);
3319 _mesa_BindSampler(ctx->Texture.CurrentUnit, mipmap->Sampler);
3335 /* Setup texture coordinates */
3358 /* texture is already locked, unlock now */
3399 * last valid level of an immutable texture if we continued.
3457 _mesa_BindSampler(ctx->Texture.CurrentUnit, samplerSave);
3572 * Store texture data (with pixel transfer ops)
3589 * Decompress a texture image by drawing a quad with the compressed
3590 * texture and reading the pixels out of the color buffer.
3591 * \param slice which slice of a 3D texture or layer of a 1D/2D texture
3637 samplerSave = ctx->Texture.Unit[ctx->Texture.CurrentUnit].Sampler ?
3638 ctx->Texture.Unit[ctx->Texture.CurrentUnit].Sampler->Name : 0;
3689 _mesa_BindSampler(ctx->Texture.CurrentUnit, decompress->Sampler);
3700 _mesa_BindSampler(ctx->Texture.CurrentUnit, decompress->Sampler);
3722 /* setup texture state */
3727 /* save texture object state */
3731 /* restrict sampling to the texture level of interest */
3743 /* render quad w/ texture into renderbuffer */
3746 /* Restore texture object state, the texture binding will
3764 * special cases. In particular, single-channel texture values are
3765 * returned as red and two-channel texture values are returned as
3771 /* If we're reading back an RGB(A) texture (using glGetTexImage) as
3789 /* disable texture unit */
3792 _mesa_BindSampler(ctx->Texture.CurrentUnit, samplerSave);
3827 /* Need to unlock the texture here to prevent deadlock... */
3875 /* client active texture is not part of the array object */
3887 /* restore client active texture */
3925 if (!ctx->Texture.Unit[i]._ReallyEnabled) {
3934 texObj = ctx->Texture.Unit[i]._Current;