From d931b0d8b360fc0222d295eca38aaee3e4e5d0be Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 2 May 2011 02:38:20 +0200 Subject: [PATCH] r600g: implement seamless_cube_map for evergreen The r600/r700 support will follow soon. --- src/gallium/drivers/r600/evergreen_state.c | 1 + src/gallium/drivers/r600/evergreend.h | 9 +++++++++ src/gallium/drivers/r600/r600_pipe.c | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index 3384a76..502f266 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -332,6 +332,7 @@ static void *evergreen_create_sampler_state(struct pipe_context *ctx, 0xFFFFFFFF, NULL); r600_pipe_state_add_reg(rstate, R_03C008_SQ_TEX_SAMPLER_WORD2_0, S_03C008_LOD_BIAS(S_FIXED(CLAMP(state->lod_bias, -16, 16), 8)) | + (state->seamless_cube_map ? 0 : S_03C008_DISABLE_CUBE_WRAP(1)) | S_03C008_TYPE(1), 0xFFFFFFFF, NULL); diff --git a/src/gallium/drivers/r600/evergreend.h b/src/gallium/drivers/r600/evergreend.h index de445b8..670606d 100644 --- a/src/gallium/drivers/r600/evergreend.h +++ b/src/gallium/drivers/r600/evergreend.h @@ -1194,6 +1194,15 @@ #define S_03C008_FORCE_DEGAMMA(x) (((x) & 0x1) << 21) #define G_03C008_FORCE_DEGAMMA(x) (((x) >> 21) & 0x1) #define C_03C008_FORCE_DEGAMMA 0xFFDFFFFF +#define S_03C008_ANISO_BIAS(x) (((x) & 0x3f) << 22) +#define G_03C008_ANISO_BIAS(x) (((x) >> 22) & 0x3f) +#define C_03C008_ANISO_BIAS (~(0x3f << 22)) +#define S_03C008_TRUNCATE_COORD(x) (((x) & 0x1) << 28) +#define G_03C008_TRUNCATE_COORD(x) (((x) >> 28) & 0x1) +#define C_03C008_TRUNCATE_COORD (~(1 << 28)) +#define S_03C008_DISABLE_CUBE_WRAP(x) (((x) & 0x1) << 29) +#define G_03C008_DISABLE_CUBE_WRAP(x) (((x) >> 29) & 0x1) +#define C_03C008_DISABLE_CUBE_WRAP (~(1 << 29)) #define S_03C008_TYPE(x) (((x) & 0x1) << 31) #define G_03C008_TYPE(x) (((x) >> 31) & 0x1) #define C_03C008_TYPE 0x7FFFFFFF diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c index 779507c..080180f 100644 --- a/src/gallium/drivers/r600/r600_pipe.c +++ b/src/gallium/drivers/r600/r600_pipe.c @@ -383,6 +383,11 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param) /* R600 doesn't support per-MRT blends */ return family == CHIP_R600 ? 0 : 1; + /* Supported on Evergreen. */ + case PIPE_CAP_SEAMLESS_CUBE_MAP: + case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE: + return family >= CHIP_CEDAR ? 1 : 0; + /* Unsupported features. */ case PIPE_CAP_STREAM_OUTPUT: case PIPE_CAP_PRIMITIVE_RESTART: -- 2.7.4