diff options
author | Dave Airlie <[email protected]> | 2018-02-05 06:31:48 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2018-02-07 06:08:12 +1000 |
commit | 736b150768bdf4a0b46fbf8684dcb645d9fa89e3 (patch) | |
tree | b0b2125933bd356db21613d65a1a46a3103b7f64 /src | |
parent | c9c4f0b7226b1838c797f9257389c5284be401d9 (diff) |
r600/eg: fix buffer sizing.
For buffers we want the size in bytes,
For images we want it in elements.
This fixes:
KHR-GL45.shader_storage_buffer_object.advanced-unsizedArrayLength-cs-std430-vec-pad
Reviewed-by: Roland Scheidegger <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/r600/evergreen_state.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index eb8eb376c2f..11e473d604f 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -616,6 +616,7 @@ struct eg_buf_res_params { unsigned char swizzle[4]; bool uncached; bool force_swizzle; + bool size_in_bytes; }; static void evergreen_fill_buffer_resource_words(struct r600_context *rctx, @@ -658,7 +659,7 @@ static void evergreen_fill_buffer_resource_words(struct r600_context *rctx, * albeit the amd gpu shader analyser * uses a const buffer to store the element sizes for buffer txq */ - tex_resource_words[4] = params->size / stride; + tex_resource_words[4] = params->size_in_bytes ? params->size : (params->size / stride); tex_resource_words[5] = tex_resource_words[6] = 0; tex_resource_words[7] = S_03001C_TYPE(V_03001C_SQ_TEX_VTX_VALID_BUFFER); @@ -4041,6 +4042,7 @@ static void evergreen_set_shader_buffers(struct pipe_context *ctx, buf_params.swizzle[3] = PIPE_SWIZZLE_W; buf_params.force_swizzle = true; buf_params.uncached = 1; + buf_params.size_in_bytes = true; evergreen_fill_buffer_resource_words(rctx, &resource->b.b, &buf_params, &rview->skip_mip_address_reloc, |