[Mesa-dev] [PATCH] draw/pt: adjust overflow calculations
Alex Deucher
alexdeucher at gmail.com
Fri May 3 05:41:47 PDT 2013
On Thu, May 2, 2013 at 11:40 PM, Zack Rusin <zackr at vmware.com> wrote:
> gallium lies. buffer_size is not actually buffer_size but available
> size, which is 'buffer_size - buffer_offset' so by adding buffer
> offset we'd incorrectly compute overflow.
Maybe add a comment to that effect in the code?
Alex
>
> Signed-off-by: Zack Rusin <zackr at vmware.com>
> ---
> src/gallium/auxiliary/draw/draw_pt_so_emit.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/src/gallium/auxiliary/draw/draw_pt_so_emit.c b/src/gallium/auxiliary/draw/draw_pt_so_emit.c
> index 9b55773..d624a99 100644
> --- a/src/gallium/auxiliary/draw/draw_pt_so_emit.c
> +++ b/src/gallium/auxiliary/draw/draw_pt_so_emit.c
> @@ -131,8 +131,7 @@ static void so_emit_prim(struct pt_so_emit *so,
> for (i = 0; i < draw->so.num_targets; i++) {
> struct draw_so_target *target = draw->so.targets[i];
> if (target) {
> - buffer_total_bytes[i] = target->internal_offset +
> - target->target.buffer_offset;
> + buffer_total_bytes[i] = target->internal_offset;
> } else {
> buffer_total_bytes[i] = 0;
> }
> --
> 1.7.10.4
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list