i965: Fix INTEL_DEBUG=vs for fixed-function/ARB programs.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 3 Feb 2014 19:13:48 +0000 (11:13 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 7 Feb 2014 20:36:38 +0000 (12:36 -0800)
Since commit 9cee3ff562f3e4b51bfd30338fd1ba7716ac5737, INTEL_DEBUG=vs
has caused a NULL pointer dereference for fixed-function/ARB programs.

In the vec4 generators, "prog" is a gl_program, and "shader_prog" is the
gl_shader_program.  This is different than the FS visitor.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
src/mesa/drivers/dri/i965/gen8_vec4_generator.cpp

index 94d1e791689c9d717b6ab04da0170779797b08a2..e5ed2c2930042547ae7fcc2d8900f4c123092f2b 100644 (file)
@@ -1255,7 +1255,7 @@ vec4_generator::generate_code(exec_list *instructions)
    const void *last_annotation_ir = NULL;
 
    if (unlikely(debug_flag)) {
-      if (prog) {
+      if (shader_prog) {
          printf("Native code for vertex shader %d:\n", shader_prog->Name);
       } else {
          printf("Native code for vertex program %d:\n", prog->Id);
@@ -1271,7 +1271,7 @@ vec4_generator::generate_code(exec_list *instructions)
            last_annotation_ir = inst->ir;
            if (last_annotation_ir) {
               printf("   ");
-               if (prog) {
+               if (shader_prog) {
                   ((ir_instruction *) last_annotation_ir)->print();
                } else {
                   const prog_instruction *vpi;
index 5a348580b9a48c4605dbd18ffac0d6e1923a2f37..03ed05a0f08b9db5a8694dd662cf2ab5d7f628e6 100644 (file)
@@ -782,7 +782,7 @@ gen8_vec4_generator::generate_code(exec_list *instructions)
    const void *last_annotation_ir = NULL;
 
    if (unlikely(debug_flag)) {
-      if (prog) {
+      if (shader_prog) {
          printf("Native code for vertex shader %d:\n", shader_prog->Name);
       } else {
          printf("Native code for vertex program %d:\n", prog->Id);
@@ -798,7 +798,7 @@ gen8_vec4_generator::generate_code(exec_list *instructions)
             last_annotation_ir = ir->ir;
             if (last_annotation_ir) {
                printf("   ");
-               if (prog) {
+               if (shader_prog) {
                   ((ir_instruction *) last_annotation_ir)->print();
                } else {
                   const prog_instruction *vpi;