summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTapani Pälli <[email protected]>2019-09-24 14:34:40 +0300
committerTapani Pälli <[email protected]>2019-09-26 07:55:24 +0300
commit031752798b440f650c9bc758dfe8d18323a2b9e3 (patch)
tree9430a2e29129530e0c659a099d41b9fdc8074ac4
parentfafd20f67dec9f5891838435ecde1dedb77ab742 (diff)
mesa/st: calculate texture size based on EGLImage miplevel
Fixes issues with 'egl-gl_oes_egl_image' Piglit test. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
-rw-r--r--src/mesa/state_tracker/st_cb_eglimage.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_cb_eglimage.c b/src/mesa/state_tracker/st_cb_eglimage.c
index 77abe55cfb2..c4eac0ce44a 100644
--- a/src/mesa/state_tracker/st_cb_eglimage.c
+++ b/src/mesa/state_tracker/st_cb_eglimage.c
@@ -271,8 +271,11 @@ st_bind_egl_image(struct gl_context *ctx,
}
assert(texFormat != MESA_FORMAT_NONE);
- _mesa_init_teximage_fields(ctx, texImage,
- stimg->texture->width0, stimg->texture->height0,
+ /* Minify texture size based on level set on the EGLImage. */
+ uint32_t width = u_minify(stimg->texture->width0, stimg->level);
+ uint32_t height = u_minify(stimg->texture->height0, stimg->level);
+
+ _mesa_init_teximage_fields(ctx, texImage, width, height,
1, 0, internalFormat, texFormat);
pipe_resource_reference(&stObj->pt, stimg->texture);