diff options
author | Eric Anholt <[email protected]> | 2015-04-06 13:17:58 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2016-09-14 06:08:03 +0100 |
commit | 9688166bd9c3e12c74c55b857ad0dbb62b28da9e (patch) | |
tree | f33d7d803d85fb86443a1f5669edf19d11ef8c90 /src/gallium/drivers/vc4/vc4_uniforms.c | |
parent | c31a7f529fadc016786eedc35ce65802a915ce09 (diff) |
vc4: Move the render job state into a separate structure.
This is a preparation step for having multiple jobs being queued up at the
same time.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_uniforms.c')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_uniforms.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/gallium/drivers/vc4/vc4_uniforms.c b/src/gallium/drivers/vc4/vc4_uniforms.c index e8cd153ce20..07781b8524e 100644 --- a/src/gallium/drivers/vc4/vc4_uniforms.c +++ b/src/gallium/drivers/vc4/vc4_uniforms.c @@ -28,7 +28,7 @@ #include "vc4_qir.h" static void -write_texture_p0(struct vc4_context *vc4, +write_texture_p0(struct vc4_job *job, struct vc4_cl_out **uniforms, struct vc4_texture_stateobj *texstate, uint32_t unit) @@ -37,11 +37,11 @@ write_texture_p0(struct vc4_context *vc4, vc4_sampler_view(texstate->textures[unit]); struct vc4_resource *rsc = vc4_resource(sview->base.texture); - cl_reloc(vc4, &vc4->uniforms, uniforms, rsc->bo, sview->texture_p0); + cl_reloc(job, &job->uniforms, uniforms, rsc->bo, sview->texture_p0); } static void -write_texture_p1(struct vc4_context *vc4, +write_texture_p1(struct vc4_job *job, struct vc4_cl_out **uniforms, struct vc4_texture_stateobj *texstate, uint32_t unit) @@ -55,7 +55,7 @@ write_texture_p1(struct vc4_context *vc4, } static void -write_texture_p2(struct vc4_context *vc4, +write_texture_p2(struct vc4_job *job, struct vc4_cl_out **uniforms, struct vc4_texture_stateobj *texstate, uint32_t data) @@ -72,7 +72,7 @@ write_texture_p2(struct vc4_context *vc4, } static void -write_texture_first_level(struct vc4_context *vc4, +write_texture_first_level(struct vc4_job *job, struct vc4_cl_out **uniforms, struct vc4_texture_stateobj *texstate, uint32_t data) @@ -84,7 +84,7 @@ write_texture_first_level(struct vc4_context *vc4, } static void -write_texture_msaa_addr(struct vc4_context *vc4, +write_texture_msaa_addr(struct vc4_job *job, struct vc4_cl_out **uniforms, struct vc4_texture_stateobj *texstate, uint32_t unit) @@ -92,7 +92,7 @@ write_texture_msaa_addr(struct vc4_context *vc4, struct pipe_sampler_view *texture = texstate->textures[unit]; struct vc4_resource *rsc = vc4_resource(texture->texture); - cl_aligned_reloc(vc4, &vc4->uniforms, uniforms, rsc->bo, 0); + cl_aligned_reloc(job, &job->uniforms, uniforms, rsc->bo, 0); } @@ -104,7 +104,7 @@ write_texture_msaa_addr(struct vc4_context *vc4, } static void -write_texture_border_color(struct vc4_context *vc4, +write_texture_border_color(struct vc4_job *job, struct vc4_cl_out **uniforms, struct vc4_texture_stateobj *texstate, uint32_t unit) @@ -211,14 +211,15 @@ vc4_write_uniforms(struct vc4_context *vc4, struct vc4_compiled_shader *shader, struct vc4_texture_stateobj *texstate) { struct vc4_shader_uniform_info *uinfo = &shader->uniforms; + struct vc4_job *job = vc4->job; const uint32_t *gallium_uniforms = cb->cb[0].user_buffer; struct vc4_bo *ubo = vc4_upload_ubo(vc4, shader, gallium_uniforms); - cl_ensure_space(&vc4->uniforms, (uinfo->count + + cl_ensure_space(&job->uniforms, (uinfo->count + uinfo->num_texture_samples) * 4); struct vc4_cl_out *uniforms = - cl_start_shader_reloc(&vc4->uniforms, + cl_start_shader_reloc(&job->uniforms, uinfo->num_texture_samples); for (int i = 0; i < uinfo->count; i++) { @@ -251,36 +252,36 @@ vc4_write_uniforms(struct vc4_context *vc4, struct vc4_compiled_shader *shader, break; case QUNIFORM_TEXTURE_CONFIG_P0: - write_texture_p0(vc4, &uniforms, texstate, + write_texture_p0(job, &uniforms, texstate, uinfo->data[i]); break; case QUNIFORM_TEXTURE_CONFIG_P1: - write_texture_p1(vc4, &uniforms, texstate, + write_texture_p1(job, &uniforms, texstate, uinfo->data[i]); break; case QUNIFORM_TEXTURE_CONFIG_P2: - write_texture_p2(vc4, &uniforms, texstate, + write_texture_p2(job, &uniforms, texstate, uinfo->data[i]); break; case QUNIFORM_TEXTURE_FIRST_LEVEL: - write_texture_first_level(vc4, &uniforms, texstate, + write_texture_first_level(job, &uniforms, texstate, uinfo->data[i]); break; case QUNIFORM_UBO_ADDR: - cl_aligned_reloc(vc4, &vc4->uniforms, &uniforms, ubo, 0); + cl_aligned_reloc(job, &job->uniforms, &uniforms, ubo, 0); break; case QUNIFORM_TEXTURE_MSAA_ADDR: - write_texture_msaa_addr(vc4, &uniforms, + write_texture_msaa_addr(job, &uniforms, texstate, uinfo->data[i]); break; case QUNIFORM_TEXTURE_BORDER_COLOR: - write_texture_border_color(vc4, &uniforms, + write_texture_border_color(job, &uniforms, texstate, uinfo->data[i]); break; @@ -355,7 +356,7 @@ vc4_write_uniforms(struct vc4_context *vc4, struct vc4_compiled_shader *shader, #endif } - cl_end(&vc4->uniforms, uniforms); + cl_end(&job->uniforms, uniforms); vc4_bo_unreference(&ubo); } |