Lines Matching full:unit

111    } unit[MAX_TEXTURE_COORD_UNITS];  member
269 const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i]; in make_state_key()
276 key->unit[i].enabled = 1; in make_state_key()
279 key->unit[i].source_index = texObj->TargetIndex; in make_state_key()
284 key->unit[i].shadow = (format == GL_DEPTH_COMPONENT || in make_state_key()
288 key->unit[i].ModeRGB = comb->ModeRGB; in make_state_key()
289 key->unit[i].ModeA = comb->ModeA; in make_state_key()
290 key->unit[i].ScaleShiftRGB = comb->ScaleShiftRGB; in make_state_key()
291 key->unit[i].ScaleShiftA = comb->ScaleShiftA; in make_state_key()
292 key->unit[i].NumArgsRGB = comb->NumArgsRGB; in make_state_key()
293 key->unit[i].NumArgsA = comb->NumArgsA; in make_state_key()
295 memcpy(key->unit[i].ArgsRGB, comb->ArgsRGB, sizeof comb->ArgsRGB); in make_state_key()
296 memcpy(key->unit[i].ArgsA, comb->ArgsA, sizeof comb->ArgsA); in make_state_key()
322 keySize = sizeof(*key) - sizeof(key->unit) in make_state_key()
323 + key->nr_enabled_units * sizeof(key->unit[0]); in make_state_key()
339 /* Reg containing each texture unit's sampled texture color,
346 /* Reg containing texcoord for a texture unit,
383 GLuint src, GLuint unit) in get_source() argument
390 return new(p->mem_ctx) ir_dereference_variable(p->src_texture[unit]); in get_source()
407 var->data.max_array_access = MAX2(var->data.max_array_access, (int)unit); in get_source()
409 new(p->mem_ctx) ir_constant(unit)); in get_source()
437 GLuint unit, in emit_combine_source() argument
443 src = get_source(p, source, unit); in emit_combine_source()
469 * texture unit's combinder state. When the RGB and A sources and
472 static GLboolean args_match( const struct state_key *key, GLuint unit ) in args_match() argument
474 GLuint i, numArgs = key->unit[unit].NumArgsRGB; in args_match()
477 if (key->unit[unit].ArgsA[i].Source != key->unit[unit].ArgsRGB[i].Source) in args_match()
480 switch (key->unit[unit].ArgsA[i].Operand) { in args_match()
482 switch (key->unit[unit].ArgsRGB[i].Operand) { in args_match()
491 switch (key->unit[unit].ArgsRGB[i].Operand) { in args_match()
518 GLuint unit, in emit_combine() argument
530 src[i] = emit_combine_source( p, unit, opt[i].Source, opt[i].Operand ); in emit_combine()
590 * Generate instructions for one texture unit's env/combiner mode.
593 emit_texenv(texenv_fragment_program *p, GLuint unit) in emit_texenv() argument
599 if (!key->unit[unit].enabled) { in emit_texenv()
603 switch (key->unit[unit].ModeRGB) { in emit_texenv()
605 alpha_shift = key->unit[unit].ScaleShiftA; in emit_texenv()
613 rgb_shift = key->unit[unit].ScaleShiftRGB; in emit_texenv()
614 alpha_shift = key->unit[unit].ScaleShiftA; in emit_texenv()
623 else if (need_saturate(key->unit[unit].ModeRGB)) in emit_texenv()
630 else if (need_saturate(key->unit[unit].ModeA)) in emit_texenv()
641 if (key->unit[unit].ModeRGB == key->unit[unit].ModeA && in emit_texenv()
642 args_match(key, unit)) { in emit_texenv()
643 val = emit_combine(p, unit, in emit_texenv()
644 key->unit[unit].NumArgsRGB, in emit_texenv()
645 key->unit[unit].ModeRGB, in emit_texenv()
646 key->unit[unit].ArgsRGB); in emit_texenv()
653 else if (key->unit[unit].ModeRGB == TEXENV_MODE_DOT3_RGBA_EXT || in emit_texenv()
654 key->unit[unit].ModeRGB == TEXENV_MODE_DOT3_RGBA) { in emit_texenv()
655 ir_rvalue *val = emit_combine(p, unit, in emit_texenv()
656 key->unit[unit].NumArgsRGB, in emit_texenv()
657 key->unit[unit].ModeRGB, in emit_texenv()
658 key->unit[unit].ArgsRGB); in emit_texenv()
668 val = emit_combine(p, unit, in emit_texenv()
669 key->unit[unit].NumArgsRGB, in emit_texenv()
670 key->unit[unit].ModeRGB, in emit_texenv()
671 key->unit[unit].ArgsRGB); in emit_texenv()
677 val = emit_combine(p, unit, in emit_texenv()
678 key->unit[unit].NumArgsA, in emit_texenv()
679 key->unit[unit].ModeA, in emit_texenv()
680 key->unit[unit].ArgsA); in emit_texenv()
719 static void load_texture( texenv_fragment_program *p, GLuint unit ) in load_texture() argument
723 if (p->src_texture[unit]) in load_texture()
726 const GLuint texTarget = p->state->unit[unit].source_index; in load_texture()
729 if (!(p->state->inputs_available & (VARYING_BIT_TEX0 << unit))) { in load_texture()
730 texcoord = get_current_attrib(p, VERT_ATTRIB_TEX0 + unit); in load_texture()
731 } else if (p->texcoord_tex[unit]) { in load_texture()
732 texcoord = new(p->mem_ctx) ir_dereference_variable(p->texcoord_tex[unit]); in load_texture()
737 ir_rvalue *index = new(p->mem_ctx) ir_constant(unit); in load_texture()
739 tc_array->data.max_array_access = MAX2(tc_array->data.max_array_access, (int)unit); in load_texture()
742 if (!p->state->unit[unit].enabled) { in load_texture()
743 p->src_texture[unit] = p->make_temp(glsl_type::vec4_type, in load_texture()
745 p->emit(p->src_texture[unit]); in load_texture()
747 p->emit(assign(p->src_texture[unit], new(p->mem_ctx) ir_constant(0.0f))); in load_texture()
756 if (p->state->unit[unit].shadow) in load_texture()
763 if (p->state->unit[unit].shadow) in load_texture()
770 if (p->state->unit[unit].shadow) in load_texture()
777 if (p->state->unit[unit].shadow) in load_texture()
784 if (p->state->unit[unit].shadow) in load_texture()
791 assert(!p->state->unit[unit].shadow); in load_texture()
796 if (p->state->unit[unit].shadow) in load_texture()
803 assert(!p->state->unit[unit].shadow); in load_texture()
809 p->src_texture[unit] = p->make_temp(glsl_type::vec4_type, in load_texture()
815 char *sampler_name = ralloc_asprintf(p->mem_ctx, "sampler_%d", unit); in load_texture()
821 /* Set the texture unit for this sampler in the same way that in load_texture()
825 sampler->data.binding = unit; in load_texture()
832 if (p->state->unit[unit].shadow) { in load_texture()
843 p->emit(assign(p->src_texture[unit], tex)); in load_texture()
848 GLuint src, GLuint unit) in load_texenv_source() argument
852 load_texture(p, unit); in load_texenv_source()
877 load_texunit_sources( texenv_fragment_program *p, GLuint unit ) in load_texunit_sources() argument
882 for (i = 0; i < key->unit[unit].NumArgsRGB; i++) { in load_texunit_sources()
883 load_texenv_source( p, key->unit[unit].ArgsRGB[i].Source, unit ); in load_texunit_sources()
886 for (i = 0; i < key->unit[unit].NumArgsA; i++) { in load_texunit_sources()
887 load_texenv_source( p, key->unit[unit].ArgsA[i].Source, unit ); in load_texunit_sources()
980 GLuint unit; in emit_instructions() local
987 for (unit = 0; unit < key->nr_enabled_units; unit++) in emit_instructions()
988 if (key->unit[unit].enabled) { in emit_instructions()
989 load_texunit_sources(p, unit); in emit_instructions()
994 for (unit = 0; unit < key->nr_enabled_units; unit++) { in emit_instructions()
995 if (key->unit[unit].enabled) { in emit_instructions()
996 p->src_previous = emit_texenv(p, unit); in emit_instructions()
1041 unsigned int unit; in create_new_program() local
1085 for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) { in create_new_program()
1086 p.src_texture[unit] = NULL; in create_new_program()
1087 p.texcoord_tex[unit] = NULL; in create_new_program()