On Don, 2014-02-20 at 00:53 +0100, Francisco Jerez wrote:
> Tom Stellard <thomas.stell...@amd.com> writes:
> 
> > diff --git a/src/gallium/drivers/r600/evergreen_compute.c 
> > b/src/gallium/drivers/r600/evergreen_compute.c
> > index 70efe5c..efd7143 100644
> > --- a/src/gallium/drivers/r600/evergreen_compute.c
> > +++ b/src/gallium/drivers/r600/evergreen_compute.c
> > @@ -662,10 +662,18 @@ static void evergreen_set_global_binding(
> >  
> >     for (int i = 0; i < n; i++)
> >     {
> > +           uint32_t buffer_offset;
> > +           uint32_t handle;
> >             assert(resources[i]->target == PIPE_BUFFER);
> >             assert(resources[i]->bind & PIPE_BIND_GLOBAL);
> >  
> > -           *(handles[i]) = buffers[i]->chunk->start_in_dw * 4;
> > +           buffer_offset = util_le32_to_cpu(*(handles[i]));
> > +           handle = buffer_offset + buffers[i]->chunk->start_in_dw * 4;
> > +           if (R600_BIG_ENDIAN) {
> > +                   handle = util_bswap32(handle);
> > +           }
> > +
> > +           *(handles[i]) = handle;
> 
> I guess you could just do "*(handles[i]) = util_cpu_to_le32(handle)"?
> Oh, right, there isn't such a function -- though it would be trivial to
> implement.

Right, just add:

#define util_cpu_to_le64 util_le64_to_cpu [0]
#define util_cpu_to_le32 util_le32_to_cpu
#define util_cpu_to_le16 util_le16_to_cpu

[0] and add util_le64_to_cpu in the first place :)


-- 
Earthling Michel Dänzer            |                  http://www.amd.com
Libre software enthusiast          |                Mesa and X developer

Attachment: signature.asc
Description: This is a digitally signed message part

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

Reply via email to