Mesa (staging/19.2): iris: Fix constant buffer sizes for non-UBOs
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Sep 11 16:04:53 UTC 2019
Module: Mesa
Branch: staging/19.2
Commit: 571c55d8b60dc671d884fad7f8071abf40981fb1
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=571c55d8b60dc671d884fad7f8071abf40981fb1
Author: Kenneth Graunke <kenneth at whitecape.org>
Date: Tue Sep 10 09:04:20 2019 -0700
iris: Fix constant buffer sizes for non-UBOs
Since the system value refactor, we've accidentally only been setting
cbuf->buffer_size in the UBO case, and not in the uploaded-constants
case. We use cbuf->buffer_size to fill out the SURFACE_STATE entry,
so it needs to be initialized in both cases.
Fixes: 3b6d787e404 ("iris: move sysvals to their own constant buffer")
(cherry picked from commit 077a1952cceb9b577437c9e31be094427d5c7a9a)
---
src/gallium/drivers/iris/iris_state.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c
index 02b8683487e..12910df3ebf 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -2676,11 +2676,12 @@ iris_set_constant_buffer(struct pipe_context *ctx,
pipe_resource_reference(&cbuf->buffer, input->buffer);
cbuf->buffer_offset = input->buffer_offset;
- cbuf->buffer_size =
- MIN2(input->buffer_size,
- iris_resource_bo(cbuf->buffer)->size - cbuf->buffer_offset);
}
+ cbuf->buffer_size =
+ MIN2(input->buffer_size,
+ iris_resource_bo(cbuf->buffer)->size - cbuf->buffer_offset);
+
struct iris_resource *res = (void *) cbuf->buffer;
res->bind_history |= PIPE_BIND_CONSTANT_BUFFER;
More information about the mesa-commit
mailing list