[Mesa-dev] [PATCH 29/70] i965: stop passing gl_shader_program to brw_compile_gs() and gen6_gs_visitor()
Timothy Arceri
timothy.arceri at collabora.com
Tue Dec 20 10:37:39 UTC 2016
Instead we caan just use gl_program.
---
src/mesa/drivers/dri/i965/brw_compiler.h | 2 +-
src/mesa/drivers/dri/i965/brw_gs.c | 2 +-
src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp | 7 +++----
src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp | 2 +-
src/mesa/drivers/dri/i965/gen6_gs_visitor.h | 3 ---
5 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_compiler.h b/src/mesa/drivers/dri/i965/brw_compiler.h
index 4813f20..5e70601 100644
--- a/src/mesa/drivers/dri/i965/brw_compiler.h
+++ b/src/mesa/drivers/dri/i965/brw_compiler.h
@@ -819,7 +819,7 @@ brw_compile_gs(const struct brw_compiler *compiler, void *log_data,
const struct brw_gs_prog_key *key,
struct brw_gs_prog_data *prog_data,
const struct nir_shader *shader,
- struct gl_shader_program *shader_prog,
+ struct gl_program *prog,
int shader_time_index,
unsigned *final_assembly_size,
char **error_str);
diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c
index 836677b..d6dd926 100644
--- a/src/mesa/drivers/dri/i965/brw_gs.c
+++ b/src/mesa/drivers/dri/i965/brw_gs.c
@@ -148,7 +148,7 @@ brw_codegen_gs_prog(struct brw_context *brw,
char *error_str;
const unsigned *program =
brw_compile_gs(brw->screen->compiler, brw, mem_ctx, key,
- &prog_data, gp->program.nir, prog,
+ &prog_data, gp->program.nir, &gp->program,
st_index, &program_size, &error_str);
if (program == NULL) {
ralloc_strcat(&gp->program.sh.data->InfoLog, error_str);
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp
index 5c04229..77da1db 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp
@@ -590,7 +590,7 @@ brw_compile_gs(const struct brw_compiler *compiler, void *log_data,
const struct brw_gs_prog_key *key,
struct brw_gs_prog_data *prog_data,
const nir_shader *src_shader,
- struct gl_shader_program *shader_prog,
+ struct gl_program *prog,
int shader_time_index,
unsigned *final_assembly_size,
char **error_str)
@@ -644,7 +644,7 @@ brw_compile_gs(const struct brw_compiler *compiler, void *log_data,
prog_data->control_data_format = GEN7_GS_CONTROL_DATA_FORMAT_GSCTL_SID;
/* We only have to emit control bits if we are using streams */
- if (shader_prog && shader_prog->Geom.UsesStreams)
+ if (prog && prog->info.gs.uses_streams)
c.control_data_bits_per_vertex = 2;
else
c.control_data_bits_per_vertex = 0;
@@ -894,8 +894,7 @@ brw_compile_gs(const struct brw_compiler *compiler, void *log_data,
shader, mem_ctx, false /* no_spills */,
shader_time_index);
else
- gs = new gen6_gs_visitor(compiler, log_data, &c, prog_data, shader_prog,
- shader_prog->_LinkedShaders[MESA_SHADER_GEOMETRY]->Program,
+ gs = new gen6_gs_visitor(compiler, log_data, &c, prog_data, prog,
shader, mem_ctx, false /* no_spills */,
shader_time_index);
diff --git a/src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp b/src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp
index f2739e3..075bc4a 100644
--- a/src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp
@@ -534,7 +534,7 @@ gen6_gs_visitor::xfb_setup()
};
const struct gl_transform_feedback_info *linked_xfb_info =
- this->shader_prog->xfb_program->sh.LinkedTransformFeedback;
+ this->prog->sh.LinkedTransformFeedback;
int i;
/* Make sure that the VUE slots won't overflow the unsigned chars in
diff --git a/src/mesa/drivers/dri/i965/gen6_gs_visitor.h b/src/mesa/drivers/dri/i965/gen6_gs_visitor.h
index 556bd15..1bdcf92 100644
--- a/src/mesa/drivers/dri/i965/gen6_gs_visitor.h
+++ b/src/mesa/drivers/dri/i965/gen6_gs_visitor.h
@@ -39,7 +39,6 @@ public:
void *log_data,
struct brw_gs_compile *c,
struct brw_gs_prog_data *prog_data,
- struct gl_shader_program *sh_prog,
struct gl_program *prog,
const nir_shader *shader,
void *mem_ctx,
@@ -47,7 +46,6 @@ public:
int shader_time_index) :
vec4_gs_visitor(comp, log_data, c, prog_data, shader, mem_ctx, no_spills,
shader_time_index),
- shader_prog(sh_prog),
prog(prog)
{
}
@@ -70,7 +68,6 @@ private:
void xfb_setup();
int get_vertex_output_offset_for_varying(int vertex, int varying);
- const struct gl_shader_program *shader_prog;
const struct gl_program *prog;
src_reg vertex_output;
--
2.9.3
More information about the mesa-dev
mailing list