This makes glxgears draw properly with SW TCL.
r300->context.is_texture_referenced = r300_is_texture_referenced;
r300->context.is_buffer_referenced = r300_is_buffer_referenced;
+ /* Create a Draw. This is used for vert collation and SW TCL. */
r300->draw = draw_create();
+ /* Enable our renderer. */
draw_set_rasterize_stage(r300->draw, r300_draw_stage(r300));
+ /* Tell Draw that we can always do non-UCP clipping. */
+ draw_set_driver_clipping(r300->draw, TRUE);
+ /* Force Draw to never do viewport transform, since (again) we can do
+ * transform in hardware, always. */
+ draw_set_viewport_state(r300->draw, &r300_viewport_identity);
r300->blend_color_state = CALLOC_STRUCT(r300_blend_color_state);
r300->rs_block = CALLOC_STRUCT(r300_rs_block);
/* Draw-specific rasterizer state */
struct pipe_rasterizer_state rs;
+ /* Whether or not to enable the VTE. This is referenced at the very
+ * last moment during emission of VTE state, to decide whether or not
+ * the VTE should be used for transformation. */
+ boolean enable_vte;
+
uint32_t vap_control_status; /* R300_VAP_CNTL_STATUS: 0x2140 */
uint32_t point_size; /* R300_GA_POINT_SIZE: 0x421c */
uint32_t point_minmax; /* R300_GA_POINT_MINMAX: 0x4230 */
} instructions[128]; /*< XXX magic number */
};
+static struct pipe_viewport_state r300_viewport_identity = {
+ .scale = {1.0, 1.0, 1.0, 1.0},
+ .translate = {0.0, 0.0, 0.0, 0.0},
+};
+
struct r300_context {
/* Parent class */
struct pipe_context context;
OUT_CS_32F(viewport->zscale);
OUT_CS_32F(viewport->zoffset);
- OUT_CS_REG(R300_VAP_VTE_CNTL, viewport->vte_control);
+ if (r300->rs_state->enable_vte) {
+ OUT_CS_REG(R300_VAP_VTE_CNTL, viewport->vte_control);
+ } else {
+ OUT_CS_REG(R300_VAP_VTE_CNTL, 0);
+ }
END_CS;
}
/* Copy rasterizer state for Draw. */
rs->rs = *state;
+ rs->enable_vte = !state->bypass_vs_clip_and_viewport;
+
/* 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 ||
{
struct r300_context* r300 = r300_context(pipe);
- draw_flush(r300->draw);
+ //draw_flush(r300->draw);
- if (r300_screen(r300->context.screen)->caps->has_tcl) {
+ if (TRUE || r300_screen(r300->context.screen)->caps->has_tcl) {
/* Do the transform in HW. */
- r300->viewport_state->vte_control = R300_VTX_XY_FMT | R300_VTX_Z_FMT;
+ r300->viewport_state->vte_control = R300_VTX_W0_FMT;
if (state->scale[0] != 1.0f) {
assert(state->scale[0] != 0.0f);