diff options
Diffstat (limited to 'src/gallium/drivers/etnaviv/etnaviv_screen.c')
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_screen.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.c b/src/gallium/drivers/etnaviv/etnaviv_screen.c index a69aef09cdd..19d3d91192b 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_screen.c +++ b/src/gallium/drivers/etnaviv/etnaviv_screen.c @@ -155,6 +155,7 @@ etna_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) return true; /* VIV_FEATURE(priv->dev, chipMinorFeatures1, NON_POWER_OF_TWO); */ + case PIPE_CAP_TEXTURE_SWIZZLE: case PIPE_CAP_PRIMITIVE_RESTART: return VIV_FEATURE(screen, chipMinorFeatures1, HALTI0); @@ -164,7 +165,6 @@ etna_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) /* Unsupported features. */ case PIPE_CAP_SEAMLESS_CUBE_MAP: - case PIPE_CAP_TEXTURE_SWIZZLE: /* XXX supported on gc2000 */ case PIPE_CAP_COMPUTE: /* XXX supported on gc2000 */ case PIPE_CAP_MIXED_COLORBUFFER_FORMATS: /* only one colorbuffer supported, so mixing makes no sense */ case PIPE_CAP_CONDITIONAL_RENDER: /* no occlusion queries */ @@ -459,15 +459,24 @@ etna_screen_get_timestamp(struct pipe_screen *pscreen) } static bool -gpu_supports_texure_format(struct etna_screen *screen, uint32_t fmt) +gpu_supports_texure_format(struct etna_screen *screen, uint32_t fmt, + enum pipe_format format) { + bool supported = true; + if (fmt == TEXTURE_FORMAT_ETC1) - return VIV_FEATURE(screen, chipFeatures, ETC1_TEXTURE_COMPRESSION); + supported = VIV_FEATURE(screen, chipFeatures, ETC1_TEXTURE_COMPRESSION); if (fmt >= TEXTURE_FORMAT_DXT1 && fmt <= TEXTURE_FORMAT_DXT4_DXT5) - return VIV_FEATURE(screen, chipFeatures, DXT_TEXTURE_COMPRESSION); + supported = VIV_FEATURE(screen, chipFeatures, DXT_TEXTURE_COMPRESSION); if (fmt & EXT_FORMAT) + supported = VIV_FEATURE(screen, chipMinorFeatures1, HALTI0); + + if (!supported) + return false; + + if (texture_format_needs_swiz(format)) return VIV_FEATURE(screen, chipMinorFeatures1, HALTI0); return true; @@ -514,7 +523,7 @@ etna_screen_is_format_supported(struct pipe_screen *pscreen, if (usage & PIPE_BIND_SAMPLER_VIEW) { uint32_t fmt = translate_texture_format(format); - if (!gpu_supports_texure_format(screen, fmt)) + if (!gpu_supports_texure_format(screen, fmt, format)) fmt = ETNA_NO_MATCH; if (sample_count < 2 && fmt != ETNA_NO_MATCH) |