Lines Matching refs:Tex
102 struct temp_texture *tex);
358 offsetof(struct vertex, tex));
377 offsetof(struct vertex, tex));
1227 * Choose tex target, compute max tex size, etc.
1230 init_temp_texture(struct gl_context *ctx, struct temp_texture *tex)
1234 tex->Target = GL_TEXTURE_RECTANGLE;
1235 tex->MaxSize = ctx->Const.MaxTextureRectSize;
1236 tex->NPOT = GL_TRUE;
1240 tex->Target = GL_TEXTURE_2D;
1241 tex->MaxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
1242 tex->NPOT = ctx->Extensions.ARB_texture_non_power_of_two;
1244 tex->MinSize = 16; /* 16 x 16 at least */
1245 assert(tex->MaxSize > 0);
1247 tex->tex_obj = ctx->Driver.NewTextureObject(ctx, 0xDEADBEEF, tex->Target);
1251 cleanup_temp_texture(struct gl_context *ctx, struct temp_texture *tex)
1253 _mesa_delete_nameless_texture(ctx, tex->tex_obj);
1254 tex->tex_obj = NULL;
1265 struct temp_texture *tex = &ctx->Meta->TempTex;
1267 if (tex->tex_obj == NULL) {
1268 init_temp_texture(ctx, tex);
1271 return tex;
1283 struct temp_texture *tex = &ctx->Meta->Bitmap.Tex;
1285 if (tex->tex_obj == NULL) {
1286 init_temp_texture(ctx, tex);
1289 return tex;
1299 struct temp_texture *tex = &ctx->Meta->Blit.depthTex;
1301 if (tex->tex_obj == NULL) {
1302 init_temp_texture(ctx, tex);
1305 return tex;
1318 _mesa_meta_alloc_texture(struct temp_texture *tex,
1323 assert(width <= tex->MaxSize);
1324 assert(height <= tex->MaxSize);
1326 if (width > tex->Width ||
1327 height > tex->Height ||
1328 intFormat != tex->IntFormat) {
1331 if (tex->NPOT) {
1333 tex->Width = MAX2(tex->MinSize, width);
1334 tex->Height = MAX2(tex->MinSize, height);
1339 w = h = tex->MinSize;
1344 tex->Width = w;
1345 tex->Height = h;
1348 tex->IntFormat = intFormat;
1354 if (tex->Target == GL_TEXTURE_RECTANGLE) {
1355 tex->Sright = (GLfloat) width;
1356 tex->Ttop = (GLfloat) height;
1359 tex->Sright = (GLfloat) width / tex->Width;
1360 tex->Ttop = (GLfloat) height / tex->Height;
1372 struct temp_texture *tex,
1380 _mesa_bind_texture(ctx, tex->Target, tex->tex_obj);
1381 _mesa_texture_parameteriv(ctx, tex->tex_obj, GL_TEXTURE_MIN_FILTER,
1383 _mesa_texture_parameteriv(ctx, tex->tex_obj, GL_TEXTURE_MAG_FILTER,
1387 newTex = _mesa_meta_alloc_texture(tex, width, height, intFormat);
1391 /* create new tex image */
1392 if (tex->Width == width && tex->Height == height) {
1393 /* create new tex with framebuffer data */
1394 _mesa_CopyTexImage2D(tex->Target, 0, tex->IntFormat,
1399 _mesa_TexImage2D(tex->Target, 0, tex->IntFormat,
1400 tex->Width, tex->Height, 0,
1403 _mesa_CopyTexSubImage2D(tex->Target, 0,
1408 /* replace existing tex image */
1409 _mesa_CopyTexSubImage2D(tex->Target, 0,
1420 struct temp_texture *tex,
1431 _mesa_bind_texture(ctx, tex->Target, tex->tex_obj);
1432 _mesa_texture_parameteriv(ctx, tex->tex_obj, GL_TEXTURE_MIN_FILTER, &filter,
1434 _mesa_texture_parameteriv(ctx, tex->tex_obj, GL_TEXTURE_MAG_FILTER, &filter,
1440 /* create new tex image */
1441 if (tex->Width == width && tex->Height == height) {
1442 /* create new tex and load image data */
1443 _mesa_TexImage2D(tex->Target, 0, tex->IntFormat,
1444 tex->Width, tex->Height, 0, format, type, pixels);
1453 _mesa_TexImage2D(tex->Target, 0, tex->IntFormat,
1454 tex->Width, tex->Height, 0, format, type, NULL);
1459 _mesa_TexSubImage2D(tex->Target, 0,
1464 /* replace existing tex image */
1465 _mesa_TexSubImage2D(tex->Target, 0,
1862 struct temp_texture *tex = _mesa_meta_get_temp_texture(ctx);
1868 width > tex
1869 height > tex->MaxSize) {
1893 _mesa_meta_setup_copypix_texture(ctx, tex, srcX, srcY, width, height,
1907 verts[0].tex[0] = 0.0F;
1908 verts[0].tex[1] = 0.0F;
1912 verts[1].tex[0] = tex->Sright;
1913 verts[1].tex[1] = 0.0F;
1917 verts[2].tex[0] = tex->Sright;
1918 verts[2].tex[1] = tex->Ttop;
1922 verts[3].tex[0] = 0.0F;
1923 verts[3].tex[1] = tex->Ttop;
1929 _mesa_set_enable(ctx, tex->Target, GL_TRUE);
1934 _mesa_set_enable(ctx, tex->Target, GL_FALSE);
2024 "TEX t, fragment.texcoord[0], texture[0], %s; \n" /* NOTE %s here! */
2042 struct temp_texture *tex = _mesa_meta_get_temp_texture(ctx);
2049 if (tex->Target == GL_TEXTURE_RECTANGLE)
2071 "TEX result.depth, fragment.texcoord[0], texture[0], %s; \n"
2076 struct temp_texture *tex = _mesa_meta_get_temp_texture(ctx);
2083 if (tex->Target == GL_TEXTURE_RECTANGLE)
2108 struct temp_texture *tex = _mesa_meta_get_temp_texture(ctx);
2186 if (width > tex->MaxSize || height > tex->MaxSize) {
2187 tiled_draw_pixels(ctx, tex->MaxSize, x, y, width, height,
2204 newTex = _mesa_meta_alloc_texture(tex, width, height, texIntFormat);
2223 verts[0].tex[0] = 0.0F;
2224 verts[0].tex[1] = 0.0F;
2228 verts[1].tex[0] = tex->Sright;
2229 verts[1].tex[1] = 0.0F;
2233 verts[2].tex[0] = tex->Sright;
2234 verts[2].tex[1] = tex->Ttop;
2238 verts[3].tex[0] = 0.0F;
2239 verts[3].tex[1] = tex->Ttop;
2249 _mesa_set_enable(ctx, tex->Target, GL_TRUE);
2258 _mesa_meta_setup_drawpix_texture(ctx, tex, newTex, width, height,
2301 _mesa_meta_setup_drawpix_texture(ctx, tex, newTex, width, height,
2308 _mesa_meta_setup_drawpix_texture(ctx, tex, newTex, width, height,
2313 _mesa_set_enable(ctx, tex->Target, GL_FALSE);
2362 struct temp_texture *tex = get_bitmap_temp_texture(ctx);
2377 width > tex->MaxSize ||
2378 height > tex->MaxSize) {
2402 newTex = _mesa_meta_alloc_texture(tex, width, height, texIntFormat);
2419 verts[0].tex[0] = 0.0F;
2420 verts[0].tex[1] = 0.0F;
2424 verts[1].tex[0] = tex->Sright;
2425 verts[1].tex[1] = 0.0F;
2429 verts[2].tex[0] = tex->Sright;
2430 verts[2].tex[1] = tex->Ttop;
2434 verts[3].tex[0] = 0.0F;
2435 verts[3].tex[1] = tex->Ttop;
2464 _mesa_set_enable(ctx, tex->Target, GL_TRUE);
2469 _mesa_meta_setup_drawpix_texture(ctx, tex, newTex, width, height,
2474 _mesa_set_enable(ctx, tex->Target, GL_FALSE);
2746 * ReadPixels() and passed to Tex[Sub]Image().
3149 verts[0].tex,
3150 verts[1].tex,
3151 verts[2].tex,
3152 verts[3].tex);
3218 * luminance then we need to return L=tex(R).