From 30ba4bfe630e2c0c0fd34f7858f41d5e3bb2b43f Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 11 Aug 2025 11:16:21 -0400 Subject: [PATCH] llvmpipe: set prefer_real_buffer_in_constbuf0 and delete user buffer path this was redundant Part-of: --- src/gallium/drivers/llvmpipe/lp_screen.c | 1 + src/gallium/drivers/llvmpipe/lp_state_fs.c | 12 ++---------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index e9060f99e1c..81b7336bc1b 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -212,6 +212,7 @@ llvmpipe_init_screen_caps(struct pipe_screen *screen) #if defined(HAVE_LIBDRM) && defined(HAVE_LINUX_UDMABUF_H) caps->native_fence_fd = lscreen->dummy_sync_fd != -1; #endif + caps->prefer_real_buffer_in_constbuf0 = true; caps->npot_textures = true; caps->mixed_framebuffer_sizes = true; caps->mixed_color_depth_bits = true; diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index 3b422ab2788..229afa2b262 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -4294,17 +4294,9 @@ llvmpipe_set_constant_buffer(struct pipe_context *pipe, /* note: reference counting */ util_copy_constant_buffer(&llvmpipe->constants[shader][index], cb); - /* user_buffer is only valid until the next set_constant_buffer (at most, - * possibly until shader deletion), so we need to upload it now to make - * sure it doesn't get updated/freed out from under us. - */ - if (constants->user_buffer) { - u_upload_data_ref(llvmpipe->pipe.const_uploader, 0, constants->buffer_size, - 16, constants->user_buffer, &constants->buffer_offset, - &constants->buffer); - } + assert(!constants->user_buffer); if (constants->buffer) { - if (!(constants->buffer->bind & PIPE_BIND_CONSTANT_BUFFER)) { + if (!(constants->buffer->bind & PIPE_BIND_CONSTANT_BUFFER)) { debug_printf("Illegal set constant without bind flag\n"); constants->buffer->bind |= PIPE_BIND_CONSTANT_BUFFER; }