Lines Matching refs:r300
45 static boolean r300_stencilref_needed(struct r300_context *r300)
47 struct r300_dsa_state *dsa = (struct r300_dsa_state*)r300->dsa_state.state;
51 r300->stencil_ref.ref_value[0] != r300->stencil_ref.ref_value[1]);
55 static void r300_stencilref_begin(struct r300_context *r300)
57 struct r300_stencilref_context *sr = r300->stencilref_fallback;
58 struct r300_rs_state *rs = (struct r300_rs_state*)r300->rs_state.state;
59 struct r300_dsa_state *dsa = (struct r300_dsa_state*)r300->dsa_state.state;
64 sr->ref_value_front = r300->stencil_ref.ref_value[0];
69 r300_mark_atom_dirty(r300, &r300->rs_state);
73 static void r300_stencilref_switch_side(struct r300_context *r300)
75 struct r300_stencilref_context *sr = r300->stencilref_fallback;
76 struct r300_rs_state *rs = (struct r300_rs_state*)r300->rs_state.state;
77 struct r300_dsa_state *dsa = (struct r300_dsa_state*)r300->dsa_state.state;
81 r300->stencil_ref.ref_value[0] = r300->stencil_ref.ref_value[1];
83 r300_mark_atom_dirty(r300, &r300->rs_state);
84 r300_mark_atom_dirty(r300, &r300->dsa_state);
88 static void r300_stencilref_end(struct r300_context *r300)
90 struct r300_stencilref_context *sr = r300->stencilref_fallback;
91 struct r300_rs_state *rs = (struct r300_rs_state*)r300->rs_state.state;
92 struct r300_dsa_state *dsa = (struct r300_dsa_state*)r300->dsa_state.state;
97 r300->stencil_ref.ref_value[0] = sr->ref_value_front;
99 r300_mark_atom_dirty(r300, &r300->rs_state);
100 r300_mark_atom_dirty(r300, &r300->dsa_state);
106 struct r300_context *r300 = r300_context(pipe);
107 struct r300_stencilref_context *sr = r300->stencilref_fallback;
109 if (!r300_stencilref_needed(r300)) {
112 r300_stencilref_begin(r300);
114 r300_stencilref_switch_side(r300);
116 r300_stencilref_end(r300);
120 void r300_plug_in_stencil_ref_fallback(struct r300_context *r300)
122 r300->stencilref_fallback = CALLOC_STRUCT(r300_stencilref_context);
125 r300->stencilref_fallback->draw_vbo = r300->context.draw_vbo;
128 r300->context.draw_vbo = r300_stencilref_draw_vbo;