Mesa (master): zink: set PIPE_CAP_VIEWPORT_TRANSFORM_LOWERED and remove POS special casing
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Jun 17 22:01:36 UTC 2020
Module: Mesa
Branch: master
Commit: 1983609212e35d5d48809b675ee9db1bd64964ea
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1983609212e35d5d48809b675ee9db1bd64964ea
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Wed Jun 17 13:47:22 2020 -0400
zink: set PIPE_CAP_VIEWPORT_TRANSFORM_LOWERED and remove POS special casing
this cap creates a different varying output which remains constant to be
emitted by xfb, allowing us to drop the special-casing code in ntv
Reviewed-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5163>
---
src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c | 16 ----------------
src/gallium/drivers/zink/zink_screen.c | 3 +++
2 files changed, 3 insertions(+), 16 deletions(-)
diff --git a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
index 10ff16eaff2..47194f655c7 100644
--- a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
+++ b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
@@ -949,22 +949,6 @@ emit_so_outputs(struct ntv_context *ctx,
if (glsl_type_is_scalar(out_type) || (type == output_type && glsl_get_length(out_type) == so_output.num_components))
result = src;
else {
- if (ctx->stage == MESA_SHADER_VERTEX && so_output.register_index == VARYING_SLOT_POS) {
- /* gl_Position was modified by nir_lower_clip_halfz, so we need to reverse that for streamout here:
- *
- * opengl gl_Position.z = (vulkan gl_Position.z * 2.0) - vulkan gl_Position.w
- *
- * to do this, we extract the z and w components, perform the multiply and subtract ops, then reinsert
- */
- uint32_t z_component[] = {2};
- uint32_t w_component[] = {3};
- SpvId ftype = spirv_builder_type_float(&ctx->builder, 32);
- SpvId z = spirv_builder_emit_composite_extract(&ctx->builder, ftype, src, z_component, 1);
- SpvId w = spirv_builder_emit_composite_extract(&ctx->builder, ftype, src, w_component, 1);
- SpvId new_z = emit_binop(ctx, SpvOpFMul, ftype, z, spirv_builder_const_float(&ctx->builder, 32, 2.0));
- new_z = emit_binop(ctx, SpvOpFSub, ftype, new_z, w);
- src = spirv_builder_emit_vector_insert(&ctx->builder, type, src, new_z, 2);
- }
/* OpCompositeExtract can only extract scalars for our use here */
if (so_output.num_components == 1) {
result = spirv_builder_emit_composite_extract(&ctx->builder, type, src, components, so_output.num_components);
diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c
index 2510715454f..ee5ff504103 100644
--- a/src/gallium/drivers/zink/zink_screen.c
+++ b/src/gallium/drivers/zink/zink_screen.c
@@ -305,6 +305,9 @@ zink_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_TGSI_FS_FACE_IS_INTEGER_SYSVAL:
return 1;
+ case PIPE_CAP_VIEWPORT_TRANSFORM_LOWERED:
+ return 1;
+
case PIPE_CAP_FLATSHADE:
case PIPE_CAP_ALPHA_TEST:
case PIPE_CAP_CLIP_PLANES:
More information about the mesa-commit
mailing list