Home | History | Annotate | Download | only in common

Lines Matching refs:tex

273    struct temp_texture Tex;  /**< separate texture from other meta ops */
348 static void cleanup_temp_texture(struct gl_context *ctx, struct temp_texture *tex);
1169 * Choose tex target, compute max tex size, etc.
1172 init_temp_texture(struct gl_context *ctx, struct temp_texture *tex)
1176 tex->Target = GL_TEXTURE_RECTANGLE;
1177 tex->MaxSize = ctx->Const.MaxTextureRectSize;
1178 tex->NPOT = GL_TRUE;
1182 tex->Target = GL_TEXTURE_2D;
1183 tex->MaxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
1184 tex->NPOT = ctx->Extensions.ARB_texture_non_power_of_two;
1186 tex->MinSize = 16; /* 16 x 16 at least */
1187 assert(tex->MaxSize > 0);
1189 _mesa_GenTextures(1, &tex->TexObj);
1193 cleanup_temp_texture(struct gl_context *ctx, struct temp_texture *tex)
1195 if (!tex->TexObj)
1197 _mesa_DeleteTextures(1, &tex->TexObj);
1198 tex->TexObj = 0;
1209 struct temp_texture *tex = &ctx->Meta->TempTex;
1211 if (!tex->TexObj) {
1212 init_temp_texture(ctx, tex);
1215 return tex;
1227 struct temp_texture *tex = &ctx->Meta->Bitmap.Tex;
1229 if (!tex->TexObj) {
1230 init_temp_texture(ctx, tex);
1233 return tex;
1247 alloc_texture(struct temp_texture *tex,
1252 ASSERT(width <= tex->MaxSize);
1253 ASSERT(height <= tex->MaxSize);
1255 if (width > tex->Width ||
1256 height > tex->Height ||
1257 intFormat != tex->IntFormat) {
1260 if (tex->NPOT) {
1262 tex->Width = MAX2(tex->MinSize, width);
1263 tex->Height = MAX2(tex->MinSize, height);
1268 w = h = tex->MinSize;
1273 tex->Width = w;
1274 tex->Height = h;
1277 tex->IntFormat = intFormat;
1283 if (tex->Target == GL_TEXTURE_RECTANGLE) {
1284 tex->Sright = (GLfloat) width;
1285 tex->Ttop = (GLfloat) height;
1288 tex->Sright = (GLfloat) width / tex->Width;
1289 tex->Ttop = (GLfloat) height / tex->Height;
1300 setup_copypix_texture(struct temp_texture *tex,
1306 _mesa_BindTexture(tex->Target, tex->TexObj);
1307 _mesa_TexParameteri(tex->Target, GL_TEXTURE_MIN_FILTER, filter);
1308 _mesa_TexParameteri(tex->Target, GL_TEXTURE_MAG_FILTER, filter);
1313 /* create new tex image */
1314 if (tex->Width == width && tex->Height == height) {
1315 /* create new tex with framebuffer data */
1316 _mesa_CopyTexImage2D(tex->Target, 0, tex->IntFormat,
1321 _mesa_TexImage2D(tex->Target, 0, tex->IntFormat,
1322 tex->Width, tex->Height, 0,
1325 _mesa_CopyTexSubImage2D(tex->Target, 0,
1330 /* replace existing tex image */
1331 _mesa_CopyTexSubImage2D(tex->Target, 0,
1342 struct temp_texture *tex,
1349 _mesa_BindTexture(tex->Target, tex->TexObj);
1350 _mesa_TexParameteri(tex->Target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
1351 _mesa_TexParameteri(tex->Target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
1356 /* create new tex image */
1357 if (tex->Width == width && tex->Height == height) {
1358 /* create new tex and load image data */
1359 _mesa_TexImage2D(tex->Target, 0, tex->IntFormat,
1360 tex->Width, tex->Height, 0, format, type, pixels);
1369 _mesa_TexImage2D(tex->Target, 0, tex->IntFormat,
1370 tex->Width, tex->Height, 0, format, type, NULL);
1375 _mesa_TexSubImage2D(tex->Target, 0,
1380 /* replace existing tex image */
1381 _mesa_TexSubImage2D(tex->Target, 0,
1396 "TEX result.depth, fragment.texcoord[0], texture[0], %s; \n"
1400 struct temp_texture *tex = get_temp_texture(ctx);
1407 if (tex->Target == GL_TEXTURE_RECTANGLE)
1580 struct temp_texture *tex = get_temp_texture(ctx);
1581 const GLsizei maxTexSize = tex->MaxSize;
1657 newTex = alloc_texture(tex, srcW, srcH, GL_RGBA);
1672 verts[1].s = tex->Sright;
1674 verts[2].s = tex->Sright;
1675 verts[2].t = tex->Ttop;
1677 verts[3].t = tex->Ttop;
1683 _mesa_set_enable(ctx, tex->Target, GL_TRUE);
1686 setup_copypix_texture(tex, newTex, srcX, srcY, srcW, srcH,
1698 /* maybe change tex format here */
1699 newTex = alloc_texture(tex, srcW, srcH, GL_DEPTH_COMPONENT);
1704 setup_drawpix_texture(ctx, tex, newTex, GL_DEPTH_COMPONENT, srcW, srcH,
1725 _mesa_set_enable(ctx, tex->Target, GL_FALSE);
2106 struct temp_texture *tex = get_temp_texture(ctx);
2117 width > tex->MaxSize ||
2118 height > tex->MaxSize) {
2159 newTex = alloc_texture(tex, width, height, intFormat);
2177 verts[1].s = tex->Sright;
2182 verts[2].s = tex->Sright;
2183 verts[2].t = tex->Ttop;
2188 verts[3].t = tex->Ttop;
2195 setup_copypix_texture(tex, newTex, srcX, srcY, width, height,
2198 _mesa_set_enable(ctx, tex->Target, GL_TRUE);
2203 _mesa_set_enable(ctx, tex->Target, GL_FALSE);
2274 "TEX t, fragment.texcoord[0], texture[0], %s; \n" /* NOTE %s here! */
2292 struct temp_texture *tex = get_temp_texture(ctx);
2299 if (tex->Target == GL_TEXTURE_RECTANGLE)
2321 "TEX result.depth, fragment.texcoord[0], texture[0], %s; \n"
2326 struct temp_texture *tex = get_temp_texture(ctx);
2333 if (tex->Target == GL_TEXTURE_RECTANGLE)
2358 struct temp_texture *tex = get_temp_texture(ctx);
2440 if (width > tex->MaxSize || height > tex->MaxSize) {
2441 tiled_draw_pixels(ctx, tex->MaxSize, x, y, width, height,
2458 newTex = alloc_texture(tex, width, height, texIntFormat);
2476 verts[1].s = tex->Sright;
2481 verts[2].s = tex->Sright;
2482 verts[2].t = tex->Ttop;
2487 verts[3].t = tex->Ttop;
2511 _mesa_set_enable(ctx, tex->Target, GL_TRUE);
2520 setup_drawpix_texture(ctx, tex, newTex, texIntFormat, width, height,
2563 setup_drawpix_texture(ctx, tex, newTex, texIntFormat, width, height,
2570 setup_drawpix_texture(ctx, tex, newTex, texIntFormat, width, height,
2575 _mesa_set_enable(ctx, tex->Target, GL_FALSE);
2626 struct temp_texture *tex = get_bitmap_temp_texture(ctx);
2644 width > tex->MaxSize ||
2645 height > tex->MaxSize) {
2692 newTex = alloc_texture(tex, width, height, texIntFormat);
2711 verts[1].s = tex->Sright;
2716 verts[2].s = tex->Sright;
2717 verts[2].t = tex->Ttop;
2722 verts[3].t = tex->Ttop;
2751 _mesa_set_enable(ctx, tex->Target, GL_TRUE);
2756 setup_drawpix_texture(ctx, tex, newTex, texIntFormat, width, height,
2761 _mesa_set_enable(ctx, tex->Target, GL_FALSE);
3010 GLfloat x, y, tex[3];
3024 _mesa_TexCoordPointer(3, GL_FLOAT, sizeof(struct vertex), OFFSET(tex));
3087 GLfloat x, y, tex[3];
3110 sizeof(struct vertex), OFFSET(tex));
3238 GLfloat x, y, tex[3];
3339 verts[0].tex,
3340 verts[1].tex,
3341 verts[2].tex,
3342 verts[3].tex);
3471 * ReadPixels() and passed to Tex[Sub]Image().
3611 tex[3];
3678 _mesa_TexCoordPointer(3, GL_FLOAT, sizeof(struct vertex), OFFSET(tex));
3704 verts[0].tex,
3705 verts[1].tex,
3706 verts[2].tex,
3707 verts[3].tex);
3772 * luminance then we need to return L=tex(R).