[Mesa-dev] [PATCH] swr: fix resource backed constant buffers

Chuck Atkins chuck.atkins at kitware.com
Wed Apr 20 14:01:34 UTC 2016


While i never got this error in the first place, I can attest that it
certainly hasn't broken any use in paraview, so...

Tested-by: Chuck Atkins <chuck.atkins at kitware.com>

- Chuck

On Tue, Apr 19, 2016 at 1:45 AM, Markus Wick <markus at selfnet.de> wrote:

> Am 2016-04-19 01:12, schrieb Tim Rowley:
>
>> Code was using an incorrect address for the base pointer.
>>
>
> Tested-by: Markus Wick <markus at 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 at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160420/262ac985/attachment.html>


More information about the mesa-dev mailing list