Commit 2bbae1ba authored by Erik Faye-Lund 's avatar Erik Faye-Lund 💬
Browse files

d3d12: prevent copying past end of source

It seems the state-tracker happily tries to copy outside the
source-texure like this, so let's detect it and clamp the region.

Ideally, this should be solved in the state-tracker instead in the long
run, but this prevents a crash in the CTS, so...
parent adea58d0
......@@ -343,9 +343,9 @@ copy_subregion_no_barriers(struct d3d12_context *ctx,
} else {
D3D12_BOX src_box;
src_box.left = psrc_box->x;
src_box.right = psrc_box->x + psrc_box->width;
src_box.right = MIN2(psrc_box->x + psrc_box->width, u_minify(src->base.width0, src_level));
src_box.top = psrc_box->y;
src_box.bottom = psrc_box->y + psrc_box->height;
src_box.bottom = MIN2(psrc_box->y + psrc_box->height, u_minify(src->base.height0, src_level));
src_box.front = src_z;
src_box.back = src_z + psrc_box->depth;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment