Commit 2108b73c authored by Marek Olšák's avatar Marek Olšák

st/mesa: use precomputed st_fb_orientation

Reviewed-by: default avatarNicolai Hähnle <nicolai.haehnle@amd.com>
parent 91579254
......@@ -8,10 +8,7 @@ ST_STATE(ST_NEW_TES_STATE, st_update_tep)
ST_STATE(ST_NEW_TCS_STATE, st_update_tcp)
ST_STATE(ST_NEW_VS_STATE, st_update_vp)
ST_STATE(ST_NEW_RASTERIZER, st_update_rasterizer)
ST_STATE(ST_NEW_POLY_STIPPLE, st_update_polygon_stipple)
ST_STATE(ST_NEW_VIEWPORT, st_update_viewport)
ST_STATE(ST_NEW_SCISSOR, st_update_scissor)
ST_STATE(ST_NEW_WINDOW_RECTANGLES, st_update_window_rectangles)
ST_STATE(ST_NEW_BLEND, st_update_blend)
ST_STATE(ST_NEW_BLEND_COLOR, st_update_blend_color)
......@@ -36,8 +33,11 @@ ST_STATE(ST_NEW_GS_IMAGES, st_bind_gs_images)
ST_STATE(ST_NEW_FS_IMAGES, st_bind_fs_images)
ST_STATE(ST_NEW_FB_STATE, st_update_framebuffer_state) /* depends on update_*_texture and bind_*_images */
ST_STATE(ST_NEW_RASTERIZER, st_update_rasterizer) /* depends on update_framebuffer_state */
ST_STATE(ST_NEW_SAMPLE_MASK, st_update_sample_mask) /* depends on update_framebuffer_state */
ST_STATE(ST_NEW_SAMPLE_SHADING, st_update_sample_shading)
ST_STATE(ST_NEW_SCISSOR, st_update_scissor) /* depends on update_framebuffer_state */
ST_STATE(ST_NEW_VIEWPORT, st_update_viewport) /* depends on update_framebuffer_state */
ST_STATE(ST_NEW_VS_CONSTANTS, st_update_vs_constants)
ST_STATE(ST_NEW_TCS_CONSTANTS, st_update_tcs_constants)
......
......@@ -86,7 +86,7 @@ void st_update_rasterizer( struct st_context *st )
* must match OpenGL conventions so FBOs use Y=0=BOTTOM. In that
* case, we must invert Y and flip the notion of front vs. back.
*/
if (st_fb_orientation(ctx->DrawBuffer) == Y_0_BOTTOM) {
if (st->state.fb_orientation == Y_0_BOTTOM) {
/* Drawing to an FBO. The viewport will be inverted. */
raster->front_ccw ^= 1;
}
......@@ -174,7 +174,7 @@ void st_update_rasterizer( struct st_context *st )
if (ctx->Point.PointSprite) {
/* origin */
if ((ctx->Point.SpriteOrigin == GL_UPPER_LEFT) ^
(st_fb_orientation(ctx->DrawBuffer) == Y_0_BOTTOM))
(st->state.fb_orientation == Y_0_BOTTOM))
raster->sprite_coord_mode = PIPE_SPRITE_COORD_UPPER_LEFT;
else
raster->sprite_coord_mode = PIPE_SPRITE_COORD_LOWER_LEFT;
......@@ -269,7 +269,7 @@ void st_update_rasterizer( struct st_context *st )
ctx->Color._ClampFragmentColor;
raster->half_pixel_center = 1;
if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP)
if (st->state.fb_orientation == Y_0_TOP)
raster->bottom_edge_rule = 1;
/* _NEW_TRANSFORM */
if (ctx->Transform.ClipOrigin == GL_UPPER_LEFT)
......
......@@ -82,7 +82,7 @@ st_update_scissor( struct st_context *st )
/* Now invert Y if needed.
* Gallium drivers use the convention Y=0=top for surfaces.
*/
if (st_fb_orientation(fb) == Y_0_TOP) {
if (st->state.fb_orientation == Y_0_TOP) {
miny = fb->Height - scissor[i].maxy;
maxy = fb->Height - scissor[i].miny;
scissor[i].miny = miny;
......
......@@ -47,7 +47,7 @@ st_update_viewport( struct st_context *st )
unsigned i;
/* _NEW_BUFFERS
*/
if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) {
if (st->state.fb_orientation == Y_0_TOP) {
/* Drawing to a window. The corresponding gallium surface uses
* Y=0=TOP but OpenGL is Y=0=BOTTOM. So we need to invert the viewport.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment