summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2019-10-09 14:13:19 +1000
committerDave Airlie <[email protected]>2019-10-10 21:52:20 +0000
commit744b8936dfd7bb21bf04a47ae83bcad75716e46f (patch)
treee7fc9bf4695642103d0c5a0183dbd8a7872a7d5b /src/gallium/drivers/llvmpipe
parent7cac880831b21d2fcddf6477518a458dca9fc217 (diff)
llvmpipe/draw: fix image sizes for vertex/geometry shaders.
since images are a single level, minify before passing the w/h to draw. Fixes: KHR-GLES31.core.shader_image_size.basic-nonMS-vs-* Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium/drivers/llvmpipe')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_sampler.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_state_sampler.c b/src/gallium/drivers/llvmpipe/lp_state_sampler.c
index 36159a363f4..0428b5cd2c5 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_sampler.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_sampler.c
@@ -386,7 +386,8 @@ prepare_shader_images(
if (!img)
continue;
- unsigned width0 = img->width0;
+ unsigned width = u_minify(img->width0, view->u.tex.level);
+ unsigned height = u_minify(img->height0, view->u.tex.level);
unsigned num_layers = img->depth0;
if (!lp_img->dt) {
@@ -419,7 +420,7 @@ prepare_shader_images(
img_stride = 0;
/* everything specified in number of elements here. */
- width0 = view->u.buf.size / view_blocksize;
+ width = view->u.buf.size / view_blocksize;
addr = (uint8_t *)addr + view->u.buf.offset;
assert(view->u.buf.offset + view->u.buf.size <= res->width0);
}
@@ -440,7 +441,7 @@ prepare_shader_images(
draw_set_mapped_image(lp->draw,
shader_type,
i,
- width0, img->height0, num_layers,
+ width, height, num_layers,
addr,
row_stride, img_stride);
}