draw,llvmpipe,util: add depth bias calculation for arb_depth_buffer_float
authorMatthew McClure <mcclurem@vmware.com>
Tue, 29 Oct 2013 20:36:41 +0000 (13:36 -0700)
committerJosé Fonseca <jfonseca@vmware.com>
Thu, 7 Nov 2013 18:32:54 +0000 (18:32 +0000)
commitf9e2c24326869542c9b43220f63dd9841c6de38f
treebd208be0c8a880c0665c6672138083e00eeef680
parent185b5a54c94ce11487146042c8eec24909187ed6
draw,llvmpipe,util: add depth bias calculation for arb_depth_buffer_float

With this patch, the llvmpipe and draw modules will calculate the depth bias
according to floating point depth buffer semantics described in the
arb_depth_buffer_float specification, when the driver has a z buffer bound
with a format type of UTIL_FORMAT_TYPE_FLOAT.

By default, the driver will use the existing UNORM calculation for depth bias.

A new function, draw_set_zs_format, was added to calculate the Minimum
Resolvable Depth value and floating point depth sense for the draw module.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
14 files changed:
src/gallium/auxiliary/draw/draw_context.c
src/gallium/auxiliary/draw/draw_context.h
src/gallium/auxiliary/draw/draw_pipe_offset.c
src/gallium/auxiliary/draw/draw_private.h
src/gallium/auxiliary/util/u_format.c
src/gallium/auxiliary/util/u_format.h
src/gallium/auxiliary/util/u_math.h
src/gallium/drivers/llvmpipe/lp_context.h
src/gallium/drivers/llvmpipe/lp_state_derived.c
src/gallium/drivers/llvmpipe/lp_state_setup.c
src/gallium/drivers/llvmpipe/lp_state_setup.h
src/gallium/drivers/llvmpipe/lp_state_surface.c
src/gallium/drivers/softpipe/sp_state_surface.c
src/gallium/drivers/svga/svga_swtnl_state.c