static void
-st_CompressedTexImage2D(struct gl_context *ctx,
- struct gl_texture_image *texImage,
- GLint internalFormat,
- GLint width, GLint height, GLint border,
- GLsizei imageSize, const GLvoid *data)
+st_CompressedTexImage(struct gl_context *ctx, GLuint dims,
+ struct gl_texture_image *texImage,
+ GLint internalFormat,
+ GLint width, GLint height, GLint border, GLint depth,
+ GLsizei imageSize, const GLvoid *data)
{
- prep_teximage(ctx, texImage, internalFormat, width, 1, 1, border,
+ prep_teximage(ctx, texImage, internalFormat, width, height, depth, border,
GL_NONE, GL_NONE);
- _mesa_store_compressed_teximage2d(ctx, texImage, internalFormat, width,
- height, border, imageSize, data);
+ _mesa_store_compressed_teximage(ctx, dims, texImage, internalFormat, width,
+ height, depth, border, imageSize, data);
}
u_sampler_view_default_template(&sv_temp, stObj->pt, stObj->pt->format);
+ sv_temp.format = util_format_linear(sv_temp.format);
sv_temp.u.tex.first_level =
sv_temp.u.tex.last_level = texImage->Level;
struct pipe_screen *screen = pipe->screen;
enum pipe_format dest_format, src_format;
GLboolean matching_base_formats;
- GLuint format_writemask, sample_count;
+ GLuint color_writemask, zs_writemask, sample_count;
struct pipe_surface *dest_surface = NULL;
GLboolean do_flip = (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP);
struct pipe_surface surf_tmpl;
}
if (texBaseFormat == GL_DEPTH_COMPONENT) {
- format_writemask = TGSI_WRITEMASK_XYZW;
+ color_writemask = 0;
+ zs_writemask = BLIT_WRITEMASK_Z;
dst_usage = PIPE_BIND_DEPTH_STENCIL;
}
else {
- format_writemask = compatible_src_dst_formats(ctx, &strb->Base, texImage);
+ color_writemask = compatible_src_dst_formats(ctx, &strb->Base, texImage);
+ zs_writemask = 0;
dst_usage = PIPE_BIND_RENDER_TARGET;
}
- if (!format_writemask ||
+ if ((!color_writemask && !zs_writemask) ||
!screen->is_format_supported(screen, src_format,
PIPE_TEXTURE_2D, sample_count,
PIPE_BIND_SAMPLER_VIEW) ||
dest_surface = pipe->create_surface(pipe, stImage->pt,
&surf_tmpl);
- util_blit_pixels_writemask(st->blit,
- strb->texture,
- strb->surface->u.tex.level,
- srcX, srcY0,
- srcX + width, srcY1,
- strb->surface->u.tex.first_layer,
- dest_surface,
- destX, destY,
- destX + width, destY + height,
- 0.0, PIPE_TEX_MIPFILTER_NEAREST,
- format_writemask);
+ util_blit_pixels(st->blit,
+ strb->texture,
+ strb->surface->u.tex.level,
+ srcX, srcY0,
+ srcX + width, srcY1,
+ strb->surface->u.tex.first_layer,
+ dest_surface,
+ destX, destY,
+ destX + width, destY + height,
+ 0.0, PIPE_TEX_MIPFILTER_NEAREST,
+ color_writemask, zs_writemask);
pipe_surface_reference(&dest_surface, NULL);
/* Restore conditional rendering state. */
functions->ChooseTextureFormat = st_ChooseTextureFormat;
functions->TexImage = st_TexImage;
functions->TexSubImage = _mesa_store_texsubimage;
- functions->CompressedTexSubImage1D = _mesa_store_compressed_texsubimage1d;
- functions->CompressedTexSubImage2D = _mesa_store_compressed_texsubimage2d;
- functions->CompressedTexSubImage3D = _mesa_store_compressed_texsubimage3d;
+ functions->CompressedTexSubImage = _mesa_store_compressed_texsubimage;
functions->CopyTexSubImage = st_CopyTexSubImage;
functions->GenerateMipmap = st_generate_mipmap;
functions->GetTexImage = st_GetTexImage;
/* compressed texture functions */
- functions->CompressedTexImage2D = st_CompressedTexImage2D;
+ functions->CompressedTexImage = st_CompressedTexImage;
functions->GetCompressedTexImage = _mesa_get_compressed_teximage;
functions->NewTextureObject = st_NewTextureObject;