X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fauxiliary%2Fdraw%2Fdraw_pipe_offset.c;h=8e321946ceda7b7dff528563d27c1c36ef7acd88;hb=f7c2d4fee3104008c21078879cbc5720d7bc1be6;hp=1fea5e6dcbc5bb5c7f23519d510f1f151a4f929e;hpb=dace236c5fffa29d59e4d12fa865889bbecbdd24;p=mesa.git diff --git a/src/gallium/auxiliary/draw/draw_pipe_offset.c b/src/gallium/auxiliary/draw/draw_pipe_offset.c index 1fea5e6dcbc..8e321946ced 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_offset.c +++ b/src/gallium/auxiliary/draw/draw_pipe_offset.c @@ -63,7 +63,7 @@ static INLINE struct offset_stage *offset_stage( struct draw_stage *stage ) static void do_offset_tri( struct draw_stage *stage, struct prim_header *header ) { - const unsigned pos = stage->draw->vs.position_output; + const unsigned pos = draw_current_shader_position_output(stage->draw); struct offset_stage *offset = offset_stage(stage); float inv_det = 1.0f / header->det; @@ -122,9 +122,8 @@ static void offset_first_tri( struct draw_stage *stage, struct prim_header *header ) { struct offset_stage *offset = offset_stage(stage); - float mrd = 1.0f / 65535.0f; /* XXX this depends on depthbuffer bits! */ - offset->units = stage->draw->rasterizer->offset_units * mrd; + offset->units = (float) (stage->draw->rasterizer->offset_units * stage->draw->mrd); offset->scale = stage->draw->rasterizer->offset_scale; stage->tri = offset_tri; @@ -162,11 +161,12 @@ struct draw_stage *draw_offset_stage( struct draw_context *draw ) { struct offset_stage *offset = CALLOC_STRUCT(offset_stage); if (offset == NULL) - goto fail; + return NULL; draw_alloc_temp_verts( &offset->stage, 3 ); offset->stage.draw = draw; + offset->stage.name = "offset"; offset->stage.next = NULL; offset->stage.point = draw_pipe_passthrough_point; offset->stage.line = draw_pipe_passthrough_line; @@ -176,10 +176,4 @@ struct draw_stage *draw_offset_stage( struct draw_context *draw ) offset->stage.destroy = offset_destroy; return &offset->stage; - - fail: - if (offset) - offset->stage.destroy( &offset->stage ); - - return NULL; }