From a0dca4409a25b7810c28bcd64b48b3f0f159a455 Mon Sep 17 00:00:00 2001 From: Christian König Date: Fri, 22 Mar 2013 15:59:22 +0100 Subject: radeonsi: add instance divisor support v3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v2: reduce key size, don't copy key around to much. v3: remove key size reduction Signed-off-by: Christian König Reviewed-by: Michel Dänzer --- src/gallium/drivers/radeonsi/radeonsi_shader.h | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'src/gallium/drivers/radeonsi/radeonsi_shader.h') diff --git a/src/gallium/drivers/radeonsi/radeonsi_shader.h b/src/gallium/drivers/radeonsi/radeonsi_shader.h index 9dae742115f..9d3c14b3dbb 100644 --- a/src/gallium/drivers/radeonsi/radeonsi_shader.h +++ b/src/gallium/drivers/radeonsi/radeonsi_shader.h @@ -111,13 +111,18 @@ struct si_shader { unsigned nr_cbufs; }; -struct si_shader_key { - unsigned export_16bpc:8; - unsigned nr_cbufs:4; - unsigned color_two_side:1; - unsigned alpha_func:3; - unsigned flatshade:1; - float alpha_ref; +union si_shader_key { + struct { + unsigned export_16bpc:8; + unsigned nr_cbufs:4; + unsigned color_two_side:1; + unsigned alpha_func:3; + unsigned flatshade:1; + float alpha_ref; + } ps; + struct { + unsigned instance_divisors[PIPE_MAX_ATTRIBS]; + } vs; }; struct si_pipe_shader { @@ -132,12 +137,11 @@ struct si_pipe_shader { unsigned spi_shader_col_format; unsigned sprite_coord_enable; unsigned so_strides[4]; - struct si_shader_key key; + union si_shader_key key; }; /* radeonsi_shader.c */ -int si_pipe_shader_create(struct pipe_context *ctx, struct si_pipe_shader *shader, - struct si_shader_key key); +int si_pipe_shader_create(struct pipe_context *ctx, struct si_pipe_shader *shader); void si_pipe_shader_destroy(struct pipe_context *ctx, struct si_pipe_shader *shader); #endif -- cgit v1.2.3