This will let us reuse brw_fs_cfg.cpp from brw_vec4_*.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
#include "brw_eu.h"
#include "brw_wm.h"
}
-#include "brw_shader.h"
#include "brw_fs.h"
#include "glsl/glsl_types.h"
#include "glsl/ir_print_visitor.h"
#include "brw_context.h"
#include "brw_eu.h"
#include "brw_wm.h"
+#include "brw_shader.h"
}
#include "glsl/glsl_types.h"
#include "glsl/ir.h"
static const fs_reg reg_null_f(ARF, BRW_ARF_NULL, BRW_REGISTER_TYPE_F);
static const fs_reg reg_null_d(ARF, BRW_ARF_NULL, BRW_REGISTER_TYPE_D);
-class fs_inst : public exec_node {
+class fs_inst : public backend_instruction {
public:
/* Callers of this ralloc-based new need not call delete. It's
* easier to just ralloc_free 'ctx' (or any of its ancestors). */
bool is_tex();
bool is_math();
- enum opcode opcode; /* BRW_OPCODE_* or FS_OPCODE_* */
fs_reg dst;
fs_reg src[3];
bool saturate;
/** @} */
};
-class fs_visitor : public ir_visitor
+class fs_visitor : public backend_visitor
{
public:
void setup_builtin_uniform_values(ir_variable *ir);
int implied_mrf_writes(fs_inst *inst);
- struct brw_context *brw;
const struct gl_fragment_program *fp;
- struct intel_context *intel;
- struct gl_context *ctx;
struct brw_wm_compile *c;
- struct brw_compile *p;
- struct brw_shader *shader;
- struct gl_shader_program *prog;
- void *mem_ctx;
- exec_list instructions;
/* Delayed setup of c->prog_data.params[] due to realloc of
* ParamValues[] during compile.
#include "brw_eu.h"
#include "brw_wm.h"
}
-#include "brw_shader.h"
#include "brw_fs.h"
#include "glsl/glsl_types.h"
#include "glsl/ir_optimization.h"
#pragma once
+class backend_instruction : public exec_node {
+public:
+ enum opcode opcode; /* BRW_OPCODE_* or FS_OPCODE_* */
+};
+
+class backend_visitor : public ir_visitor {
+public:
+
+ struct brw_context *brw;
+ struct intel_context *intel;
+ struct gl_context *ctx;
+ struct brw_compile *p;
+ struct brw_shader *shader;
+ struct gl_shader_program *prog;
+
+ /** ralloc context for temporary data used during compile */
+ void *mem_ctx;
+
+ /**
+ * List of either fs_inst or vec4_instruction (inheriting from
+ * backend_instruction)
+ */
+ exec_list instructions;
+};
+
int brw_type_for_base_type(const struct glsl_type *type);
uint32_t brw_conditional_for_comparison(unsigned int op);
uint32_t brw_math_function(enum opcode op);
src_reg *reladdr;
};
-class vec4_instruction : public exec_node {
+class vec4_instruction : public backend_instruction {
public:
/* Callers of this ralloc-based new need not call delete. It's
* easier to just ralloc_free 'ctx' (or any of its ancestors). */
struct brw_reg get_dst(void);
struct brw_reg get_src(int i);
- enum opcode opcode; /* BRW_OPCODE_* or FS_OPCODE_* */
dst_reg dst;
src_reg src[3];
bool is_math();
};
-class vec4_visitor : public ir_visitor
+class vec4_visitor : public backend_visitor
{
public:
vec4_visitor(struct brw_vs_compile *c,
return dst_reg(retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
}
- struct brw_context *brw;
const struct gl_vertex_program *vp;
- struct intel_context *intel;
- struct gl_context *ctx;
struct brw_vs_compile *c;
struct brw_vs_prog_data *prog_data;
- struct brw_compile *p;
- struct brw_shader *shader;
- struct gl_shader_program *prog;
- void *mem_ctx;
- exec_list instructions;
char *fail_msg;
bool failed;