mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 02:38:04 +02:00
swr: fix resource backed constant buffers
Code was using an incorrect address for the base pointer. v2: use swr_resource_data() utility function. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94979 Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com> Tested-by: Markus Wick <markus@selfnet.de>
This commit is contained in:
parent
2ac2ecdd6c
commit
3bbe8a09ea
2 changed files with 7 additions and 7 deletions
|
|
@ -85,7 +85,7 @@ swr_resource_is_texture(const struct pipe_resource *resource)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static INLINE void *
|
static INLINE uint8_t *
|
||||||
swr_resource_data(struct pipe_resource *resource)
|
swr_resource_data(struct pipe_resource *resource)
|
||||||
{
|
{
|
||||||
struct swr_resource *swr_r = swr_resource(resource);
|
struct swr_resource *swr_r = swr_resource(resource);
|
||||||
|
|
|
||||||
|
|
@ -936,8 +936,7 @@ swr_update_derived(struct pipe_context *pipe,
|
||||||
max_vertex = size / pitch;
|
max_vertex = size / pitch;
|
||||||
partial_inbounds = size % pitch;
|
partial_inbounds = size % pitch;
|
||||||
|
|
||||||
p_data = (const uint8_t *)swr_resource_data(vb->buffer)
|
p_data = swr_resource_data(vb->buffer) + vb->buffer_offset;
|
||||||
+ vb->buffer_offset;
|
|
||||||
} else {
|
} else {
|
||||||
/* Client buffer
|
/* Client buffer
|
||||||
* client memory is one-time use, re-trigger SWR_NEW_VERTEX to
|
* client memory is one-time use, re-trigger SWR_NEW_VERTEX to
|
||||||
|
|
@ -989,8 +988,7 @@ swr_update_derived(struct pipe_context *pipe,
|
||||||
* size is based on buffer->width0 rather than info.count
|
* size is based on buffer->width0 rather than info.count
|
||||||
* to prevent having to validate VBO on each draw */
|
* to prevent having to validate VBO on each draw */
|
||||||
size = ib->buffer->width0;
|
size = ib->buffer->width0;
|
||||||
p_data =
|
p_data = swr_resource_data(ib->buffer) + ib->offset;
|
||||||
(const uint8_t *)swr_resource_data(ib->buffer) + ib->offset;
|
|
||||||
} else {
|
} else {
|
||||||
/* Client buffer
|
/* Client buffer
|
||||||
* client memory is one-time use, re-trigger SWR_NEW_VERTEX to
|
* client memory is one-time use, re-trigger SWR_NEW_VERTEX to
|
||||||
|
|
@ -1138,7 +1136,8 @@ swr_update_derived(struct pipe_context *pipe,
|
||||||
pDC->num_constantsVS[i] = cb->buffer_size;
|
pDC->num_constantsVS[i] = cb->buffer_size;
|
||||||
if (cb->buffer)
|
if (cb->buffer)
|
||||||
pDC->constantVS[i] =
|
pDC->constantVS[i] =
|
||||||
(const float *)((const uint8_t *)cb->buffer + cb->buffer_offset);
|
(const float *)(swr_resource_data(cb->buffer) +
|
||||||
|
cb->buffer_offset);
|
||||||
else {
|
else {
|
||||||
/* Need to copy these constants to scratch space */
|
/* Need to copy these constants to scratch space */
|
||||||
if (cb->user_buffer && cb->buffer_size) {
|
if (cb->user_buffer && cb->buffer_size) {
|
||||||
|
|
@ -1163,7 +1162,8 @@ swr_update_derived(struct pipe_context *pipe,
|
||||||
pDC->num_constantsFS[i] = cb->buffer_size;
|
pDC->num_constantsFS[i] = cb->buffer_size;
|
||||||
if (cb->buffer)
|
if (cb->buffer)
|
||||||
pDC->constantFS[i] =
|
pDC->constantFS[i] =
|
||||||
(const float *)((const uint8_t *)cb->buffer + cb->buffer_offset);
|
(const float *)(swr_resource_data(cb->buffer) +
|
||||||
|
cb->buffer_offset);
|
||||||
else {
|
else {
|
||||||
/* Need to copy these constants to scratch space */
|
/* Need to copy these constants to scratch space */
|
||||||
if (cb->user_buffer && cb->buffer_size) {
|
if (cb->user_buffer && cb->buffer_size) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue