From: Corbin Simpson Date: Tue, 9 Feb 2010 21:50:54 +0000 (-0800) Subject: r300g: Correct colorbuffer measurements. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=67b60b99348f50ead92e617a5085422da9d8c022;p=mesa.git r300g: Correct colorbuffer measurements. Also clarify changes from pointminmax. --- diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index da4ec542ade..13cd04a80cc 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -186,8 +186,10 @@ static float r300_get_paramf(struct pipe_screen* pscreen, int param) * rendering limits. 2048 pixels should be enough for anybody. */ if (r300screen->caps->is_r500) { return 4096.0f; + } else if (r300screen->caps->is_r400) { + return 4021.0f; } else { - return 2048.0f; + return 2560.0f; } case PIPE_CAP_MAX_TEXTURE_ANISOTROPY: return 16.0f; diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index d07e90860c2..5fe9285a4b2 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -493,6 +493,8 @@ static void const struct pipe_framebuffer_state* state) { struct r300_context* r300 = r300_context(pipe); + struct r300_screen* r300screen = r300_screen(pipe->screen); + unsigned max_width, max_height; uint32_t zbuffer_bpp = 0; r300->fb_state.size = (10 * state->nr_cbufs) + @@ -505,6 +507,20 @@ static void return; } + if (r300screen->caps->is_r500) { + max_width = max_height = 4096; + } else if (r300screen->caps->is_r400) { + max_width = max_height = 4021; + } else { + max_width = max_height = 2560; + } + + if (state->width > max_width || state->height > max_height) { + debug_printf("r300: Implementation error: Render targets are too " + "big in %s, refusing to bind framebuffer state!\n", __FUNCTION__); + return; + } + if (r300->draw) { draw_flush(r300->draw); } @@ -607,6 +623,7 @@ static void r300_set_polygon_stipple(struct pipe_context* pipe, static void* r300_create_rs_state(struct pipe_context* pipe, const struct pipe_rasterizer_state* state) { + struct r300_screen* r300screen = r300_screen(pipe->screen); struct r300_rs_state* rs = CALLOC_STRUCT(r300_rs_state); /* Copy rasterizer state for Draw. */ @@ -621,20 +638,28 @@ static void* r300_create_rs_state(struct pipe_context* pipe, /* If bypassing TCL, or if no TCL engine is present, turn off the HW TCL. * Else, enable HW TCL and force Draw's TCL off. */ if (state->bypass_vs_clip_and_viewport || - !r300_screen(pipe->screen)->caps->has_tcl) { + !r300screen->caps->has_tcl) { rs->vap_control_status |= R300_VAP_TCL_BYPASS; } rs->point_size = pack_float_16_6x(state->point_size) | (pack_float_16_6x(state->point_size) << R300_POINTSIZE_X_SHIFT); - /* set hw limits - clamping done by state tracker in vs or point_size - XXX always need to emit this? */ - rs->point_minmax = - ((int)(0.0 * 6.0) << - R300_GA_POINT_MINMAX_MIN_SHIFT) | - ((int)(4096.0 * 6.0) << - R300_GA_POINT_MINMAX_MAX_SHIFT); + /* Point minimum and maximum sizes. This register has to be emitted, + * and it'd be a step backwards to put it in invariant state. */ + if (r300screen->caps->is_r500) { + rs->point_minmax = + ((int)(0.0 * 6.0) << R300_GA_POINT_MINMAX_MIN_SHIFT) | + ((int)(4096.0 * 6.0) << R300_GA_POINT_MINMAX_MAX_SHIFT); + } else if (r300screen->caps->is_r500) { + rs->point_minmax = + ((int)(0.0 * 6.0) << R300_GA_POINT_MINMAX_MIN_SHIFT) | + ((int)(4021.0 * 6.0) << R300_GA_POINT_MINMAX_MAX_SHIFT); + } else { + rs->point_minmax = + ((int)(0.0 * 6.0) << R300_GA_POINT_MINMAX_MIN_SHIFT) | + ((int)(2560.0 * 6.0) << R300_GA_POINT_MINMAX_MAX_SHIFT); + } rs->line_control = pack_float_16_6x(state->line_width) | R300_GA_LINE_CNTL_END_TYPE_COMP; diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 67bf8ce13fd..417a57384c4 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -80,7 +80,6 @@ static void r300_setup_texture_state(struct r300_screen* screen, struct r300_tex state->format2 |= R500_TXHEIGHT_BIT11; } } - assert(is_r500 || (pt->width0 <= 2048 && pt->height0 <= 2048)); SCREEN_DBG(screen, DBG_TEX, "r300: Set texture state (%dx%d, %d levels)\n", pt->width0, pt->height0, pt->last_level);