aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorIcecream95 <[email protected]>2020-01-24 19:45:17 +1300
committerMarge Bot <[email protected]>2020-01-27 13:23:34 +0000
commit800487488535e6042101930b96c61af184170614 (patch)
tree167c6fc4dc4ddc584ddb8d7af32205736b6bf49b /src/gallium
parent951083768b351b0700bdcc02758670e505cce974 (diff)
panfrost: Don't copy uniforms when the size is zero
This fixes a crash when using Gallium HUD with QuakeSpasm when gamma correction shaders (a QuakeSpasm feature, not part of Mesa) are used. Reviewd-by: Alyssa Rosenzweig <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3549> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3549>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/panfrost/pan_context.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index c94d5cd93b9..a3d95a31584 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -1093,7 +1093,7 @@ panfrost_emit_for_draw(struct panfrost_context *ctx, bool with_vertex_data)
panfrost_upload_sysvals(ctx, transfer.cpu, ss, i);
/* Upload uniforms */
- if (has_uniforms) {
+ if (has_uniforms && uniform_size) {
const void *cpu = panfrost_map_constant_buffer_cpu(buf, 0);
memcpy(transfer.cpu + sys_size, cpu, uniform_size);
}