Lines Matching defs:unit
151 * on the current texture unit.
1374 struct gl_texture_unit *unit = &ctx->Texture.Unit[u];
1376 if (texObj == unit->CurrentTex[index]) {
1377 /* Bind the default texture for this unit/target */
1378 _mesa_reference_texobj(&unit->CurrentTex[index],
1380 unit->_BoundTextures &= ~(1 << index);
1387 * Check if the given texture object is bound to any shader image unit
1397 struct gl_image_unit *unit = &ctx->ImageUnits[i];
1399 if (texObj == unit->TexObj) {
1400 _mesa_reference_texobj(&unit->TexObj, NULL);
1401 *unit = _mesa_default_image_unit(ctx);
1408 * Unbinds all textures bound to the given texture image unit.
1411 unbind_textures_from_unit(struct gl_context *ctx, GLuint unit)
1413 struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
1437 * texture unit, unbind the texture first. Decrement the reference
1470 * image unit. If so, unbind it.
1584 * \param unit index of texture unit to update
1588 bind_texture_object(struct gl_context *ctx, unsigned unit,
1594 assert(unit < ARRAY_SIZE(ctx->Texture.Unit));
1595 texUnit = &ctx->Texture.Unit[unit];
1636 unit + 1);
1726 * texture object, then bind it in the current texture unit.
1730 * \param texunit texture unit.
1773 unsigned unit = texunit - GL_TEXTURE0;
1775 if (texunit < GL_TEXTURE0 || unit >= _mesa_max_tex_unit(ctx)) {
1785 bind_texture(ctx, target, texture, unit, false, "glBindMultiTextureEXT");
1792 * \param unit texture unit.
1798 * texture unit to its default texture.
1803 bind_texture_unit(struct gl_context *ctx, GLuint unit, GLuint texture,
1812 * corresponding texture image unit."
1815 unbind_textures_from_unit(ctx, unit);
1838 bind_texture_object(ctx, unit, texObj);
1843 _mesa_BindTextureUnit_no_error(GLuint unit, GLuint texture)
1846 bind_texture_unit(ctx, unit, texture, true);
1851 _mesa_BindTextureUnit(GLuint unit, GLuint texture)
1855 if (unit >= _mesa_max_tex_unit(ctx)) {
1856 _mesa_error(ctx, GL_INVALID_VALUE, "glBindTextureUnit(unit=%u)", unit);
1862 _mesa_enum_to_string(GL_TEXTURE0+unit), (GLint) texture);
1864 bind_texture_unit(ctx, unit, texture, false);