summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost/pan_assemble.c
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-04-03 01:48:09 +0000
committerAlyssa Rosenzweig <[email protected]>2019-04-04 03:44:15 +0000
commit7e8de5a707f7279929d7396550024b8cdc6a8c61 (patch)
treef9dd09dc725259a788c3620b33d2f37ee11afc8f /src/gallium/drivers/panfrost/pan_assemble.c
parenta83862754e94ea11602ac8c43b940b26775b9c4d (diff)
panfrost: Implement system values
This patch implements system values via specially-crafted uniforms. While we previously had an ad hoc system for passing the viewport into the vertex shader, this commit generalizes the system to allow for arbitrary system values to be added to both shader stages. While we're at it, we clean up uniform handling code (which was considerably muddied to handle the ad hoc viewport uniform). This commit serves as both a cleanup of the existing codebase and the precursor to new functionality, like implementing textureSize(). Concurrent with these changes is respecting the depth transform, which was not possible with the old fixed uniform system and here serves as a proof-of-correctness test (as well as justifying the NIR changes). Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost/pan_assemble.c')
-rw-r--r--src/gallium/drivers/panfrost/pan_assemble.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/drivers/panfrost/pan_assemble.c b/src/gallium/drivers/panfrost/pan_assemble.c
index c9abe9e6687..52226311832 100644
--- a/src/gallium/drivers/panfrost/pan_assemble.c
+++ b/src/gallium/drivers/panfrost/pan_assemble.c
@@ -81,6 +81,11 @@ panfrost_shader_compile(struct panfrost_context *ctx, struct mali_shader_meta *m
util_dynarray_fini(&program.compiled);
+ /* Sysvals are prepended */
+ program.uniform_count += program.sysval_count;
+ state->sysval_count = program.sysval_count;
+ memcpy(state->sysval, program.sysvals, sizeof(state->sysval[0]) * state->sysval_count);
+
meta->midgard1.uniform_count = MIN2(program.uniform_count, program.uniform_cutoff);
meta->attribute_count = program.attribute_count;
meta->varying_count = program.varying_count;