{
public:
brw_blorp_blit_program(struct brw_context *brw,
- const brw_blorp_blit_prog_key *key, bool debug_flag);
+ const brw_blorp_blit_prog_key *key);
- const GLuint *compile(struct brw_context *brw, GLuint *program_size);
+ const GLuint *compile(struct brw_context *brw, bool debug_flag,
+ GLuint *program_size);
brw_blorp_prog_data prog_data;
};
brw_blorp_blit_program::brw_blorp_blit_program(
- struct brw_context *brw,
- const brw_blorp_blit_prog_key *key,
- bool debug_flag)
- : brw_blorp_eu_emitter(brw, debug_flag),
- brw(brw),
- key(key)
+ struct brw_context *brw, const brw_blorp_blit_prog_key *key)
+ : brw_blorp_eu_emitter(), brw(brw), key(key)
{
}
const GLuint *
-brw_blorp_blit_program::compile(struct brw_context *brw,
+brw_blorp_blit_program::compile(struct brw_context *brw, bool debug_flag,
GLuint *program_size)
{
/* Sanity checks */
*/
render_target_write();
- return get_program(program_size);
+ return get_program(brw, debug_flag, program_size);
}
void
if (!brw_search_cache(&brw->cache, BRW_CACHE_BLORP_BLIT_PROG,
&this->wm_prog_key, sizeof(this->wm_prog_key),
&prog_offset, prog_data)) {
- brw_blorp_blit_program prog(brw, &this->wm_prog_key,
- INTEL_DEBUG & DEBUG_BLORP);
+ brw_blorp_blit_program prog(brw, &this->wm_prog_key);
GLuint program_size;
- const GLuint *program = prog.compile(brw, &program_size);
+ const GLuint *program = prog.compile(brw, INTEL_DEBUG & DEBUG_BLORP,
+ &program_size);
brw_upload_cache(&brw->cache, BRW_CACHE_BLORP_BLIT_PROG,
&this->wm_prog_key, sizeof(this->wm_prog_key),
program, program_size,
#include "brw_blorp.h"
#include "brw_cfg.h"
-brw_blorp_eu_emitter::brw_blorp_eu_emitter(struct brw_context *brw,
- bool debug_flag)
- : mem_ctx(ralloc_context(NULL)),
- generator(brw->intelScreen->compiler, brw,
- mem_ctx, (void *) rzalloc(mem_ctx, struct brw_wm_prog_key),
- (struct brw_stage_prog_data *) rzalloc(mem_ctx, struct brw_wm_prog_data),
- 0, false, MESA_SHADER_FRAGMENT)
+brw_blorp_eu_emitter::brw_blorp_eu_emitter()
+ : mem_ctx(ralloc_context(NULL))
{
- if (debug_flag)
- generator.enable_debug("blorp");
}
brw_blorp_eu_emitter::~brw_blorp_eu_emitter()
}
const unsigned *
-brw_blorp_eu_emitter::get_program(unsigned *program_size)
+brw_blorp_eu_emitter::get_program(struct brw_context *brw, bool debug_flag,
+ unsigned *program_size)
{
cfg_t cfg(&insts);
+ brw_stage_prog_data prog_data = { 0 };
+ brw_wm_prog_key prog_key = { 0 };
+ fs_generator generator(brw->intelScreen->compiler, brw, mem_ctx, &prog_key,
+ &prog_data, 0, false, MESA_SHADER_FRAGMENT);
+
+ if (debug_flag)
+ generator.enable_debug("blorp");
+
generator.generate_code(&cfg, 16);
return generator.get_assembly(program_size);
class brw_blorp_eu_emitter
{
protected:
- explicit brw_blorp_eu_emitter(struct brw_context *brw, bool debug_flag);
+ brw_blorp_eu_emitter();
~brw_blorp_eu_emitter();
- const unsigned *get_program(unsigned *program_size);
+ const unsigned *get_program(struct brw_context *brw, bool debug_flag,
+ unsigned *program_size);
void emit_kill_if_outside_rect(const struct brw_reg &x,
const struct brw_reg &y,
void *mem_ctx;
exec_list insts;
- fs_generator generator;
};
#endif /* BRW_BLORP_BLIT_EU_H */