summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-05-30 16:26:55 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-05-30 16:26:55 -0600
commit02a47549ad182d28d330063d4f452108e3a4b452 (patch)
tree3e0926ac3024216e0fe21b201e33ae7bf782dc7d /src
parent092a9ecbba4d766da9c0becf888818c020ac226d (diff)
sketch out texture sampler state
Diffstat (limited to 'src')
-rw-r--r--src/mesa/softpipe/sp_defines.h19
-rw-r--r--src/mesa/softpipe/sp_state.h24
2 files changed, 43 insertions, 0 deletions
diff --git a/src/mesa/softpipe/sp_defines.h b/src/mesa/softpipe/sp_defines.h
index e1c773a407..c381865dab 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 634b9e9868..150fa9fcad 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