diff options
author | Eric Anholt <[email protected]> | 2018-12-05 15:41:35 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2019-04-12 15:59:31 -0700 |
commit | 6b1c6598250955552439c3320bf26de6458c5281 (patch) | |
tree | 426f6d2c75340f8e186813ab2bcd4ac7a67e098a /src/gallium/drivers/v3d/v3d_uniforms.c | |
parent | 1e0a72ce096bf368e184acfbeed28916cc0e968f (diff) |
v3d: Add Compute Shader compilation support.
While waiting for the CSD UABI to get reviewed, I keep having to rebase
the CS patch. Just land the compiler side for now to keep it from
diverging.
For now this covers just GLES 3.1 compute shaders, not CL kernels.
Diffstat (limited to 'src/gallium/drivers/v3d/v3d_uniforms.c')
-rw-r--r-- | src/gallium/drivers/v3d/v3d_uniforms.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/drivers/v3d/v3d_uniforms.c b/src/gallium/drivers/v3d/v3d_uniforms.c index a5532bdf2b4..77101947e2b 100644 --- a/src/gallium/drivers/v3d/v3d_uniforms.c +++ b/src/gallium/drivers/v3d/v3d_uniforms.c @@ -358,6 +358,16 @@ v3d_write_uniforms(struct v3d_context *v3d, struct v3d_compiled_shader *shader, v3d->prog.spill_size_per_thread); break; + case QUNIFORM_NUM_WORK_GROUPS: + cl_aligned_u32(&uniforms, + v3d->compute_num_workgroups[data]); + break; + + case QUNIFORM_SHARED_OFFSET: + cl_aligned_reloc(&job->indirect, &uniforms, + v3d->compute_shared_memory, 0); + break; + default: assert(quniform_contents_is_texture_p0(uinfo->contents[i])); @@ -444,6 +454,11 @@ v3d_set_shader_uniform_dirty_flags(struct v3d_compiled_shader *shader) dirty |= VC5_DIRTY_ZSA; break; + case QUNIFORM_NUM_WORK_GROUPS: + case QUNIFORM_SHARED_OFFSET: + /* Compute always recalculates uniforms. */ + break; + default: assert(quniform_contents_is_texture_p0(shader->prog_data.base->uniforms.contents[i])); dirty |= VC5_DIRTY_FRAGTEX | VC5_DIRTY_VERTTEX; |