aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2014-01-22 11:45:39 -0800
committerPaul Berry <[email protected]>2014-01-23 13:40:55 -0800
commit9cee3ff562f3e4b51bfd30338fd1ba7716ac5737 (patch)
tree4cdb18527abf58071fe5b17053eb35a63bdc45e1 /src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
parent00c672086c31f94dd96609fa976300781f53792e (diff)
i965: Remove *_generator::shader field; use prog field instead.
The "shader" field in fs_generator, vec4_generator, and gen8_generator was only used for one purpose; to figure out if we were compiling an assembly program or a GLSL shader (shader is NULL for assembly programs). And it wasn't being used properly: in vec4 shaders we were always initializing it based on prog->_LinkedShaders[MESA_SHADER_FRAGMENT], regardless of whether we were compiling a geometry shader or a vertex shader. This patch simplifies things by using the "prog" field instead; this is also NULL for assembly programs. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vec4_generator.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_generator.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
index 1e6520dbabe..94d1e791689 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
@@ -142,8 +142,6 @@ vec4_generator::vec4_generator(struct brw_context *brw,
: brw(brw), shader_prog(shader_prog), prog(prog), prog_data(prog_data),
mem_ctx(mem_ctx), debug_flag(debug_flag)
{
- shader = shader_prog ? shader_prog->_LinkedShaders[MESA_SHADER_VERTEX] : NULL;
-
p = rzalloc(mem_ctx, struct brw_compile);
brw_init_compile(brw, p, mem_ctx);
}
@@ -1257,7 +1255,7 @@ vec4_generator::generate_code(exec_list *instructions)
const void *last_annotation_ir = NULL;
if (unlikely(debug_flag)) {
- if (shader) {
+ if (prog) {
printf("Native code for vertex shader %d:\n", shader_prog->Name);
} else {
printf("Native code for vertex program %d:\n", prog->Id);
@@ -1273,7 +1271,7 @@ vec4_generator::generate_code(exec_list *instructions)
last_annotation_ir = inst->ir;
if (last_annotation_ir) {
printf(" ");
- if (shader) {
+ if (prog) {
((ir_instruction *) last_annotation_ir)->print();
} else {
const prog_instruction *vpi;