From ae7189df6e881d0a9a162625baf698f1309fd2dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Tue, 29 Sep 2020 17:36:57 -0400 Subject: [PATCH] st/mesa: pass inlinable uniforms to drivers if they requested it Reviewed-by: Timothy Arceri Part-of: --- src/mesa/state_tracker/st_atom_constbuf.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/mesa/state_tracker/st_atom_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c index 2b5cc547ec5..5612bb5f796 100644 --- a/src/mesa/state_tracker/st_atom_constbuf.c +++ b/src/mesa/state_tracker/st_atom_constbuf.c @@ -119,6 +119,21 @@ st_upload_constants(struct st_context *st, struct gl_program *prog) cso_set_constant_buffer(st->cso_context, shader_type, 0, &cb); pipe_resource_reference(&cb.buffer, NULL); + /* Set inlinable constants. */ + unsigned num_inlinable_uniforms = prog->info.num_inlinable_uniforms; + if (num_inlinable_uniforms) { + struct pipe_context *pipe = st->pipe; + uint32_t values[MAX_INLINABLE_UNIFORMS]; + gl_constant_value *constbuf = params->ParameterValues; + + for (unsigned i = 0; i < num_inlinable_uniforms; i++) + values[i] = constbuf[prog->info.inlinable_uniform_dw_offsets[i]].u; + + pipe->set_inlinable_constants(pipe, shader_type, + prog->info.num_inlinable_uniforms, + values); + } + st->state.constants[shader_type].ptr = params->ParameterValues; st->state.constants[shader_type].size = paramBytes; }