mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
gallium: Make texture target an enum for better debuggability.
Also make enum pipe_format used in a couple more places.
This commit is contained in:
parent
6f01290431
commit
1c5f27a18b
6 changed files with 17 additions and 14 deletions
|
|
@ -33,7 +33,7 @@
|
|||
#include "brw_state.h"
|
||||
#include "brw_defines.h"
|
||||
|
||||
static unsigned translate_tex_target( int target )
|
||||
static unsigned translate_tex_target( enum pipe_texture_target target )
|
||||
{
|
||||
switch (target) {
|
||||
case PIPE_TEXTURE_1D:
|
||||
|
|
@ -54,9 +54,9 @@ static unsigned translate_tex_target( int target )
|
|||
}
|
||||
}
|
||||
|
||||
static unsigned translate_tex_format( unsigned mesa_format )
|
||||
static unsigned translate_tex_format( enum pipe_format pipe_format )
|
||||
{
|
||||
switch( mesa_format ) {
|
||||
switch( pipe_format ) {
|
||||
case PIPE_FORMAT_U_L8:
|
||||
return BRW_SURFACEFORMAT_L8_UNORM;
|
||||
|
||||
|
|
|
|||
|
|
@ -115,10 +115,12 @@
|
|||
#define PIPE_STENCIL_OP_INVERT 7
|
||||
|
||||
/** Texture types */
|
||||
#define PIPE_TEXTURE_1D 0
|
||||
#define PIPE_TEXTURE_2D 1
|
||||
#define PIPE_TEXTURE_3D 2
|
||||
#define PIPE_TEXTURE_CUBE 3
|
||||
enum pipe_texture_target {
|
||||
PIPE_TEXTURE_1D = 0,
|
||||
PIPE_TEXTURE_2D = 1,
|
||||
PIPE_TEXTURE_3D = 2,
|
||||
PIPE_TEXTURE_CUBE = 3
|
||||
};
|
||||
|
||||
#define PIPE_TEX_FACE_POS_X 0
|
||||
#define PIPE_TEX_FACE_NEG_X 1
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
#define PIPE_STATE_H
|
||||
|
||||
#include "p_compiler.h"
|
||||
#include "p_defines.h"
|
||||
#include "p_format.h"
|
||||
|
||||
/**
|
||||
|
|
@ -262,8 +263,8 @@ struct pipe_texture
|
|||
{
|
||||
/* Effectively the key:
|
||||
*/
|
||||
unsigned target; /**< PIPE_TEXTURE_x */
|
||||
enum pipe_format format; /**< PIPE_FORMAT_x */
|
||||
enum pipe_texture_target target; /**< PIPE_TEXTURE_x */
|
||||
enum pipe_format format; /**< PIPE_FORMAT_x */
|
||||
|
||||
unsigned first_level;
|
||||
unsigned last_level;
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ st_get_texobj_texture(struct gl_texture_object *texObj)
|
|||
}
|
||||
|
||||
|
||||
static unsigned
|
||||
static enum pipe_texture_target
|
||||
gl_target_to_pipe(GLenum target)
|
||||
{
|
||||
switch (target) {
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@ target_to_target(GLenum target)
|
|||
|
||||
struct pipe_texture *
|
||||
st_texture_create(struct st_context *st,
|
||||
unsigned target,
|
||||
unsigned format,
|
||||
enum pipe_texture_target target,
|
||||
enum pipe_format format,
|
||||
GLuint first_level,
|
||||
GLuint last_level,
|
||||
GLuint width0,
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ struct pipe_texture;
|
|||
|
||||
extern struct pipe_texture *
|
||||
st_texture_create(struct st_context *st,
|
||||
unsigned target,
|
||||
unsigned format,
|
||||
enum pipe_texture_target target,
|
||||
enum pipe_format format,
|
||||
GLuint first_level,
|
||||
GLuint last_level,
|
||||
GLuint width0,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue