Am 2016-04-19 01:12, schrieb Tim Rowley:
Code was using an incorrect address for the base pointer.

Tested-by: Markus Wick <mar...@selfnet.de>

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94979
---
 src/gallium/drivers/swr/swr_state.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/swr/swr_state.cpp
b/src/gallium/drivers/swr/swr_state.cpp
index ded51a9..0e0979d 100644
--- a/src/gallium/drivers/swr/swr_state.cpp
+++ b/src/gallium/drivers/swr/swr_state.cpp
@@ -1138,7 +1138,8 @@ swr_update_derived(struct pipe_context *pipe,
          pDC->num_constantsVS[i] = cb->buffer_size;
          if (cb->buffer)
             pDC->constantVS[i] =
-               (const float *)((const uint8_t *)cb->buffer +
cb->buffer_offset);
+ (const float *)(swr_resource(cb->buffer)->swr.pBaseAddress +
+                               cb->buffer_offset);
          else {
             /* Need to copy these constants to scratch space */
             if (cb->user_buffer && cb->buffer_size) {
@@ -1163,7 +1164,8 @@ swr_update_derived(struct pipe_context *pipe,
          pDC->num_constantsFS[i] = cb->buffer_size;
          if (cb->buffer)
             pDC->constantFS[i] =
-               (const float *)((const uint8_t *)cb->buffer +
cb->buffer_offset);
+ (const float *)(swr_resource(cb->buffer)->swr.pBaseAddress +
+                               cb->buffer_offset);
          else {
             /* Need to copy these constants to scratch space */
             if (cb->user_buffer && cb->buffer_size) {

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to