mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 02:10:11 +01:00
mesa: add _mesa_cube_face_target() helper
Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
This commit is contained in:
parent
d73f5a3133
commit
82db969ac0
1 changed files with 17 additions and 0 deletions
|
|
@ -48,6 +48,23 @@ _mesa_is_cube_face(GLenum target)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* If the target is GL_TEXTURE_CUBE_MAP, return one of the
|
||||
* GL_TEXTURE_CUBE_MAP_POSITIVE/NEGATIVE_X/Y/Z targets corresponding to
|
||||
* the face parameter.
|
||||
* Else, return target as-is.
|
||||
*/
|
||||
static inline GLenum
|
||||
_mesa_cube_face_target(GLenum target, unsigned face)
|
||||
{
|
||||
assert(face < 6);
|
||||
if (target == GL_TEXTURE_CUBE_MAP)
|
||||
return GL_TEXTURE_CUBE_MAP_POSITIVE_X + face;
|
||||
else
|
||||
return target;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* For cube map faces, return a face index in [0,5].
|
||||
* For other targets return 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue