[PATCH 4/5] wined3d: Get rid of the WINED3DSAMPLER_TEXTURE_TYPE typedef.

Henri Verbeet hverbeet at codeweavers.com
Tue Nov 8 13:48:58 CST 2011


---
 dlls/wined3d/device.c          |   10 +++++-----
 dlls/wined3d/glsl_shader.c     |    4 ++--
 dlls/wined3d/shader.c          |    2 +-
 dlls/wined3d/wined3d_private.h |    8 ++++----
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index b271f5b..db57c72 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -2898,7 +2898,7 @@ static void device_map_fixed_function_samplers(struct wined3d_device *device, co
 
 static void device_map_psamplers(struct wined3d_device *device, const struct wined3d_gl_info *gl_info)
 {
-    const WINED3DSAMPLER_TEXTURE_TYPE *sampler_type =
+    const enum wined3d_sampler_texture_type *sampler_type =
             device->stateBlock->state.pixel_shader->reg_maps.sampler_type;
     unsigned int i;
 
@@ -2915,8 +2915,8 @@ static void device_map_psamplers(struct wined3d_device *device, const struct win
 }
 
 static BOOL device_unit_free_for_vs(const struct wined3d_device *device,
-        const WINED3DSAMPLER_TEXTURE_TYPE *pshader_sampler_tokens,
-        const WINED3DSAMPLER_TEXTURE_TYPE *vshader_sampler_tokens, DWORD unit)
+        const enum wined3d_sampler_texture_type *pshader_sampler_tokens,
+        const enum wined3d_sampler_texture_type *vshader_sampler_tokens, DWORD unit)
 {
     DWORD current_mapping = device->rev_tex_unit_map[unit];
 
@@ -2941,9 +2941,9 @@ static BOOL device_unit_free_for_vs(const struct wined3d_device *device,
 
 static void device_map_vsamplers(struct wined3d_device *device, BOOL ps, const struct wined3d_gl_info *gl_info)
 {
-    const WINED3DSAMPLER_TEXTURE_TYPE *vshader_sampler_type =
+    const enum wined3d_sampler_texture_type *vshader_sampler_type =
             device->stateBlock->state.vertex_shader->reg_maps.sampler_type;
-    const WINED3DSAMPLER_TEXTURE_TYPE *pshader_sampler_type = NULL;
+    const enum wined3d_sampler_texture_type *pshader_sampler_type = NULL;
     int start = min(MAX_COMBINED_SAMPLERS, gl_info->limits.combined_samplers) - 1;
     int i;
 
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 32ac385..6ccb94a 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -1652,7 +1652,7 @@ static inline const char *shader_get_comp_op(DWORD op)
 static void shader_glsl_get_sample_function(const struct wined3d_shader_context *ctx,
         DWORD sampler_idx, DWORD flags, struct glsl_sample_function *sample_function)
 {
-    WINED3DSAMPLER_TEXTURE_TYPE sampler_type = ctx->reg_maps->sampler_type[sampler_idx];
+    enum wined3d_sampler_texture_type sampler_type = ctx->reg_maps->sampler_type[sampler_idx];
     const struct wined3d_gl_info *gl_info = ctx->gl_info;
     BOOL shadow = shader_is_pshader_version(ctx->reg_maps->shader_version.type)
             && (((const struct shader_glsl_ctx_priv *)ctx->backend_data)->cur_ps_args->shadow & (1 << sampler_idx));
@@ -3036,7 +3036,7 @@ static void shader_glsl_tex(const struct wined3d_shader_instruction *ins)
         const struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data;
         DWORD flags = (priv->cur_ps_args->tex_transform >> sampler_idx * WINED3D_PSARGS_TEXTRANSFORM_SHIFT)
                 & WINED3D_PSARGS_TEXTRANSFORM_MASK;
-        WINED3DSAMPLER_TEXTURE_TYPE sampler_type = ins->ctx->reg_maps->sampler_type[sampler_idx];
+        enum wined3d_sampler_texture_type sampler_type = ins->ctx->reg_maps->sampler_type[sampler_idx];
 
         /* Projected cube textures don't make a lot of sense, the resulting coordinates stay the same. */
         if (flags & WINED3D_PSARGS_PROJECTED && sampler_type != WINED3DSTT_CUBE) {
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index 334a2fd..b708e48 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -2157,7 +2157,7 @@ static HRESULT pixelshader_init(struct wined3d_shader *shader, struct wined3d_de
 
 void pixelshader_update_samplers(struct wined3d_shader_reg_maps *reg_maps, struct wined3d_texture * const *textures)
 {
-    WINED3DSAMPLER_TEXTURE_TYPE *sampler_type = reg_maps->sampler_type;
+    enum wined3d_sampler_texture_type *sampler_type = reg_maps->sampler_type;
     unsigned int i;
 
     if (reg_maps->shader_version.major != 1) return;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index ef09e26..07b94f8 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -277,14 +277,14 @@ struct wined3d_settings
 
 extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN;
 
-typedef enum _WINED3DSAMPLER_TEXTURE_TYPE
+enum wined3d_sampler_texture_type
 {
     WINED3DSTT_UNKNOWN = 0,
     WINED3DSTT_1D = 1,
     WINED3DSTT_2D = 2,
     WINED3DSTT_CUBE = 3,
     WINED3DSTT_VOLUME = 4,
-} WINED3DSAMPLER_TEXTURE_TYPE;
+};
 
 typedef enum _WINED3DSHADER_PARAM_REGISTER_TYPE
 {
@@ -544,7 +544,7 @@ struct wined3d_shader_reg_maps
     WORD local_int_consts;                  /* MAX_CONST_I, 16 */
     WORD local_bool_consts;                 /* MAX_CONST_B, 16 */
 
-    WINED3DSAMPLER_TEXTURE_TYPE sampler_type[max(MAX_FRAGMENT_SAMPLERS, MAX_VERTEX_SAMPLERS)];
+    enum wined3d_sampler_texture_type sampler_type[max(MAX_FRAGMENT_SAMPLERS, MAX_VERTEX_SAMPLERS)];
     BYTE bumpmat;                           /* MAX_TEXTURES, 8 */
     BYTE luminanceparams;                   /* MAX_TEXTURES, 8 */
 
@@ -637,7 +637,7 @@ struct wined3d_shader_semantic
 {
     WINED3DDECLUSAGE usage;
     UINT usage_idx;
-    WINED3DSAMPLER_TEXTURE_TYPE sampler_type;
+    enum wined3d_sampler_texture_type sampler_type;
     struct wined3d_shader_dst_param reg;
 };
 
-- 
1.7.3.4




More information about the wine-patches mailing list