Lines Matching refs:r300
53 static void r300_draw_emit_attrib(struct r300_context* r300,
58 struct r300_vertex_shader* vs = r300->vs_state.state;
62 output = draw_find_shader_output(r300->draw,
65 draw_emit_vertex_attr(&r300->vertex_info, emit, interp, output);
68 static void r300_draw_emit_all_attribs(struct r300_context* r300)
70 struct r300_vertex_shader* vs = r300->vs_state.state;
76 r300_draw_emit_attrib(r300, EMIT_4F, INTERP_PERSPECTIVE,
84 r300_draw_emit_attrib(r300, EMIT_1F_PSIZE, INTERP_POS,
91 r300_draw_emit_attrib(r300, EMIT_4F, INTERP_LINEAR,
99 r300_draw_emit_attrib(r300, EMIT_4F, INTERP_LINEAR,
110 !(r300->sprite_coord_enable & (1 << i))) {
111 r300_draw_emit_attrib(r300, EMIT_4F, INTERP_PERSPECTIVE,
119 r300_draw_emit_attrib(r300, EMIT_4F, INTERP_PERSPECTIVE,
125 if (r300_fs(r300)->shader->inputs.wpos != ATTR_UNUSED && gen_count < 8) {
126 DBG(r300, DBG_SWTCL, "draw_emit_attrib: WPOS, index: %i\n",
128 r300_draw_emit_attrib(r300, EMIT_4F, INTERP_PERSPECTIVE,
134 static void r300_swtcl_vertex_psc(struct r300_context *r300)
136 struct r300_vertex_stream_state *vstream = r300->vertex_stream_state.state;
137 struct vertex_info *vinfo = &r300->vertex_info;
141 int* vs_output_tab = r300->stream_loc_notcl;
148 DBG(r300, DBG_SWTCL, "r300: attrib count: %d\n", attrib_count);
157 DBG(r300, DBG_SWTCL,
158 "r300: swtcl_vertex_psc [%i] <- %s\n",
164 fprintf(stderr, "r300: Bad vertex format %s.\n",
194 r300_mark_atom_dirty(r300, &r300->vertex_stream_state);
195 r300->vertex_stream_state.size = (1 + vstream->count) * 2;
312 static void r300_update_rs_block(struct r300_context *r300)
314 struct r300_vertex_shader *vs = r300->vs_state.state;
316 struct r300_shader_semantics *fs_inputs = &r300_fs(r300)->shader->inputs;
325 int *stream_loc_notcl = r300->stream_loc_notcl;
328 if (r300->screen->caps.is_r500) {
374 DBG(r300, DBG_RS,
375 "r300: Rasterized color %i written to FS.\n", i);
377 DBG(r300, DBG_RS, "r300: Rasterized color %i unused.\n", i);
386 DBG(r300, DBG_RS, "r300: FS input color %i unassigned%s.\n",
395 if (r300->two_sided_color) {
428 if (r300->screen->caps.is_r500 && fs_inputs->face != ATTR_UNUSED &&
429 !(any_bcolor_used && r300->two_sided_color)) {
434 DBG(r300, DBG_RS, "r300: Rasterized FACE written to FS.\n");
436 fprintf(stderr, "r300: ERROR: FS input FACE unassigned.\n");
444 sprite_coord = !!(r300->sprite_coord_enable & (1 << i));
466 DBG(r300, DBG_RS,
467 "r300: Rasterized generic %i written to FS%s in texcoord %d.\n",
470 DBG(r300, DBG_RS,
471 "r300: Rasterized generic %i unused%s.\n",
482 DBG(r300, DBG_RS, "r300: FS input generic %i unassigned%s.\n",
490 fprintf(stderr, "r300: ERROR: FS input generic %i unassigned, "
511 DBG(r300, DBG_RS, "r300: Rasterized fog written to FS.\n");
513 DBG(r300, DBG_RS, "r300: Rasterized fog unused.\n");
524 DBG(r300, DBG_RS, "r300: FS input fog unassigned.\n");
526 fprintf(stderr, "r300: ERROR: FS input fog unassigned, "
547 DBG(r300, DBG_RS, "r300: Rasterized WPOS written to FS.\n");
554 fprintf(stderr, "r300: ERROR: FS input WPOS unassigned, "
570 DBG(r300, DBG_RS, "r300: Rasterized color 0 to prevent lockups.\n");
573 DBG(r300, DBG_RS, "r300: --- Rasterizer status ---: colors: %i, "
583 if (r300->sprite_coord_enable)
589 if (memcmp(r300->rs_block_state.state, &rs, sizeof(struct r300_rs_block))) {
590 memcpy(r300->rs_block_state.state, &rs, sizeof(struct r300_rs_block));
591 r300->rs_block_state.size = 13 + count*2;
742 static void r300_merge_textures_and_samplers(struct r300_context* r300)
745 (struct r300_textures_state*)r300->textures_state.state;
753 boolean has_us_format = r300->screen->caps.has_us_format;
756 if (!count && !r300->screen->caps.is_r500)
780 r300->screen->caps.is_r500);
801 r300_texture_setup_format_state(r300->screen, tex,
818 if (!r300->screen->caps.is_r500 &&
843 if (r300->screen->caps.dxtc_swizzle &&
926 if (i == 0 && !r300->screen->caps.is_r500) {
929 &r300->texkill_sampler->base);
936 texstate->format = r300->texkill_sampler->format;
952 r300->textures_state.size = size;
957 r300->fs_status == FRAGMENT_SHADER_VALID) {
958 r300->fs_status = FRAGMENT_SHADER_MAYBE_DIRTY;
962 static void r300_decompress_depth_textures(struct r300_context *r300)
965 (struct r300_textures_state*)r300->textures_state.state;
971 if (!r300->locked_zbuffer) {
979 if (tex == r300->locked_zbuffer->texture) {
980 r300_decompress_zmask_locked(r300);
987 static void r300_validate_fragment_shader(struct r300_context *r300)
989 struct pipe_framebuffer_state *fb = r300->fb_state.state;
991 if (r300->fs.state && r300->fs_status != FRAGMENT_SHADER_VALID) {
995 if (r300_pick_fragment_shader(r300) ||
996 r300->fs_status == FRAGMENT_SHADER_DIRTY) {
998 r300_mark_fs_code_dirty(r300);
1003 r300_fragment_shader_writes_all(r300_fs(r300));
1005 if (r300->fb_multiwrite != new_multiwrite) {
1006 r300->fb_multiwrite = new_multiwrite;
1007 r300_mark_fb_state_dirty(r300, R300_CHANGED_MULTIWRITE);
1011 r300->fs_status = FRAGMENT_SHADER_VALID;
1015 void r300_update_derived_state(struct r300_context* r300)
1017 if (r300->textures_state.dirty) {
1018 r300_decompress_depth_textures(r300);
1019 r300_merge_textures_and_samplers(r300);
1022 r300_validate_fragment_shader(r300);
1024 if (r300->rs_block_state.dirty) {
1025 r300_update_rs_block(r300);
1027 if (r300->draw) {
1028 memset(&r300->vertex_info, 0, sizeof(struct vertex_info));
1029 r300_draw_emit_all_attribs(r300);
1030 draw_compute_vertex_size(&r300->vertex_info);
1031 r300_swtcl_vertex_psc(r300);
1035 r300_update_hyperz_state(r300);