• Home
  • Raw
  • Download

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,
422 GLuint src, GLuint unit) in get_source() argument
426 return p->src_texture[unit]; in get_source()
440 unit, 0, 0, in get_source()
467 GLuint unit, in emit_combine_source() argument
473 src = get_source(p, source, unit); in emit_combine_source()
500 * texture unit's combinder state. When the RGB and A sources and
503 static GLboolean args_match( const struct state_key *key, GLuint unit ) in args_match() argument
505 GLuint i, numArgs = key->unit[unit].NumArgsRGB; in args_match()
508 if (key->unit[unit].ArgsA[i].Source != key->unit[unit].ArgsRGB[i].Source) in args_match()
511 switch (key->unit[unit].ArgsA[i].Operand) { in args_match()
513 switch (key->unit[unit].ArgsRGB[i].Operand) { in args_match()
522 switch (key->unit[unit].ArgsRGB[i].Operand) { in args_match()
549 GLuint unit, in emit_combine() argument
561 src[i] = emit_combine_source( p, unit, opt[i].Source, opt[i].Operand ); in emit_combine()
620 * Generate instructions for one texture unit's env/combiner mode.
623 emit_texenv(struct texenv_fragment_program *p, GLuint unit) in emit_texenv() argument
629 if (!key->unit[unit].enabled) { in emit_texenv()
633 switch (key->unit[unit].ModeRGB) { in emit_texenv()
635 alpha_shift = key->unit[unit].ScaleShiftA; in emit_texenv()
643 rgb_shift = key->unit[unit].ScaleShiftRGB; in emit_texenv()
644 alpha_shift = key->unit[unit].ScaleShiftA; in emit_texenv()
653 else if (need_saturate(key->unit[unit].ModeRGB)) in emit_texenv()
660 else if (need_saturate(key->unit[unit].ModeA)) in emit_texenv()
669 if (key->unit[unit].ModeRGB == key->unit[unit].ModeA && in emit_texenv()
670 args_match(key, unit)) { in emit_texenv()
671 val = emit_combine(p, unit, in emit_texenv()
672 key->unit[unit].NumArgsRGB, in emit_texenv()
673 key->unit[unit].ModeRGB, in emit_texenv()
674 key->unit[unit].ArgsRGB); in emit_texenv()
679 else if (key->unit[unit].ModeRGB == TEXENV_MODE_DOT3_RGBA_EXT || in emit_texenv()
680 key->unit[unit].ModeRGB == TEXENV_MODE_DOT3_RGBA) { in emit_texenv()
681 val = emit_combine(p, unit, in emit_texenv()
682 key->unit[unit].NumArgsRGB, in emit_texenv()
683 key->unit[unit].ModeRGB, in emit_texenv()
684 key->unit[unit].ArgsRGB); in emit_texenv()
693 val = emit_combine(p, unit, in emit_texenv()
694 key->unit[unit].NumArgsRGB, in emit_texenv()
695 key->unit[unit].ModeRGB, in emit_texenv()
696 key->unit[unit].ArgsRGB); in emit_texenv()
702 val = emit_combine(p, unit, in emit_texenv()
703 key->unit[unit].NumArgsA, in emit_texenv()
704 key->unit[unit].ModeA, in emit_texenv()
705 key->unit[unit].ArgsA); in emit_texenv()
744 load_texture(struct texenv_fragment_program *p, GLuint unit) in load_texture() argument
746 if (p->src_texture[unit]) in load_texture()
749 const GLuint texTarget = p->state->unit[unit].source_index; in load_texture()
752 if (!(p->state->inputs_available & (VARYING_BIT_TEX0 << unit))) { in load_texture()
753 texcoord = get_current_attrib(p, VERT_ATTRIB_TEX0 + unit); in load_texture()
756 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()