aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2014-05-14 00:41:41 -0700
committerKenneth Graunke <[email protected]>2014-05-18 23:35:20 -0700
commitcca6dc9f0fd43db366730d67baae1affdca8c6de (patch)
tree64b4fa5319d96634ea3a1f8461fd9a837d5364bd /src/mesa/drivers
parent2d4ac9b5b825b745257e935dd9b33a2d3507c72a (diff)
i965/fs: Rip struct brw_wm_compile out of the visitors and generators.
Instead, just pass the key and prog_data as separate parameters. This moves it up a level - one step further toward getting rid of it. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp7
-rw-r--r--src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h1
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp13
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.h12
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_generator.cpp7
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_visitor.cpp9
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm.c3
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm.h3
-rw-r--r--src/mesa/drivers/dri/i965/gen8_fs_generator.cpp6
9 files changed, 33 insertions, 28 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp
index 71e0ad33a04..35491733946 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp
@@ -26,8 +26,11 @@
#include "brw_blorp.h"
brw_blorp_eu_emitter::brw_blorp_eu_emitter(struct brw_context *brw)
- : mem_ctx(ralloc_context(NULL)), c(rzalloc(mem_ctx, struct brw_wm_compile)),
- generator(brw, mem_ctx, c, NULL, NULL, false)
+ : mem_ctx(ralloc_context(NULL)),
+ generator(brw, mem_ctx,
+ rzalloc(mem_ctx, struct brw_wm_prog_key),
+ rzalloc(mem_ctx, struct brw_wm_prog_data),
+ NULL, NULL, false)
{
}
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h b/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h
index c10695e4b48..e68f925b2fd 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h
@@ -182,7 +182,6 @@ private:
fs_inst *emit_cmp(int op, const struct brw_reg &x, const struct brw_reg &y);
void *mem_ctx;
- struct brw_wm_compile *c;
exec_list insts;
fs_generator generator;
};
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 579e492d6d2..606a16084b7 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -3105,7 +3105,8 @@ fs_visitor::run()
const unsigned *
brw_wm_fs_emit(struct brw_context *brw,
void *mem_ctx,
- struct brw_wm_compile *c,
+ const struct brw_wm_prog_key *key,
+ struct brw_wm_prog_data *prog_data,
struct gl_fragment_program *fp,
struct gl_shader_program *prog,
unsigned *final_assembly_size)
@@ -3128,7 +3129,7 @@ brw_wm_fs_emit(struct brw_context *brw,
/* Now the main event: Visit the shader IR and generate our FS IR for it.
*/
- fs_visitor v(brw, mem_ctx, c, prog, fp, 8);
+ fs_visitor v(brw, mem_ctx, key, prog_data, prog, fp, 8);
if (!v.run()) {
if (prog) {
prog->LinkStatus = false;
@@ -3142,7 +3143,7 @@ brw_wm_fs_emit(struct brw_context *brw,
}
exec_list *simd16_instructions = NULL;
- fs_visitor v2(brw, mem_ctx, c, prog, fp, 16);
+ fs_visitor v2(brw, mem_ctx, key, prog_data, prog, fp, 16);
if (brw->gen >= 5 && likely(!(INTEL_DEBUG & DEBUG_NO16))) {
if (!v.simd16_unsupported) {
/* Try a SIMD16 compile */
@@ -3161,18 +3162,18 @@ brw_wm_fs_emit(struct brw_context *brw,
const unsigned *assembly = NULL;
if (brw->gen >= 8) {
- gen8_fs_generator g(brw, mem_ctx, c, prog, fp, v.do_dual_src);
+ gen8_fs_generator g(brw, mem_ctx, key, prog_data, prog, fp, v.do_dual_src);
assembly = g.generate_assembly(&v.instructions, simd16_instructions,
final_assembly_size);
} else {
- fs_generator g(brw, mem_ctx, c, prog, fp, v.do_dual_src);
+ fs_generator g(brw, mem_ctx, key, prog_data, prog, fp, v.do_dual_src);
assembly = g.generate_assembly(&v.instructions, simd16_instructions,
final_assembly_size);
}
if (unlikely(brw->perf_debug) && shader) {
if (shader->compiled_once)
- brw_wm_debug_recompile(brw, prog, &c->key);
+ brw_wm_debug_recompile(brw, prog, key);
shader->compiled_once = true;
if (start_busy && !drm_intel_bo_busy(brw->batch.last_bo)) {
diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
index d42b7b87a47..1c77a93d85f 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_fs.h
@@ -251,7 +251,8 @@ public:
fs_visitor(struct brw_context *brw,
void *mem_ctx,
- struct brw_wm_compile *c,
+ const struct brw_wm_prog_key *key,
+ struct brw_wm_prog_data *prog_data,
struct gl_shader_program *shader_prog,
struct gl_fragment_program *fp,
unsigned dispatch_width);
@@ -494,7 +495,6 @@ public:
void visit_atomic_counter_intrinsic(ir_call *ir);
struct gl_fragment_program *fp;
- struct brw_wm_compile *c;
const struct brw_wm_prog_key *const key;
struct brw_wm_prog_data *prog_data;
unsigned int sanity_param_count;
@@ -598,7 +598,8 @@ class fs_generator
public:
fs_generator(struct brw_context *brw,
void *mem_ctx,
- struct brw_wm_compile *c,
+ const struct brw_wm_prog_key *key,
+ struct brw_wm_prog_data *prog_data,
struct gl_shader_program *prog,
struct gl_fragment_program *fp,
bool dual_source_output);
@@ -701,7 +702,6 @@ private:
struct gl_context *ctx;
struct brw_compile *p;
- struct brw_wm_compile *c;
const struct brw_wm_prog_key *const key;
struct brw_wm_prog_data *prog_data;
@@ -725,7 +725,8 @@ class gen8_fs_generator : public gen8_generator
public:
gen8_fs_generator(struct brw_context *brw,
void *mem_ctx,
- struct brw_wm_compile *c,
+ const struct brw_wm_prog_key *key,
+ struct brw_wm_prog_data *prog_data,
struct gl_shader_program *prog,
struct gl_fragment_program *fp,
bool dual_source_output);
@@ -788,7 +789,6 @@ private:
void patch_discard_jumps_to_fb_writes();
- struct brw_wm_compile *c;
const struct brw_wm_prog_key *const key;
struct brw_wm_prog_data *prog_data;
const struct gl_fragment_program *fp;
diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
index a337aef88b2..c61cc5cccad 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
@@ -38,15 +38,16 @@ extern "C" {
fs_generator::fs_generator(struct brw_context *brw,
void *mem_ctx,
- struct brw_wm_compile *c,
+ const struct brw_wm_prog_key *key,
+ struct brw_wm_prog_data *prog_data,
struct gl_shader_program *prog,
struct gl_fragment_program *fp,
bool dual_source_output)
- : brw(brw), c(c), key(&c->key), prog(prog), fp(fp), dual_source_output(dual_source_output), mem_ctx(mem_ctx)
+ : brw(brw), key(key), prog_data(prog_data), prog(prog), fp(fp),
+ dual_source_output(dual_source_output), mem_ctx(mem_ctx)
{
ctx = &brw->ctx;
- prog_data = &c->prog_data;
p = rzalloc(mem_ctx, struct brw_compile);
brw_init_compile(brw, p, mem_ctx);
diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index 4be59289136..dcc84416a3d 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -2955,17 +2955,16 @@ fs_visitor::resolve_bool_comparison(ir_rvalue *rvalue, fs_reg *reg)
fs_visitor::fs_visitor(struct brw_context *brw,
void *mem_ctx,
- struct brw_wm_compile *c,
+ const struct brw_wm_prog_key *key,
+ struct brw_wm_prog_data *prog_data,
struct gl_shader_program *shader_prog,
struct gl_fragment_program *fp,
unsigned dispatch_width)
- : backend_visitor(brw, shader_prog, &fp->Base, &c->prog_data.base,
+ : backend_visitor(brw, shader_prog, &fp->Base, &prog_data->base,
MESA_SHADER_FRAGMENT),
- key(&c->key),
+ key(key), prog_data(prog_data),
dispatch_width(dispatch_width)
{
- this->c = c;
- this->prog_data = &c->prog_data;
this->fp = fp;
this->mem_ctx = mem_ctx;
this->failed = false;
diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c
index 780c78f628a..1664b18b0ee 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -181,7 +181,8 @@ bool do_wm_prog(struct brw_context *brw,
c->key.persample_shading,
&fp->program);
- program = brw_wm_fs_emit(brw, mem_ctx, c, &fp->program, prog, &program_size);
+ program = brw_wm_fs_emit(brw, mem_ctx, &c->key, &c->prog_data,
+ &fp->program, prog, &program_size);
if (program == NULL) {
ralloc_free(mem_ctx);
return false;
diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h
index dd57a97cfb6..45c8f684811 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.h
+++ b/src/mesa/drivers/dri/i965/brw_wm.h
@@ -92,7 +92,8 @@ struct brw_wm_compile {
*/
const unsigned *brw_wm_fs_emit(struct brw_context *brw,
void *mem_ctx,
- struct brw_wm_compile *c,
+ const struct brw_wm_prog_key *key,
+ struct brw_wm_prog_data *prog_data,
struct gl_fragment_program *fp,
struct gl_shader_program *prog,
unsigned *final_assembly_size);
diff --git a/src/mesa/drivers/dri/i965/gen8_fs_generator.cpp b/src/mesa/drivers/dri/i965/gen8_fs_generator.cpp
index 9a09888012c..294ce46fa66 100644
--- a/src/mesa/drivers/dri/i965/gen8_fs_generator.cpp
+++ b/src/mesa/drivers/dri/i965/gen8_fs_generator.cpp
@@ -37,15 +37,15 @@ extern "C" {
gen8_fs_generator::gen8_fs_generator(struct brw_context *brw,
void *mem_ctx,
- struct brw_wm_compile *c,
+ const struct brw_wm_prog_key *key,
+ struct brw_wm_prog_data *prog_data,
struct gl_shader_program *shader_prog,
struct gl_fragment_program *fp,
bool dual_source_output)
: gen8_generator(brw, shader_prog, fp ? &fp->Base : NULL, mem_ctx),
- c(c), key(&c->key),
+ key(key), prog_data(prog_data),
fp(fp), dual_source_output(dual_source_output)
{
- prog_data = &c->prog_data;
}
gen8_fs_generator::~gen8_fs_generator()