Lines Matching refs:image

86  * Allocate an empty texture image object.
95 * Delete a texture image object.
109 radeon_texture_image *image = get_radeon_texture_image(timage);
122 assert(!image->base.ImageOffsets);
123 image->base.ImageOffsets = malloc(slices * sizeof(GLuint));
131 * Free memory associated with this texture image.
135 radeon_texture_image* image = get_radeon_texture_image(timage);
137 if (image->mt) {
138 radeon_miptree_unreference(&image->mt);
142 if (image->bo) {
143 radeon_bo_unref(image->bo);
144 image->bo = NULL;
146 if (image->base.Buffer) {
147 _mesa_align_free(image->base.Buffer);
148 image->base.Buffer = NULL;
151 if (image->base.ImageOffsets) {
152 free(image->base.ImageOffsets);
153 image->base.ImageOffsets = NULL;
157 /* Set Data pointer and additional data for mapped texture image */
158 static void teximage_set_map_data(radeon_texture_image *image)
162 if (!image->mt) {
164 __func__, image);
169 lvl = &image->mt->levels[image->base.Base.Level];
171 image->base.Map = image->mt->bo->ptr + lvl->faces[image->base.Base.Face].offset;
172 image->base.RowStride = lvl->rowstride / _mesa_get_format_bytes(image->base.Base.TexFormat);
177 * Map a single texture image for glTexImage and friends.
179 void radeon_teximage_map(radeon_texture_image *image, GLboolean write_enable)
183 __func__, image,
185 if (image->mt) {
186 assert(!image->base.Map);
188 radeon_bo_map(image->mt->bo, write_enable);
189 teximage_set_map_data(image);
194 void radeon_teximage_unmap(radeon_texture_image *image)
198 __func__, image);
199 if (image->mt) {
200 assert(image->base.Map);
202 image->base.Map = 0;
203 radeon_bo_unmap(image->mt->bo);
223 radeon_texture_image *image = get_radeon_texture_image(texImage);
224 radeon_mipmap_tree *mt = image->mt;
228 struct radeon_bo *bo = !image->mt ? image->bo : image->mt->bo;
245 if (image->bo) {
247 radeon_bo_map(image->bo, write);
252 radeon_mipmap_level *lvl = &image->mt->levels[texImage->Level];
255 base = mt->bo->ptr + lvl->faces[image->base.Base.Face].offset;
265 *map = image->base.Buffer + (slice * height) * *stride;
275 radeon_texture_image *image = get_radeon_texture_image(texImage);
277 if (image->bo)
278 radeon_bo_unmap(image->bo);
279 else if (image->mt)
280 radeon_bo_unmap(image->mt->bo);
544 /** Check if given image is valid within current texture object.
551 radeon_texture_image* image = get_radeon_texture_image(texImage);
567 * when there was no image for baselevel specified */
569 radeon_miptree_reference(t->mt, &image->mt);
601 __DRIimage *image;
604 image = screen->dri2.image->lookupEGLImage(screen, image_handle,
606 if (image == NULL)
611 texImage->Width = image->width;
612 texImage->Height = image->height;
615 texImage->TexFormat = image->format;
616 radeonImage->base.RowStride = image->pitch;
617 texImage->InternalFormat = image->internal_format;
641 /* Particularly ugly: this is guaranteed to break, if image->bo is
644 radeon_bo_ref(image->bo);
645 t->mt->bo = image->bo;
648 fprintf(stderr, "miptree doesn't match image\n");
707 radeon_texture_image *image)
715 if (!image || !image->mt)
718 texel_size = _mesa_get_format_bytes(image->base.Base.TexFormat);
719 level = image->base.Base.Level;
720 face = image->base.Base.Face;
721 mt = image->mt;
723 lvl = &image->mt->levels[level];
729 image->base.Map = mt->bo->ptr + lvl->faces[face].offset;
734 image->base.ImageOffsets[i] = rs * lvl->height * i;
736 image->base.RowStride = rs;
741 radeon_texture_image *image)
743 if (image && image->mt) {
744 image->base.Map = NULL;
745 radeon_bo_unmap(image->mt->bo);
759 radeon_texture_image *image = get_radeon_texture_image(texObj->Image[face][i]);
760 radeon_swrast_map_image(rmesa, image);
775 radeon_texture_image *image = get_radeon_texture_image(texObj->Image[face][i]);
776 radeon_swrast_unmap_image(rmesa, image);