i965: Add various plumbing for cubemap arrays
authorChris Forbes <chrisf@ijw.co.nz>
Thu, 22 Nov 2012 04:55:08 +0000 (17:55 +1300)
committerEric Anholt <eric@anholt.net>
Fri, 14 Dec 2012 23:26:12 +0000 (15:26 -0800)
V4: Fixed style nits

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_tex_layout.c
src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/drivers/dri/i965/gen7_sampler_state.c
src/mesa/drivers/dri/i965/gen7_wm_surface_state.c

index 1a2bedb2268b5a575b9b6b3cf01f7d2c756c145b..b661570e99b7ca4dff54db82f97862a51df3c222 100644 (file)
@@ -70,6 +70,10 @@ void
 brw_miptree_layout(struct intel_context *intel, struct intel_mipmap_tree *mt)
 {
    switch (mt->target) {
+   case GL_TEXTURE_CUBE_MAP_ARRAY:
+      brw_miptree_layout_texture_array(intel, mt);
+      break;
+
    case GL_TEXTURE_CUBE_MAP:
       if (intel->gen >= 5) {
         /* On Ironlake, cube maps are finally represented as just a series of
index fb9cb83c7bc4ee9a72fc1f30fe0b48588f5c229b..0d1f24950e6109055dcc50be491812968d9d181b 100644 (file)
@@ -248,7 +248,8 @@ static void brw_update_sampler_state(struct brw_context *brw,
    /* Cube-maps on 965 and later must use the same wrap mode for all 3
     * coordinate dimensions.  Futher, only CUBE and CLAMP are valid.
     */
-   if (texObj->Target == GL_TEXTURE_CUBE_MAP) {
+   if (texObj->Target == GL_TEXTURE_CUBE_MAP ||
+       texObj->Target == GL_TEXTURE_CUBE_MAP_ARRAY) {
       if (ctx->Texture.CubeMapSeamless &&
          (gl_sampler->MinFilter != GL_NEAREST ||
           gl_sampler->MagFilter != GL_NEAREST)) {
index 298678a03c0652471f2539c4aecd6f5291498740..94c01cb3a9d13f679a921b063643514a9a522c12 100644 (file)
@@ -65,6 +65,7 @@ translate_tex_target(GLenum target)
       return BRW_SURFACE_3D;
 
    case GL_TEXTURE_CUBE_MAP: 
+   case GL_TEXTURE_CUBE_MAP_ARRAY:
       return BRW_SURFACE_CUBE;
 
    default: 
index ea634a9be097fb1685a2e52396d2cd88cdebc584..6f0a757380bf5894b1cb512787b1245b4b91cba6 100644 (file)
@@ -111,7 +111,8 @@ gen7_update_sampler_state(struct brw_context *brw, int unit, int ss_index,
    /* Cube-maps on 965 and later must use the same wrap mode for all 3
     * coordinate dimensions.  Futher, only CUBE and CLAMP are valid.
     */
-   if (texObj->Target == GL_TEXTURE_CUBE_MAP) {
+   if (texObj->Target == GL_TEXTURE_CUBE_MAP ||
+       texObj->Target == GL_TEXTURE_CUBE_MAP_ARRAY) {
       if (ctx->Texture.CubeMapSeamless &&
          (gl_sampler->MinFilter != GL_NEAREST ||
           gl_sampler->MagFilter != GL_NEAREST)) {
index 466a038a9cc4396c18ae7561300b98ac070a93da..1e5af959512c5d66ea351016665c2bd560f6f833 100644 (file)
@@ -328,7 +328,8 @@ gen7_update_texture_surface(struct gl_context *ctx,
                                                    firstImage->InternalFormat,
                                                    tObj->DepthMode,
                                                    sampler->sRGBDecode);
-   if (tObj->Target == GL_TEXTURE_CUBE_MAP) {
+   if (tObj->Target == GL_TEXTURE_CUBE_MAP ||
+       tObj->Target == GL_TEXTURE_CUBE_MAP_ARRAY) {
       surf->ss0.cube_pos_x = 1;
       surf->ss0.cube_pos_y = 1;
       surf->ss0.cube_pos_z = 1;