mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-23 16:10:33 +01:00
i965g: calculate depth min/max
Previously hard-wired to 0..1
This commit is contained in:
parent
b7b2226a75
commit
9546c3dbd2
1 changed files with 9 additions and 2 deletions
|
|
@ -3,6 +3,7 @@
|
|||
#include "pipe/p_state.h"
|
||||
|
||||
#include "brw_context.h"
|
||||
#include "brw_debug.h"
|
||||
|
||||
/**
|
||||
* called from intelDrawBuffer()
|
||||
|
|
@ -51,8 +52,14 @@ static void brw_set_viewport_state( struct pipe_context *pipe,
|
|||
struct brw_context *brw = brw_context(pipe);
|
||||
|
||||
brw->curr.viewport = *viewport;
|
||||
brw->curr.ccv.min_depth = 0.0; /* XXX: near */
|
||||
brw->curr.ccv.max_depth = 1.0; /* XXX: far */
|
||||
brw->curr.ccv.min_depth = viewport->scale[2] * -1.0 + viewport->translate[2];
|
||||
brw->curr.ccv.max_depth = viewport->scale[2] * 1.0 + viewport->translate[2];
|
||||
|
||||
if (0)
|
||||
debug_printf("%s depth range %f .. %f\n",
|
||||
__FUNCTION__,
|
||||
brw->curr.ccv.min_depth,
|
||||
brw->curr.ccv.max_depth);
|
||||
|
||||
brw->state.dirty.mesa |= PIPE_NEW_VIEWPORT;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue