Lines Matching full:unit
104 } unit[MAX_TEXTURE_COORD_UNITS]; member
265 const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i]; in make_state_key()
273 key->unit[i].enabled = 1; in make_state_key()
276 key->unit[i].source_index = texObj->TargetIndex; in make_state_key()
281 key->unit[i].shadow = (format == GL_DEPTH_COMPONENT || in make_state_key()
285 key->unit[i].ModeRGB = comb->ModeRGB; in make_state_key()
286 key->unit[i].ModeA = comb->ModeA; in make_state_key()
287 key->unit[i].ScaleShiftRGB = comb->ScaleShiftRGB; in make_state_key()
288 key->unit[i].ScaleShiftA = comb->ScaleShiftA; in make_state_key()
289 key->unit[i].NumArgsRGB = comb->NumArgsRGB; in make_state_key()
290 key->unit[i].NumArgsA = comb->NumArgsA; in make_state_key()
292 memcpy(key->unit[i].ArgsRGB, comb->ArgsRGB, sizeof comb->ArgsRGB); in make_state_key()
293 memcpy(key->unit[i].ArgsA, comb->ArgsA, sizeof comb->ArgsA); in make_state_key()
319 keySize = sizeof(*key) - sizeof(key->unit) in make_state_key()
320 + key->nr_enabled_units * sizeof(key->unit[0]); in make_state_key()
337 /* ssa-def containing each texture unit's sampled texture color,
424 GLuint src, GLuint unit) in get_source() argument
428 return p->src_texture[unit]; in get_source()
442 unit, 0, 0, in get_source()
469 GLuint unit, in emit_combine_source() argument
475 src = get_source(p, source, unit); in emit_combine_source()
502 * texture unit's combinder state. When the RGB and A sources and
505 static GLboolean args_match( const struct state_key *key, GLuint unit ) in args_match() argument
507 GLuint i, numArgs = key->unit[unit].NumArgsRGB; in args_match()
510 if (key->unit[unit].ArgsA[i].Source != key->unit[unit].ArgsRGB[i].Source) in args_match()
513 switch (key->unit[unit].ArgsA[i].Operand) { in args_match()
515 switch (key->unit[unit].ArgsRGB[i].Operand) { in args_match()
524 switch (key->unit[unit].ArgsRGB[i].Operand) { in args_match()
551 GLuint unit, in emit_combine() argument
563 src[i] = emit_combine_source( p, unit, opt[i].Source, opt[i].Operand ); in emit_combine()
622 * Generate instructions for one texture unit's env/combiner mode.
625 emit_texenv(struct texenv_fragment_program *p, GLuint unit) in emit_texenv() argument
631 if (!key->unit[unit].enabled) { in emit_texenv()
635 switch (key->unit[unit].ModeRGB) { in emit_texenv()
637 alpha_shift = key->unit[unit].ScaleShiftA; in emit_texenv()
645 rgb_shift = key->unit[unit].ScaleShiftRGB; in emit_texenv()
646 alpha_shift = key->unit[unit].ScaleShiftA; in emit_texenv()
655 else if (need_saturate(key->unit[unit].ModeRGB)) in emit_texenv()
662 else if (need_saturate(key->unit[unit].ModeA)) in emit_texenv()
671 if (key->unit[unit].ModeRGB == key->unit[unit].ModeA && in emit_texenv()
672 args_match(key, unit)) { in emit_texenv()
673 val = emit_combine(p, unit, in emit_texenv()
674 key->unit[unit].NumArgsRGB, in emit_texenv()
675 key->unit[unit].ModeRGB, in emit_texenv()
676 key->unit[unit].ArgsRGB); in emit_texenv()
681 else if (key->unit[unit].ModeRGB == TEXENV_MODE_DOT3_RGBA_EXT || in emit_texenv()
682 key->unit[unit].ModeRGB == TEXENV_MODE_DOT3_RGBA) { in emit_texenv()
683 val = emit_combine(p, unit, in emit_texenv()
684 key->unit[unit].NumArgsRGB, in emit_texenv()
685 key->unit[unit].ModeRGB, in emit_texenv()
686 key->unit[unit].ArgsRGB); in emit_texenv()
695 val = emit_combine(p, unit, in emit_texenv()
696 key->unit[unit].NumArgsRGB, in emit_texenv()
697 key->unit[unit].ModeRGB, in emit_texenv()
698 key->unit[unit].ArgsRGB); in emit_texenv()
704 val = emit_combine(p, unit, in emit_texenv()
705 key->unit[unit].NumArgsA, in emit_texenv()
706 key->unit[unit].ModeA, in emit_texenv()
707 key->unit[unit].ArgsA); in emit_texenv()
746 load_texture(struct texenv_fragment_program *p, GLuint unit) in load_texture() argument
748 if (p->src_texture[unit]) in load_texture()
751 const GLuint texTarget = p->state->unit[unit].source_index; in load_texture()
754 if (!(p->state->inputs_available & (VARYING_BIT_TEX0 << unit))) { in load_texture()
755 texcoord = get_current_attrib(p, VERT_ATTRIB_TEX0 + unit); in load_texture()
757 texcoord = load_input(p, VARYING_SLOT_TEX0 + unit); in load_texture()
760 if (!p->state->unit[unit].enabled) { in load_texture()
761 p->src_texture[unit] = nir_imm_zero(p->b, 4, 32); in load_texture()
766 if (p->state->unit[unit].shadow) in load_texture()
772 tex->texture_index = unit; in load_texture()
773 tex->sampler_index = unit; in load_texture()
784 nir_variable *var = p->sampler_vars[unit]; in load_texture()
788 p->state->unit[unit].shadow, in load_texture()
794 "sampler_%d", unit)); in load_texture()
795 var->data.binding = unit; in load_texture()
798 p->sampler_vars[unit] = var; in load_texture()
815 if (p->state->unit[unit].shadow) { in load_texture()
823 p->src_texture[unit] = &tex->def; in load_texture()
826 BITSET_SET(p->b->shader->info.textures_used, unit); in load_texture()
827 BITSET_SET(p->b->shader->info.samplers_used, unit); in load_texture()
832 GLuint src, GLuint unit) in load_texenv_source() argument
836 load_texture(p, unit); in load_texenv_source()
861 load_texunit_sources(struct texenv_fragment_program *p, GLuint unit) in load_texunit_sources() argument
866 for (i = 0; i < key->unit[unit].NumArgsRGB; i++) { in load_texunit_sources()
867 load_texenv_source( p, key->unit[unit].ArgsRGB[i].Source, unit ); in load_texunit_sources()
870 for (i = 0; i < key->unit[unit].NumArgsA; i++) { in load_texunit_sources()
871 load_texenv_source( p, key->unit[unit].ArgsA[i].Source, unit ); in load_texunit_sources()
881 GLuint unit; in emit_instructions() local
888 for (unit = 0; unit < key->nr_enabled_units; unit++) in emit_instructions()
889 if (key->unit[unit].enabled) { in emit_instructions()
890 load_texunit_sources(p, unit); in emit_instructions()
895 for (unit = 0; unit < key->nr_enabled_units; unit++) { in emit_instructions()
896 if (key->unit[unit].enabled) { in emit_instructions()
897 p->src_previous = emit_texenv(p, unit); in emit_instructions()