i965: Pass brw to translate_wrap_mode().
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 29 May 2014 06:37:44 +0000 (23:37 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 5 Jun 2014 08:25:56 +0000 (01:25 -0700)
This lets us do generation checks.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
src/mesa/drivers/dri/i965/brw_state.h
src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
src/mesa/drivers/dri/i965/gen7_sampler_state.c

index dbcf7c7cf871557904332a68f9df01477916435c..c52a977623c58fb8141f934b0b3ee5c3e89f55fe 100644 (file)
@@ -243,7 +243,8 @@ void gen7_upload_3dstate_so_decl_list(struct brw_context *brw,
 void gen8_init_vtable_surface_functions(struct brw_context *brw);
 
 /* brw_wm_sampler_state.c */
-uint32_t translate_wrap_mode(GLenum wrap, bool using_nearest);
+uint32_t translate_wrap_mode(struct brw_context *brw,
+                             GLenum wrap, bool using_nearest);
 void upload_default_color(struct brw_context *brw,
                          struct gl_sampler_object *sampler,
                          int unit,
index bbfd9e053d8def686ffc08cc86b6f8fea68132ea..6f8dde4a29b2f94e3079592f2fba936c21d57501 100644 (file)
@@ -46,7 +46,7 @@
 
 
 uint32_t
-translate_wrap_mode(GLenum wrap, bool using_nearest)
+translate_wrap_mode(struct brw_context *brw, GLenum wrap, bool using_nearest)
 {
    switch( wrap ) {
    case GL_REPEAT:
@@ -276,11 +276,11 @@ static void brw_update_sampler_state(struct brw_context *brw,
       }
    }
 
-   sampler->ss1.r_wrap_mode = translate_wrap_mode(gl_sampler->WrapR,
+   sampler->ss1.r_wrap_mode = translate_wrap_mode(brw, gl_sampler->WrapR,
                                                  using_nearest);
-   sampler->ss1.s_wrap_mode = translate_wrap_mode(gl_sampler->WrapS,
+   sampler->ss1.s_wrap_mode = translate_wrap_mode(brw, gl_sampler->WrapS,
                                                  using_nearest);
-   sampler->ss1.t_wrap_mode = translate_wrap_mode(gl_sampler->WrapT,
+   sampler->ss1.t_wrap_mode = translate_wrap_mode(brw, gl_sampler->WrapT,
                                                  using_nearest);
 
    if (brw->gen >= 6 &&
index 74d5e9e0a7e3856f41f8735021a0b45ad10fa39c..6077ff2023083369b9ff69216d33d5e88f35d98e 100644 (file)
@@ -103,11 +103,11 @@ gen7_update_sampler_state(struct brw_context *brw, int unit, int ss_index,
       }
    }
 
-   sampler->ss3.r_wrap_mode = translate_wrap_mode(gl_sampler->WrapR,
+   sampler->ss3.r_wrap_mode = translate_wrap_mode(brw, gl_sampler->WrapR,
                                                  using_nearest);
-   sampler->ss3.s_wrap_mode = translate_wrap_mode(gl_sampler->WrapS,
+   sampler->ss3.s_wrap_mode = translate_wrap_mode(brw, gl_sampler->WrapS,
                                                  using_nearest);
-   sampler->ss3.t_wrap_mode = translate_wrap_mode(gl_sampler->WrapT,
+   sampler->ss3.t_wrap_mode = translate_wrap_mode(brw, gl_sampler->WrapT,
                                                  using_nearest);
 
    /* Cube-maps on 965 and later must use the same wrap mode for all 3