From 2d1aeb43827cb1941f09f4184eaf544147466f3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 19 Dec 2006 23:14:07 +0100 Subject: [PATCH] wined3d: Add empty sampler entries to the state table. --- dlls/wined3d/state.c | 17 +++++++++++++++++ dlls/wined3d/wined3d_private.h | 6 +++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index a7772f5dae2..8aeafb8ebe9 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -2127,4 +2127,21 @@ const struct StateEntry StateTable[] = { /*7, 30, undefined */ 0 /* -> sampler state in ddraw / d3d8 */, state_undefined }, { /*7, 31, undefined */ 0 /* -> sampler state in ddraw / d3d8 */, state_undefined }, { /*7, 32, WINED3DTSS_CONSTANT */ 0 /* As long as we don't support D3DTA_CONSTANT */, state_nogl }, + /* Sampler states */ + { /* 0, Sampler 0 */ STATE_SAMPLER(0), state_undefined }, + { /* 1, Sampler 1 */ STATE_SAMPLER(1), state_undefined }, + { /* 2, Sampler 2 */ STATE_SAMPLER(2), state_undefined }, + { /* 3, Sampler 3 */ STATE_SAMPLER(3), state_undefined }, + { /* 4, Sampler 3 */ STATE_SAMPLER(4), state_undefined }, + { /* 5, Sampler 5 */ STATE_SAMPLER(5), state_undefined }, + { /* 6, Sampler 6 */ STATE_SAMPLER(6), state_undefined }, + { /* 7, Sampler 7 */ STATE_SAMPLER(7), state_undefined }, + { /* 8, Sampler 8 */ STATE_SAMPLER(8), state_undefined }, + { /* 9, Sampler 9 */ STATE_SAMPLER(9), state_undefined }, + { /*10, Sampler 10 */ STATE_SAMPLER(10), state_undefined }, + { /*11, Sampler 11 */ STATE_SAMPLER(11), state_undefined }, + { /*12, Sampler 12 */ STATE_SAMPLER(12), state_undefined }, + { /*13, Sampler 13 */ STATE_SAMPLER(13), state_undefined }, + { /*14, Sampler 14 */ STATE_SAMPLER(14), state_undefined }, + { /*15, Sampler 15 */ STATE_SAMPLER(15), state_undefined }, }; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 6c75706be58..95bdbde8fee 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -416,7 +416,11 @@ typedef void (*APPLYSTATEFUNC)(DWORD state, IWineD3DStateBlockImpl *stateblock); #define STATE_TEXTURESTAGE(stage, num) (STATE_RENDER(WINEHIGHEST_RENDER_STATE) + (stage) * WINED3D_HIGHEST_TEXTURE_STATE + (num)) #define STATE_IS_TEXTURESTAGE(a) ((a) >= STATE_TEXTURESTAGE(0, 1) && (a) <= STATE_TEXTURESTAGE(MAX_TEXTURES - 1, WINED3D_HIGHEST_TEXTURE_STATE)) -#define STATE_HIGHEST (STATE_TEXTURESTAGE(MAX_TEXTURES - 1, WINED3D_HIGHEST_TEXTURE_STATE)) +/* + 1 because samplers start with 0 */ +#define STATE_SAMPLER(num) (STATE_TEXTURESTAGE(MAX_TEXTURES - 1, WINED3D_HIGHEST_TEXTURE_STATE) + 1 + (num)) +#define STATE_IS_SAMPLER(num) ((num) >= STATE_SAMPLER(0) && (num) <= STATE_SAMPLER(MAX_SAMPLERS - 1)) + +#define STATE_HIGHEST (STATE_SAMPLER(MAX_SAMPLERS - 1)) struct StateEntry {