Commit 90fcb3fe authored by Ilia Mirkin's avatar Ilia Mirkin

st/mesa: add NV_viewport_swizzle support

Signed-off-by: Ilia Mirkin's avatarIlia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: default avatarMarek Olšák <marek.olsak@amd.com>
Part-of: <!4519>
parent ff168b29
......@@ -34,6 +34,12 @@
#include "pipe/p_context.h"
#include "cso_cache/cso_context.h"
static enum pipe_viewport_swizzle
viewport_swizzle_from_glenum(GLenum16 swizzle)
{
return swizzle - GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV;
}
/**
* Update the viewport transformation matrix. Depends on:
* - viewport pos/size
......@@ -60,6 +66,11 @@ st_update_viewport( struct st_context *st )
scale[1] *= -1;
translate[1] = st->state.fb_height - translate[1];
}
st->state.viewport[i].swizzle_x = viewport_swizzle_from_glenum(ctx->ViewportArray[i].SwizzleX);
st->state.viewport[i].swizzle_y = viewport_swizzle_from_glenum(ctx->ViewportArray[i].SwizzleY);
st->state.viewport[i].swizzle_z = viewport_swizzle_from_glenum(ctx->ViewportArray[i].SwizzleZ);
st->state.viewport[i].swizzle_w = viewport_swizzle_from_glenum(ctx->ViewportArray[i].SwizzleW);
}
cso_set_viewport(st->cso_context, &st->state.viewport[0]);
......
......@@ -804,6 +804,7 @@ void st_init_extensions(struct pipe_screen *screen,
{ o(NV_primitive_restart), PIPE_CAP_PRIMITIVE_RESTART },
{ o(NV_shader_atomic_float), PIPE_CAP_TGSI_ATOMFADD },
{ o(NV_texture_barrier), PIPE_CAP_TEXTURE_BARRIER },
{ o(NV_viewport_swizzle), PIPE_CAP_VIEWPORT_SWIZZLE },
{ o(NVX_gpu_memory_info), PIPE_CAP_QUERY_MEMORY_INFO },
/* GL_NV_point_sprite is not supported by gallium because we don't
* support the GL_POINT_SPRITE_R_MODE_NV option. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment