diff options
author | Topi Pohjolainen <[email protected]> | 2013-11-27 16:21:11 +0200 |
---|---|---|
committer | Topi Pohjolainen <[email protected]> | 2013-12-27 11:58:46 +0200 |
commit | 1958a9bbdf57dbcef0127012ea61c8492dfcb8b8 (patch) | |
tree | a5868780ae4bb40dcb950d44d50f1cf392656116 /src/mesa/drivers | |
parent | ca53704f4be2d1c8317512b96fbc9540d2856f98 (diff) |
i965/fs: allow fs-generator use without gl_fragment_program
Prepares the generator to accept hand-crafted blorp programs.
Signed-off-by: Topi Pohjolainen <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp index 2381fb0ad22..2bbf687c590 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp @@ -116,7 +116,7 @@ fs_generator::generate_fb_write(fs_inst *inst) brw_set_mask_control(p, BRW_MASK_DISABLE); brw_set_compression_control(p, BRW_COMPRESSION_NONE); - if (fp->UsesKill || c->key.alpha_test_func) { + if ((fp && fp->UsesKill) || c->key.alpha_test_func) { struct brw_reg pixel_mask; if (brw->gen >= 6) @@ -1304,9 +1304,12 @@ fs_generator::generate_code(exec_list *instructions) if (shader) { printf("Native code for fragment shader %d (%d-wide dispatch):\n", prog->Name, dispatch_width); - } else { + } else if (fp) { printf("Native code for fragment program %d (%d-wide dispatch):\n", fp->Base.Id, dispatch_width); + } else { + printf("Native code for blorp program (%d-wide dispatch):\n", + dispatch_width); } } @@ -1344,7 +1347,7 @@ fs_generator::generate_code(exec_list *instructions) else { const prog_instruction *fpi; fpi = (const prog_instruction *)inst->ir; - printf("%d: ", (int)(fpi - fp->Base.Instructions)); + printf("%d: ", (int)(fpi - (fp ? fp->Base.Instructions : 0))); _mesa_fprint_instruction_opt(stdout, fpi, 0, PROG_PRINT_DEBUG, NULL); |