mesa: Report the true face number when flushing.
This commit is contained in:
@@ -950,8 +950,9 @@ st_get_tex_image(GLcontext * ctx, GLenum target, GLint level,
|
|||||||
/* Image is stored in hardware format in a buffer managed by the
|
/* Image is stored in hardware format in a buffer managed by the
|
||||||
* kernel. Need to explicitly map and unmap it.
|
* kernel. Need to explicitly map and unmap it.
|
||||||
*/
|
*/
|
||||||
|
unsigned face = _mesa_tex_target_to_face(target);
|
||||||
|
|
||||||
st_teximage_flush_before_map(ctx->st, stImage->pt, 0, level,
|
st_teximage_flush_before_map(ctx->st, stImage->pt, face, level,
|
||||||
PIPE_TRANSFER_READ);
|
PIPE_TRANSFER_READ);
|
||||||
|
|
||||||
texImage->Data = st_texture_image_map(ctx->st, stImage, 0,
|
texImage->Data = st_texture_image_map(ctx->st, stImage, 0,
|
||||||
@@ -1080,13 +1081,15 @@ st_TexSubimage(GLcontext *ctx, GLint dims, GLenum target, GLint level,
|
|||||||
* from uploading the buffer under us.
|
* from uploading the buffer under us.
|
||||||
*/
|
*/
|
||||||
if (stImage->pt) {
|
if (stImage->pt) {
|
||||||
|
unsigned face = _mesa_tex_target_to_face(target);
|
||||||
|
|
||||||
if (format == GL_DEPTH_COMPONENT &&
|
if (format == GL_DEPTH_COMPONENT &&
|
||||||
pf_is_depth_and_stencil(stImage->pt->format))
|
pf_is_depth_and_stencil(stImage->pt->format))
|
||||||
transfer_usage = PIPE_TRANSFER_READ_WRITE;
|
transfer_usage = PIPE_TRANSFER_READ_WRITE;
|
||||||
else
|
else
|
||||||
transfer_usage = PIPE_TRANSFER_WRITE;
|
transfer_usage = PIPE_TRANSFER_WRITE;
|
||||||
|
|
||||||
st_teximage_flush_before_map(ctx->st, stImage->pt, 0, level,
|
st_teximage_flush_before_map(ctx->st, stImage->pt, face, level,
|
||||||
transfer_usage);
|
transfer_usage);
|
||||||
texImage->Data = st_texture_image_map(ctx->st, stImage, zoffset,
|
texImage->Data = st_texture_image_map(ctx->st, stImage, zoffset,
|
||||||
transfer_usage,
|
transfer_usage,
|
||||||
@@ -1213,7 +1216,9 @@ st_CompressedTexSubImage2D(GLcontext *ctx, GLenum target, GLint level,
|
|||||||
int y;
|
int y;
|
||||||
|
|
||||||
if (stImage->pt) {
|
if (stImage->pt) {
|
||||||
st_teximage_flush_before_map(ctx->st, stImage->pt, 0, level,
|
unsigned face = _mesa_tex_target_to_face(target);
|
||||||
|
|
||||||
|
st_teximage_flush_before_map(ctx->st, stImage->pt, face, level,
|
||||||
PIPE_TRANSFER_WRITE);
|
PIPE_TRANSFER_WRITE);
|
||||||
texImage->Data = st_texture_image_map(ctx->st, stImage, 0,
|
texImage->Data = st_texture_image_map(ctx->st, stImage, 0,
|
||||||
PIPE_TRANSFER_WRITE,
|
PIPE_TRANSFER_WRITE,
|
||||||
|
Reference in New Issue
Block a user