From: Icecream95 Date: Fri, 24 Jan 2020 06:45:17 +0000 (+1300) Subject: panfrost: Don't copy uniforms when the size is zero X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=800487488535e6042101930b96c61af184170614;p=mesa.git 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 Tested-by: Marge Bot Part-of: --- 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); }