[Dri-patches] [PATCH] i965: enable AMD_seamless_cubemap_per_texture for Gen6+

Chris Forbes chrisf at ijw.co.nz
Sun Apr 29 01:12:41 PDT 2012


---
 src/mesa/drivers/dri/i965/brw_wm_sampler_state.c |    2 +-
 src/mesa/drivers/dri/i965/gen7_sampler_state.c   |    2 +-
 src/mesa/drivers/dri/intel/intel_extensions.c    |    3 +++
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
index 9f13299..5fb681e 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
@@ -237,7 +237,7 @@ static void brw_update_sampler_state(struct brw_context *brw,
     * coordinate dimensions.  Futher, only CUBE and CLAMP are valid.
     */
    if (texObj->Target == GL_TEXTURE_CUBE_MAP) {
-      if (ctx->Texture.CubeMapSeamless &&
+      if ((ctx->Texture.CubeMapSeamless || gl_sampler->CubeMapSeamless) &&
 	  (gl_sampler->MinFilter != GL_NEAREST ||
 	   gl_sampler->MagFilter != GL_NEAREST)) {
 	 sampler->ss1.r_wrap_mode = BRW_TEXCOORDMODE_CUBE;
diff --git a/src/mesa/drivers/dri/i965/gen7_sampler_state.c b/src/mesa/drivers/dri/i965/gen7_sampler_state.c
index 0cf6229..1d90a6e 100644
--- a/src/mesa/drivers/dri/i965/gen7_sampler_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_sampler_state.c
@@ -112,7 +112,7 @@ gen7_update_sampler_state(struct brw_context *brw, int unit,
     * coordinate dimensions.  Futher, only CUBE and CLAMP are valid.
     */
    if (texObj->Target == GL_TEXTURE_CUBE_MAP) {
-      if (ctx->Texture.CubeMapSeamless &&
+      if ((ctx->Texture.CubeMapSeamless || gl_sampler->CubeMapSeamless) &&
 	  (gl_sampler->MinFilter != GL_NEAREST ||
 	   gl_sampler->MagFilter != GL_NEAREST)) {
 	 sampler->ss3.r_wrap_mode = BRW_TEXCOORDMODE_CUBE;
diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c
index a50ab77..62ea522 100644
--- a/src/mesa/drivers/dri/intel/intel_extensions.c
+++ b/src/mesa/drivers/dri/intel/intel_extensions.c
@@ -103,6 +103,9 @@ intelInitExtensions(struct gl_context *ctx)
    if (intel->gen >= 5)
       ctx->Extensions.EXT_timer_query = true;
 
+   if (intel->gen >= 6)	/* TODO: what gen does this actually need to be? */
+      ctx->Extensions.AMD_seamless_cubemap_per_texture = true;
+
    if (intel->gen >= 4) {
       ctx->Extensions.ARB_color_buffer_float = true;
       ctx->Extensions.ARB_depth_buffer_float = true;
-- 
1.7.10



More information about the dri-patches mailing list