mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
mesa: minor simplification in enable_texture(), updated comments
This commit is contained in:
parent
b3fc832ac7
commit
c0d3761c16
1 changed files with 5 additions and 3 deletions
|
|
@ -222,14 +222,16 @@ get_texcoord_unit(GLcontext *ctx)
|
|||
|
||||
/**
|
||||
* Helper function to enable or disable a texture target.
|
||||
* \param bit one of the TEXTURE_x_BIT values
|
||||
* \return GL_TRUE if state is changing or GL_FALSE if no change
|
||||
*/
|
||||
static GLboolean
|
||||
enable_texture(GLcontext *ctx, GLboolean state, GLbitfield bit)
|
||||
enable_texture(GLcontext *ctx, GLboolean state, GLbitfield texBit)
|
||||
{
|
||||
const GLuint curr = ctx->Texture.CurrentUnit;
|
||||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr];
|
||||
const GLuint newenabled = (!state)
|
||||
? (texUnit->Enabled & ~bit) : (texUnit->Enabled | bit);
|
||||
const GLbitfield newenabled = state
|
||||
? (texUnit->Enabled | texBit) : (texUnit->Enabled & ~texBit);
|
||||
|
||||
if (!ctx->DrawBuffer->Visual.rgbMode || texUnit->Enabled == newenabled)
|
||||
return GL_FALSE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue