diff options
author | Eric Anholt <[email protected]> | 2005-10-24 06:40:56 +0000 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2005-10-24 06:40:56 +0000 |
commit | dc793d4e9a71159da13b9230abde344309924287 (patch) | |
tree | d2e68f18eb5f57e9dd82388ad651bb4c05e5b1f6 /src/mesa/drivers | |
parent | 3265585b151d44c825fb7a82b16b076fb7fdca77 (diff) |
Add support for GL_EXT_stencil_wrap by guessing that the skip of two values in
the register header was meaningful. It turns out those were the proper values
for the plain INCR/DECR ops, while what we were using as INCR/DECR were the
_WRAP versions. Tested with stencil_wrap (didn't expose normal/_WRAP swapping)
and stencilwrap (exposed it nicely) tests. Props to idr for poking me about
adding this.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/sis/sis_context.c | 1 | ||||
-rw-r--r-- | src/mesa/drivers/dri/sis/sis_dd.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/sis/sis_reg.h | 18 | ||||
-rw-r--r-- | src/mesa/drivers/dri/sis/sis_stencil.c | 18 |
4 files changed, 32 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/sis/sis_context.c b/src/mesa/drivers/dri/sis/sis_context.c index 948f15a9414..22ced964af6 100644 --- a/src/mesa/drivers/dri/sis/sis_context.c +++ b/src/mesa/drivers/dri/sis/sis_context.c @@ -74,6 +74,7 @@ struct dri_extension card_extensions[] = { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_multitexture", NULL }, { "GL_EXT_texture_lod_bias", NULL }, + { "GL_EXT_stencil_wrap", NULL }, { "GL_NV_blend_square", NULL }, { NULL, NULL } }; diff --git a/src/mesa/drivers/dri/sis/sis_dd.c b/src/mesa/drivers/dri/sis/sis_dd.c index cd992709914..7dc3018157a 100644 --- a/src/mesa/drivers/dri/sis/sis_dd.c +++ b/src/mesa/drivers/dri/sis/sis_dd.c @@ -47,7 +47,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "utils.h" -#define DRIVER_DATE "20051019" +#define DRIVER_DATE "20051023" /* Return the width and height of the given buffer. */ diff --git a/src/mesa/drivers/dri/sis/sis_reg.h b/src/mesa/drivers/dri/sis/sis_reg.h index 76014ff3eda..1c245898a46 100644 --- a/src/mesa/drivers/dri/sis/sis_reg.h +++ b/src/mesa/drivers/dri/sis/sis_reg.h @@ -589,23 +589,29 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #define SiS_SFAIL_KEEP 0x00000000 #define SiS_SFAIL_ZERO 0x00100000 #define SiS_SFAIL_REPLACE 0x00200000 +#define SiS_SFAIL_INCR 0x00300000 /* guess -- was _WRAP */ +#define SiS_SFAIL_DECR 0x00400000 /* guess -- was _WRAP */ #define SiS_SFAIL_INVERT 0x00500000 -#define SiS_SFAIL_INCR 0x00600000 -#define SiS_SFAIL_DECR 0x00700000 +#define SiS_SFAIL_INCR_WRAP 0x00600000 /* guess */ +#define SiS_SFAIL_DECR_WRAP 0x00700000 /* guess */ #define SiS_SPASS_ZFAIL_KEEP 0x00000000 #define SiS_SPASS_ZFAIL_ZERO 0x00010000 #define SiS_SPASS_ZFAIL_REPLACE 0x00020000 +#define SiS_SPASS_ZFAIL_INCR 0x00030000 /* guess -- was _WRAP */ +#define SiS_SPASS_ZFAIL_DECR 0x00040000 /* guess -- was _WRAP */ #define SiS_SPASS_ZFAIL_INVERT 0x00050000 -#define SiS_SPASS_ZFAIL_INCR 0x00060000 -#define SiS_SPASS_ZFAIL_DECR 0x00070000 +#define SiS_SPASS_ZFAIL_INCR_WRAP 0x00060000 /* guess */ +#define SiS_SPASS_ZFAIL_DECR_WRAP 0x00070000 /* guess */ #define SiS_SPASS_ZPASS_KEEP 0x00000000 #define SiS_SPASS_ZPASS_ZERO 0x00001000 #define SiS_SPASS_ZPASS_REPLACE 0x00002000 +#define SiS_SPASS_ZPASS_INCR 0x00003000 /* guess -- was _WRAP */ +#define SiS_SPASS_ZPASS_DECR 0x00004000 /* guess -- was _WRAP */ #define SiS_SPASS_ZPASS_INVERT 0x00005000 -#define SiS_SPASS_ZPASS_INCR 0x00006000 -#define SiS_SPASS_ZPASS_DECR 0x00007000 +#define SiS_SPASS_ZPASS_INCR_WRAP 0x00006000 /* guess */ +#define SiS_SPASS_ZPASS_DECR_WRAP 0x00007000 /* guess */ /* * REG_3D_DstBlendMode (0x8A50 - 0x8A53) diff --git a/src/mesa/drivers/dri/sis/sis_stencil.c b/src/mesa/drivers/dri/sis/sis_stencil.c index d36f5f59097..1febe86b94c 100644 --- a/src/mesa/drivers/dri/sis/sis_stencil.c +++ b/src/mesa/drivers/dri/sis/sis_stencil.c @@ -125,6 +125,12 @@ sisDDStencilOpSeparate( GLcontext * ctx, GLenum face, GLenum fail, case GL_DECR: current->hwStSetting2 |= SiS_SFAIL_DECR; break; + case GL_INCR_WRAP: + current->hwStSetting2 |= SiS_SFAIL_INCR_WRAP; + break; + case GL_DECR_WRAP: + current->hwStSetting2 |= SiS_SFAIL_DECR_WRAP; + break; } switch (zfail) @@ -147,6 +153,12 @@ sisDDStencilOpSeparate( GLcontext * ctx, GLenum face, GLenum fail, case GL_DECR: current->hwStSetting2 |= SiS_SPASS_ZFAIL_DECR; break; + case GL_INCR_WRAP: + current->hwStSetting2 |= SiS_SPASS_ZFAIL_INCR_WRAP; + break; + case GL_DECR_WRAP: + current->hwStSetting2 |= SiS_SPASS_ZFAIL_DECR_WRAP; + break; } switch (zpass) @@ -169,6 +181,12 @@ sisDDStencilOpSeparate( GLcontext * ctx, GLenum face, GLenum fail, case GL_DECR: current->hwStSetting2 |= SiS_SPASS_ZPASS_DECR; break; + case GL_INCR_WRAP: + current->hwStSetting2 |= SiS_SPASS_ZPASS_INCR_WRAP; + break; + case GL_DECR_WRAP: + current->hwStSetting2 |= SiS_SPASS_ZPASS_DECR_WRAP; + break; } if (current->hwStSetting2 != prev->hwStSetting2) |