glsl: don't pass gl_context to lower shared references.

this uses the consts only

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14433>
This commit is contained in:
Dave Airlie
2022-01-07 10:33:06 +10:00
committed by Marge Bot
parent ff0771e253
commit e83f0fc620
3 changed files with 5 additions and 5 deletions

View File

@@ -142,7 +142,7 @@ ir_variable * lower_xfb_varying(void *mem_ctx,
const char *old_var_name);
void lower_output_reads(unsigned stage, exec_list *instructions);
bool lower_packing_builtins(exec_list *instructions, int op_mask);
void lower_shared_reference(struct gl_context *ctx,
void lower_shared_reference(const struct gl_constants *consts,
struct gl_shader_program *prog,
struct gl_linked_shader *shader);
void lower_ubo_reference(struct gl_linked_shader *shader,

View File

@@ -4581,7 +4581,7 @@ link_varyings_and_uniforms(unsigned first, unsigned last,
ctx->Const.UseSTD430AsDefaultPacking);
if (i == MESA_SHADER_COMPUTE)
lower_shared_reference(ctx, prog, prog->_LinkedShaders[i]);
lower_shared_reference(&ctx->Const, prog, prog->_LinkedShaders[i]);
lower_vector_derefs(prog->_LinkedShaders[i]);
do_vec_index_to_swizzle(prog->_LinkedShaders[i]->ir);

View File

@@ -482,7 +482,7 @@ lower_shared_reference_visitor::visit_enter(ir_call *ir)
} /* unnamed namespace */
void
lower_shared_reference(struct gl_context *ctx,
lower_shared_reference(const struct gl_constants *consts,
struct gl_shader_program *prog,
struct gl_linked_shader *shader)
{
@@ -511,9 +511,9 @@ lower_shared_reference(struct gl_context *ctx,
* basic machine units, may be queried as the value of
* MAX_COMPUTE_SHARED_MEMORY_SIZE."
*/
if (prog->Comp.SharedSize > ctx->Const.MaxComputeSharedMemorySize) {
if (prog->Comp.SharedSize > consts->MaxComputeSharedMemorySize) {
linker_error(prog, "Too much shared memory used (%u/%u)\n",
prog->Comp.SharedSize,
ctx->Const.MaxComputeSharedMemorySize);
consts->MaxComputeSharedMemorySize);
}
}