gallium: initialize viewport swizzle in cso_set_viewport_dims
authorKarol Herbst <kherbst@redhat.com>
Wed, 15 Apr 2020 11:37:39 +0000 (13:37 +0200)
committerKarol Herbst <kherbst@redhat.com>
Wed, 15 Apr 2020 14:43:57 +0000 (16:43 +0200)
Fixes: dEQP-GLES2.functional.fragment_ops.depth_stencil.stencil_* and more
Fixes: 4137a79c2a7e ("gallium: add viewport swizzling state and cap")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4567>

src/gallium/auxiliary/cso_cache/cso_context.c

index 5c21f8279af47b286e05b6056a27833093fc8f8d..459833b21becc83139674d70a138f2ff9d7e15ff 100644 (file)
@@ -756,6 +756,10 @@ cso_set_viewport_dims(struct cso_context *ctx,
    vp.translate[0] = 0.5f * width;
    vp.translate[1] = 0.5f * height;
    vp.translate[2] = 0.5f;
+   vp.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X;
+   vp.swizzle_y = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y;
+   vp.swizzle_z = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Z;
+   vp.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W;
    cso_set_viewport(ctx, &vp);
 }