From 02a47549ad182d28d330063d4f452108e3a4b452 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 30 May 2007 16:26:55 -0600 Subject: [PATCH] sketch out texture sampler state --- src/mesa/softpipe/sp_defines.h | 19 +++++++++++++++++++ src/mesa/softpipe/sp_state.h | 24 ++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/src/mesa/softpipe/sp_defines.h b/src/mesa/softpipe/sp_defines.h index e1c773a4077..c381865dab5 100644 --- a/src/mesa/softpipe/sp_defines.h +++ b/src/mesa/softpipe/sp_defines.h @@ -89,6 +89,7 @@ #define SP_STENCIL_OP_DECR_WRAP 6 #define SP_STENCIL_OP_INVERT 7 +/* Note: same as stencil funcs. Also used for shadow/depth compare */ #define SP_DEPTH_FUNC_NEVER 0 #define SP_DEPTH_FUNC_LESS 1 #define SP_DEPTH_FUNC_EQUAL 2 @@ -98,5 +99,23 @@ #define SP_DEPTH_FUNC_GEQUAL 6 #define SP_DEPTH_FUNC_ALWAYS 7 +#define SP_TEX_WRAP_REPEAT 0 +#define SP_TEX_WRAP_CLAMP 1 +#define SP_TEX_WRAP_CLAMP_TO_EDGE 2 +#define SP_TEX_WRAP_CLAMP_TO_BORDER 3 +#define SP_TEX_WRAP_MIRROR_REPEAT 4 +#define SP_TEX_WRAP_MIRROR_CLAMP 5 +#define SP_TEX_WRAP_MIRROR_CLAMP_TO_EDGE 6 +#define SP_TEX_WRAP_MIRROR_CLAMP_TO_BORDER 7 + +#define SP_TEX_FILTER_NEAREST 0 +#define SP_TEX_FILTER_LINEAR 1 +#define SP_TEX_FILTER_NEAREST_MIPMAP_NEAREST 2 +#define SP_TEX_FILTER_NEAREST_MIPMAP_LINEAR 3 +#define SP_TEX_FILTER_LINEAR_MIPMAP_NEAREST 4 +#define SP_TEX_FILTER_LINEAR_MIPMAP_LINEAR 5 + +#define SP_TEX_COMPARE_NONE 0 +#define SP_TEX_COMPARE_R_TO_TEXTURE 1 #endif diff --git a/src/mesa/softpipe/sp_state.h b/src/mesa/softpipe/sp_state.h index 634b9e98681..150fa9fcadb 100644 --- a/src/mesa/softpipe/sp_state.h +++ b/src/mesa/softpipe/sp_state.h @@ -157,4 +157,28 @@ struct softpipe_surface { }; +/** + * Texture sampler state. + */ +struct softpipe_sampler_state +{ + GLuint wrap_s:3; /**< SP_TEX_WRAP_x */ + GLuint wrap_t:3; /**< SP_TEX_WRAP_x */ + GLuint wrap_r:3; /**< SP_TEX_WRAP_x */ + GLuint min_filter:3; /**< SP_TEX_FILTER_x */ + GLuint mag_filter:1; /**< SP_TEX_FILTER_LINEAR or _NEAREST */ + GLfloat min_lod; + GLfloat max_lod; + GLfloat lod_bias; +#if 0 /* need these? */ + GLint BaseLevel; /**< min mipmap level, OpenGL 1.2 */ + GLint MaxLevel; /**< max mipmap level, OpenGL 1.2 */ +#endif + GLfloat max_anisotropy; + GLuint compare:1; /**< shadow/depth compare enabled? */ + GLenum compare_mode:1; /**< SP_TEX_COMPARE_x */ + GLenum compare_func:3; /**< SP_DEPTH_FUNC_x */ + GLfloat shadow_ambient; /**< shadow test fail color/intensity */ +}; + #endif -- 2.30.2