Lines Matching refs:shader
89 struct r300_fragment_shader_code *shader) in find_output_registers() argument
94 compiler->OutputColor[0] = shader->info.num_outputs; in find_output_registers()
95 compiler->OutputColor[1] = shader->info.num_outputs; in find_output_registers()
96 compiler->OutputColor[2] = shader->info.num_outputs; in find_output_registers()
97 compiler->OutputColor[3] = shader->info.num_outputs; in find_output_registers()
98 compiler->OutputDepth = shader->info.num_outputs; in find_output_registers()
101 for(i = 0; i < shader->info.num_outputs; ++i) { in find_output_registers()
102 switch(shader->info.output_semantic_name[i]) { in find_output_registers()
210 struct r300_fragment_shader_code* shader,
215 struct r300_fragment_shader_code* shader) in r300_dummy_fragment_shader() argument
232 shader->dummy = TRUE; in r300_dummy_fragment_shader()
233 r300_translate_fragment_shader(r300, shader, state.tokens); in r300_dummy_fragment_shader()
240 struct r300_fragment_shader_code *shader) in r300_emit_fs_code_to_buffer() argument
242 struct rX00_fragment_program_code *generic_code = &shader->code; in r300_emit_fs_code_to_buffer()
243 unsigned imm_count = shader->immediates_count; in r300_emit_fs_code_to_buffer()
244 unsigned imm_first = shader->externals_count; in r300_emit_fs_code_to_buffer()
253 shader->cb_code_size = 19 + in r300_emit_fs_code_to_buffer()
258 NEW_CB(shader->cb_code, shader->cb_code_size); in r300_emit_fs_code_to_buffer()
308 shader->cb_code_size = 15 + in r300_emit_fs_code_to_buffer()
323 NEW_CB(shader->cb_code, shader->cb_code_size); in r300_emit_fs_code_to_buffer()
409 OUT_CB_REG(R300_FG_DEPTH_SRC, shader->fg_depth_src); in r300_emit_fs_code_to_buffer()
410 OUT_CB_REG(R300_US_W_FMT, shader->us_out_w); in r300_emit_fs_code_to_buffer()
416 struct r300_fragment_shader_code* shader, in r300_translate_fragment_shader() argument
424 tgsi_scan_shader(tokens, &shader->info); in r300_translate_fragment_shader()
425 r300_shader_read_fs_inputs(&shader->info, &shader->inputs); in r300_translate_fragment_shader()
427 wpos = shader->inputs.wpos; in r300_translate_fragment_shader()
428 face = shader->inputs.face; in r300_translate_fragment_shader()
436 compiler.code = &shader->code; in r300_translate_fragment_shader()
437 compiler.state = shader->compare_state; in r300_translate_fragment_shader()
452 compiler.UserData = &shader->inputs; in r300_translate_fragment_shader()
454 find_output_registers(&compiler, shader); in r300_translate_fragment_shader()
456 shader->write_all = in r300_translate_fragment_shader()
457 shader->info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS]; in r300_translate_fragment_shader()
466 ttr.info = &shader->info; in r300_translate_fragment_shader()
474 r300_dummy_fragment_shader(r300, shader); in r300_translate_fragment_shader()
506 if (shader->dummy) { in r300_translate_fragment_shader()
513 r300_dummy_fragment_shader(r300, shader); in r300_translate_fragment_shader()
519 if (shader->code.code.r500.inst_end == -1) { in r300_translate_fragment_shader()
521 r300_dummy_fragment_shader(r300, shader); in r300_translate_fragment_shader()
526 shader->externals_count = 0; in r300_translate_fragment_shader()
528 i < shader->code.constants.Count && in r300_translate_fragment_shader()
529 shader->code.constants.Constants[i].Type == RC_CONSTANT_EXTERNAL; i++) { in r300_translate_fragment_shader()
530 shader->externals_count = i+1; in r300_translate_fragment_shader()
532 shader->immediates_count = 0; in r300_translate_fragment_shader()
533 shader->rc_state_count = 0; in r300_translate_fragment_shader()
535 for (i = shader->externals_count; i < shader->code.constants.Count; i++) { in r300_translate_fragment_shader()
536 switch (shader->code.constants.Constants[i].Type) { in r300_translate_fragment_shader()
538 ++shader->immediates_count; in r300_translate_fragment_shader()
541 ++shader->rc_state_count; in r300_translate_fragment_shader()
549 if (shader->code.writes_depth) { in r300_translate_fragment_shader()
550 shader->fg_depth_src = R300_FG_DEPTH_SRC_SHADER; in r300_translate_fragment_shader()
551 shader->us_out_w = R300_W_FMT_W24 | R300_W_SRC_US; in r300_translate_fragment_shader()
553 shader->fg_depth_src = R300_FG_DEPTH_SRC_SCAN; in r300_translate_fragment_shader()
554 shader->us_out_w = R300_W_FMT_W0 | R300_W_SRC_US; in r300_translate_fragment_shader()
561 r300_emit_fs_code_to_buffer(r300, shader); in r300_translate_fragment_shader()
575 fs->first = fs->shader = CALLOC_STRUCT(r300_fragment_shader_code); in r300_pick_fragment_shader()
577 memcpy(&fs->shader->compare_state, &state, in r300_pick_fragment_shader()
579 r300_translate_fragment_shader(r300, fs->shader, fs->state.tokens); in r300_pick_fragment_shader()
585 if (memcmp(&fs->shader->compare_state, &state, sizeof(state)) != 0) { in r300_pick_fragment_shader()
590 if (fs->shader != ptr) { in r300_pick_fragment_shader()
591 fs->shader = ptr; in r300_pick_fragment_shader()
603 fs->first = fs->shader = ptr; in r300_pick_fragment_shader()