[Mesa-dev] [PATCH 1/2] freedreno: Update to handle rename of the base vertex ID intrinsic

Kenneth Graunke kenneth at whitecape.org
Mon Dec 11 23:40:29 UTC 2017


On Wednesday, November 22, 2017 6:03:24 AM PST Neil Roberts wrote:
> The old intrinsic called base_vertex that is used to add to
> gl_VertexID is now called base_vertex_id so that base_vertex can be
> used for the value of gl_BaseVertex, which is different. As far as I
> can tell freedreno doesn’t support GL_ARB_shader_draw_parameters so it
> won’t need any changes to generate the new base_vertex intrinsic.
> 
> I haven’t tested this at all apart from to verify that it compiles.
> 
> Cc: Rob Clark <robdclark at gmail.com>
> ---
>  src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
> index da4aeaa..e6fbf45 100644
> --- a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
> +++ b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
> @@ -2071,10 +2071,10 @@ emit_intrinsic(struct ir3_context *ctx, nir_intrinsic_instr *intr)
>  			ctx->ir->outputs[n] = src[i];
>  		}
>  		break;
> -	case nir_intrinsic_load_base_vertex:
> +	case nir_intrinsic_load_base_vertex_id:
>  		if (!ctx->basevertex) {
>  			ctx->basevertex = create_driver_param(ctx, IR3_DP_VTXID_BASE);
> -			add_sysval_input(ctx, SYSTEM_VALUE_BASE_VERTEX,
> +			add_sysval_input(ctx, SYSTEM_VALUE_BASE_VERTEX_ID,
>  					ctx->basevertex);
>  		}
>  		dst[0] = ctx->basevertex;
> 

Hi Neil,

I think you should change a3xx/fd3_emit.c and a4xx/fd4_emit.c from
SYSTEM_VALUE_BASE_VERTEX to SYSTEM_VALUE_FIRST_VERTEX as well.

Presumably, we want to squash these changes into
"nir: Offset vertex_id by first_vertex instead of base_vertex"
to avoid intermediate breakage.

I have an a3xx I can try and get going again to test this if needed.

--Ken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171211/21c2fa4c/attachment.sig>


More information about the mesa-dev mailing list