#include "brw_program.h"
#include "compiler/glsl/ir_uniform.h"
static void
assign_cs_binding_table_offsets(const struct gen_device_info *devinfo,
#include "brw_program.h"
#include "compiler/glsl/ir_uniform.h"
static void
assign_cs_binding_table_offsets(const struct gen_device_info *devinfo,
const struct gl_program *prog,
struct brw_cs_prog_data *prog_data)
{
const struct gl_program *prog,
struct brw_cs_prog_data *prog_data)
{
- brw_assign_common_binding_table_offsets(MESA_SHADER_COMPUTE, devinfo,
- shader_prog, prog, &prog_data->base,
+ brw_assign_common_binding_table_offsets(devinfo, prog, &prog_data->base,
next_binding_table_offset);
}
static bool
brw_codegen_cs_prog(struct brw_context *brw,
next_binding_table_offset);
}
static bool
brw_codegen_cs_prog(struct brw_context *brw,
- assign_cs_binding_table_offsets(devinfo, prog, &cp->program, &prog_data);
+ assign_cs_binding_table_offsets(devinfo, &cp->program, &prog_data);
/* Allocate the references to the uniforms that will end up in the
* prog_data associated with the compiled program, and which will be freed
/* Allocate the references to the uniforms that will end up in the
* prog_data associated with the compiled program, and which will be freed
prog_data.base.pull_param =
rzalloc_array(NULL, const gl_constant_value *, param_count);
prog_data.base.image_param =
prog_data.base.pull_param =
rzalloc_array(NULL, const gl_constant_value *, param_count);
prog_data.base.image_param =
- rzalloc_array(NULL, struct brw_image_param, cs->base.NumImages);
+ rzalloc_array(NULL, struct brw_image_param,
+ cp->program.info.num_images);
- brw_nir_setup_glsl_uniforms(cp->program.nir, prog, &cp->program,
- &prog_data.base, true);
+ brw_nir_setup_glsl_uniforms(cp->program.nir, &cp->program,&prog_data.base,
+ true);
- st_index = brw_get_shader_time_index(brw, prog, &cp->program, ST_CS);
+ st_index = brw_get_shader_time_index(brw, &cp->program, ST_CS, true);
char *error_str;
program = brw_compile_cs(brw->screen->compiler, brw, mem_ctx, key,
&prog_data, cp->program.nir, st_index,
&program_size, &error_str);
if (program == NULL) {
char *error_str;
program = brw_compile_cs(brw->screen->compiler, brw, mem_ctx, key,
&prog_data, cp->program.nir, st_index,
&program_size, &error_str);
if (program == NULL) {
- prog->LinkStatus = false;
- ralloc_strcat(&prog->InfoLog, error_str);
+ cp->program.sh.data->LinkStatus = linking_failure;
+ ralloc_strcat(&cp->program.sh.data->InfoLog, error_str);
perf_debug("CS compile took %.03f ms and stalled the GPU\n",
(get_time() - start_time) * 1000);
}
perf_debug("CS compile took %.03f ms and stalled the GPU\n",
(get_time() - start_time) * 1000);
}
&key, sizeof(key),
&brw->cs.base.prog_offset,
&brw->cs.base.prog_data)) {
&key, sizeof(key),
&brw->cs.base.prog_offset,
&brw->cs.base.prog_data)) {
- bool success =
- brw_codegen_cs_prog(brw,
- ctx->Shader.CurrentProgram[MESA_SHADER_COMPUTE],
- cp, &key);
+ bool success = brw_codegen_cs_prog(brw, cp, &key);
-brw_cs_precompile(struct gl_context *ctx,
- struct gl_shader_program *shader_prog,
- struct gl_program *prog)
+brw_cs_precompile(struct gl_context *ctx, struct gl_program *prog)
uint32_t old_prog_offset = brw->cs.base.prog_offset;
struct brw_stage_prog_data *old_prog_data = brw->cs.base.prog_data;
uint32_t old_prog_offset = brw->cs.base.prog_offset;
struct brw_stage_prog_data *old_prog_data = brw->cs.base.prog_data;
- bool success = brw_codegen_cs_prog(brw, shader_prog, bcp, &key);
+ bool success = brw_codegen_cs_prog(brw, bcp, &key);