diff options
author | Jan Zielinski <[email protected]> | 2020-05-07 16:49:15 +0200 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-05-07 17:31:21 +0000 |
commit | 58dfb38f784c70020fd57dc38a0fd6c7f0aed80d (patch) | |
tree | dfebfa5a09d0341a376a29e56472dc2d96fb0148 /src/gallium | |
parent | 58b66f82e648eaa9378699aadcc5862bb941483d (diff) |
gallium/swr: Fix crashes in sampling code
Add missing functions used by the new
sampling code in llvmpipe (num_samples and
sample_stride)
Reviewed-by: Krzysztof Raszkowski <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4947>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/swr/swr_context.h | 2 | ||||
-rw-r--r-- | src/gallium/drivers/swr/swr_state.cpp | 2 | ||||
-rw-r--r-- | src/gallium/drivers/swr/swr_tex_sample.cpp | 4 |
3 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/drivers/swr/swr_context.h b/src/gallium/drivers/swr/swr_context.h index 9a19720478a..b0681d8387f 100644 --- a/src/gallium/drivers/swr/swr_context.h +++ b/src/gallium/drivers/swr/swr_context.h @@ -77,6 +77,8 @@ struct swr_jit_texture { uint32_t first_level; uint32_t last_level; const uint8_t *base_ptr; + uint32_t num_samples; + uint32_t sample_stride; uint32_t row_stride[PIPE_MAX_TEXTURE_LEVELS]; uint32_t img_stride[PIPE_MAX_TEXTURE_LEVELS]; uint32_t mip_offsets[PIPE_MAX_TEXTURE_LEVELS]; diff --git a/src/gallium/drivers/swr/swr_state.cpp b/src/gallium/drivers/swr/swr_state.cpp index 81c70b4568d..4e9a25345a3 100644 --- a/src/gallium/drivers/swr/swr_state.cpp +++ b/src/gallium/drivers/swr/swr_state.cpp @@ -887,6 +887,8 @@ swr_update_texture_state(struct swr_context *ctx, jit_tex->width = res->width0; jit_tex->height = res->height0; jit_tex->base_ptr = (uint8_t*)swr->xpBaseAddress; + jit_tex->num_samples = swr->numSamples; + jit_tex->sample_stride = 0; if (view->target != PIPE_BUFFER) { jit_tex->first_level = view->u.tex.first_level; jit_tex->last_level = view->u.tex.last_level; diff --git a/src/gallium/drivers/swr/swr_tex_sample.cpp b/src/gallium/drivers/swr/swr_tex_sample.cpp index fc50cf37ea3..40731aceb97 100644 --- a/src/gallium/drivers/swr/swr_tex_sample.cpp +++ b/src/gallium/drivers/swr/swr_tex_sample.cpp @@ -187,6 +187,8 @@ SWR_TEXTURE_MEMBER(depth, TRUE) SWR_TEXTURE_MEMBER(first_level, TRUE) SWR_TEXTURE_MEMBER(last_level, TRUE) SWR_TEXTURE_MEMBER(base_ptr, TRUE) +SWR_TEXTURE_MEMBER(num_samples, TRUE) +SWR_TEXTURE_MEMBER(sample_stride, TRUE) SWR_TEXTURE_MEMBER(row_stride, FALSE) SWR_TEXTURE_MEMBER(img_stride, FALSE) SWR_TEXTURE_MEMBER(mip_offsets, FALSE) @@ -358,6 +360,8 @@ swr_sampler_soa_create(const struct swr_sampler_static_state *static_state, sampler->dynamic_state.base.row_stride = swr_texture_row_stride; sampler->dynamic_state.base.img_stride = swr_texture_img_stride; sampler->dynamic_state.base.mip_offsets = swr_texture_mip_offsets; + sampler->dynamic_state.base.num_samples = swr_texture_num_samples; + sampler->dynamic_state.base.sample_stride = swr_texture_sample_stride; sampler->dynamic_state.base.min_lod = swr_sampler_min_lod; sampler->dynamic_state.base.max_lod = swr_sampler_max_lod; sampler->dynamic_state.base.lod_bias = swr_sampler_lod_bias; |