mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 22:20:09 +01:00
iris: Enable guardband clipping
This commit is contained in:
parent
f062dcdfbb
commit
99cab4d381
1 changed files with 10 additions and 9 deletions
|
|
@ -1890,7 +1890,6 @@ viewport_extent(const struct pipe_viewport_state *state, int axis, float sign)
|
|||
return copysignf(state->scale[axis], sign) + state->translate[axis];
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
calculate_guardband_size(uint32_t fb_width, uint32_t fb_height,
|
||||
float m00, float m11, float m30, float m31,
|
||||
|
|
@ -1970,7 +1969,6 @@ calculate_guardband_size(uint32_t fb_width, uint32_t fb_height,
|
|||
*ymax = 0.0f;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The pipe->set_viewport_states() driver hook.
|
||||
|
|
@ -3952,12 +3950,18 @@ iris_upload_dirty_render_state(struct iris_context *ice,
|
|||
|
||||
for (unsigned i = 0; i < ice->state.num_viewports; i++) {
|
||||
const struct pipe_viewport_state *state = &ice->state.viewports[i];
|
||||
float gb_xmin, gb_xmax, gb_ymin, gb_ymax;
|
||||
|
||||
float vp_xmin = viewport_extent(state, 0, -1.0f);
|
||||
float vp_xmax = viewport_extent(state, 0, 1.0f);
|
||||
float vp_ymin = viewport_extent(state, 1, -1.0f);
|
||||
float vp_ymax = viewport_extent(state, 1, 1.0f);
|
||||
|
||||
calculate_guardband_size(cso_fb->width, cso_fb->height,
|
||||
state->scale[0], state->scale[1],
|
||||
state->translate[0], state->translate[1],
|
||||
&gb_xmin, &gb_xmax, &gb_ymin, &gb_ymax);
|
||||
|
||||
iris_pack_state(GENX(SF_CLIP_VIEWPORT), vp_map, vp) {
|
||||
vp.ViewportMatrixElementm00 = state->scale[0];
|
||||
vp.ViewportMatrixElementm11 = state->scale[1];
|
||||
|
|
@ -3965,13 +3969,10 @@ iris_upload_dirty_render_state(struct iris_context *ice,
|
|||
vp.ViewportMatrixElementm30 = state->translate[0];
|
||||
vp.ViewportMatrixElementm31 = state->translate[1];
|
||||
vp.ViewportMatrixElementm32 = state->translate[2];
|
||||
/* XXX: in i965 this is computed based on the drawbuffer size,
|
||||
* but we don't have that here...
|
||||
*/
|
||||
vp.XMinClipGuardband = -1.0;
|
||||
vp.XMaxClipGuardband = 1.0;
|
||||
vp.YMinClipGuardband = -1.0;
|
||||
vp.YMaxClipGuardband = 1.0;
|
||||
vp.XMinClipGuardband = gb_xmin;
|
||||
vp.XMaxClipGuardband = gb_xmax;
|
||||
vp.YMinClipGuardband = gb_ymin;
|
||||
vp.YMaxClipGuardband = gb_ymax;
|
||||
vp.XMinViewPort = MAX2(vp_xmin, 0);
|
||||
vp.XMaxViewPort = MIN2(vp_xmax, cso_fb->width) - 1;
|
||||
vp.YMinViewPort = MAX2(vp_ymin, 0);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue