v3d: Avoid confusing auto-indenting in TEXTURE_SHADER_STATE packing
authorEric Anholt <eric@anholt.net>
Tue, 4 Dec 2018 22:32:27 +0000 (14:32 -0800)
committerEric Anholt <eric@anholt.net>
Sat, 8 Dec 2018 00:48:23 +0000 (16:48 -0800)
Having "v3dx_pack() {" under each #if branch would confuse emacs's
indenter.

src/gallium/drivers/v3d/v3dx_state.c

index cf64fc42452a38562adbb730aee4cf8dc36514c5..980d755755ca2664f0c61f17ed672cffc06386e7 100644 (file)
@@ -712,18 +712,18 @@ v3d_create_sampler_view(struct pipe_context *pctx, struct pipe_resource *prsc,
 
         int msaa_scale = prsc->nr_samples > 1 ? 2 : 1;
 
+        void *map;
 #if V3D_VERSION >= 40
         so->bo = v3d_bo_alloc(v3d->screen,
                               cl_packet_length(TEXTURE_SHADER_STATE), "sampler");
-        void *map = v3d_bo_map(so->bo);
-
-        v3dx_pack(map, TEXTURE_SHADER_STATE, tex) {
+        map = v3d_bo_map(so->bo);
 #else /* V3D_VERSION < 40 */
         STATIC_ASSERT(sizeof(so->texture_shader_state) >=
                       cl_packet_length(TEXTURE_SHADER_STATE));
-        v3dx_pack(&so->texture_shader_state, TEXTURE_SHADER_STATE, tex) {
+        map = &so->texture_shader_state;
 #endif
 
+        v3dx_pack(map, TEXTURE_SHADER_STATE, tex) {
                 tex.image_width = prsc->width0 * msaa_scale;
                 tex.image_height = prsc->height0 * msaa_scale;