From: Michal Krol Date: Tue, 2 Mar 2010 12:35:30 +0000 (+0100) Subject: Merge branch 'gallium-no-rhw-position' X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4ca70c489baed3e23dbf5e5e5794385113e22252;p=mesa.git Merge branch 'gallium-no-rhw-position' Conflicts: src/gallium/drivers/r300/r300_blit.c src/gallium/drivers/r300/r300_emit.c src/gallium/drivers/r300/r300_state_derived.c --- 4ca70c489baed3e23dbf5e5e5794385113e22252 diff --cc src/gallium/drivers/r300/r300_blit.c index 32d05749bdb,ec7414dc369..8acb1098b96 --- a/src/gallium/drivers/r300/r300_blit.c +++ b/src/gallium/drivers/r300/r300_blit.c @@@ -33,7 -33,9 +33,9 @@@ static void r300_blitter_save_states(st util_blitter_save_stencil_ref(r300->blitter, &(r300->stencil_ref)); util_blitter_save_rasterizer(r300->blitter, r300->rs_state.state); util_blitter_save_fragment_shader(r300->blitter, r300->fs); - util_blitter_save_vertex_shader(r300->blitter, r300->vs); + util_blitter_save_vertex_shader(r300->blitter, r300->vs_state.state); + util_blitter_save_viewport(r300->blitter, &r300->viewport); + util_blitter_save_clip(r300->blitter, &r300->clip); } /* Clear currently bound buffers. */ diff --cc src/gallium/drivers/r300/r300_context.h index b98fe347b88,97100c08ccb..0d1518a05bc --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@@ -351,11 -331,12 +351,15 @@@ struct r300_context struct pipe_vertex_element vertex_element[PIPE_MAX_ATTRIBS]; int vertex_element_count; + /* Vertex info for Draw. */ + struct vertex_info vertex_info; + struct pipe_stencil_ref stencil_ref; + struct pipe_clip_state clip; + + struct pipe_viewport_state viewport; + /* Bitmask of dirty state objects. */ uint32_t dirty_state; /* Flag indicating whether or not the HW is dirty. */ diff --cc src/gallium/drivers/r300/r300_emit.c index 17d55ba3b43,37ebe6c49df..addb28bded3 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@@ -946,26 -928,40 +938,20 @@@ void r300_emit_viewport_state(struct r3 struct r300_viewport_state* viewport = (struct r300_viewport_state*)state; CS_LOCALS(r300); - if (r300->tcl_bypass) { - BEGIN_CS(2); /* XXX tcl_bypass will be removed in gallium anyway */ - OUT_CS_REG(R300_VAP_VTE_CNTL, 0); - END_CS; - } else { - BEGIN_CS(size); - OUT_CS_REG_SEQ(R300_SE_VPORT_XSCALE, 6); - OUT_CS_32F(viewport->xscale); - OUT_CS_32F(viewport->xoffset); - OUT_CS_32F(viewport->yscale); - OUT_CS_32F(viewport->yoffset); - OUT_CS_32F(viewport->zscale); - OUT_CS_32F(viewport->zoffset); - OUT_CS_REG(R300_VAP_VTE_CNTL, viewport->vte_control); - END_CS; - BEGIN_CS(9); - OUT_CS_REG_SEQ(R300_SE_VPORT_XSCALE, 6); - OUT_CS_32F(viewport->xscale); - OUT_CS_32F(viewport->xoffset); - OUT_CS_32F(viewport->yscale); - OUT_CS_32F(viewport->yoffset); - OUT_CS_32F(viewport->zscale); - OUT_CS_32F(viewport->zoffset); - OUT_CS_REG(R300_VAP_VTE_CNTL, viewport->vte_control); - END_CS; -} - -void r300_emit_texture_count(struct r300_context* r300) -{ - uint32_t tx_enable = 0; - int i; - CS_LOCALS(r300); - - /* Notice that texture_count and sampler_count are just sizes - * of the respective arrays. We still have to check for the individual - * elements. */ - for (i = 0; i < MIN2(r300->sampler_count, r300->texture_count); i++) { - if (r300->textures[i]) { - tx_enable |= 1 << i; - } -- } - - BEGIN_CS(2); - OUT_CS_REG(R300_TX_ENABLE, tx_enable); - END_CS; - ++ BEGIN_CS(size); ++ OUT_CS_REG_SEQ(R300_SE_VPORT_XSCALE, 6); ++ OUT_CS_32F(viewport->xscale); ++ OUT_CS_32F(viewport->xoffset); ++ OUT_CS_32F(viewport->yscale); ++ OUT_CS_32F(viewport->yoffset); ++ OUT_CS_32F(viewport->zscale); ++ OUT_CS_32F(viewport->zoffset); ++ OUT_CS_REG(R300_VAP_VTE_CNTL, viewport->vte_control); ++ END_CS; } -void r300_emit_ztop_state(struct r300_context* r300, void* state) +void r300_emit_ztop_state(struct r300_context* r300, + unsigned size, void* state) { struct r300_ztop_state* ztop = (struct r300_ztop_state*)state; CS_LOCALS(r300); diff --cc src/gallium/drivers/r300/r300_state.c index 12bf0838711,ebb859138fa..b732380a145 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@@ -811,11 -825,8 +812,9 @@@ static void r300_bind_rs_state(struct p } if (rs) { - r300->tcl_bypass = rs->rs.bypass_vs_clip_and_viewport; r300->polygon_offset_enabled = rs->rs.offset_cw || rs->rs.offset_ccw; + r300->rs_state.dirty = TRUE; } else { - r300->tcl_bypass = FALSE; r300->polygon_offset_enabled = FALSE; } diff --cc src/gallium/drivers/r300/r300_state_derived.c index 6eb7f2bfd19,778eaaacd99..9c8e907fdf7 --- a/src/gallium/drivers/r300/r300_state_derived.c +++ b/src/gallium/drivers/r300/r300_state_derived.c @@@ -117,15 -114,7 +117,9 @@@ static void r300_vertex_psc(struct r300 int identity[16] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; int* stream_tab; + memset(vformat, 0, sizeof(struct r300_vertex_stream_state)); + - /* If TCL is bypassed, map vertex streams to equivalent VS output - * locations. */ - if (r300->tcl_bypass) { - stream_tab = vs->stream_loc_notcl; - } else { - stream_tab = identity; - } + stream_tab = identity; /* Vertex shaders have no semantics on their inputs, * so PSC should just route stuff based on the vertex elements,