diff options
author | Xiang, Haihao <haihao.xiang@intel.com> | 2007-12-07 17:26:38 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2007-12-07 17:26:38 +0800 |
commit | c1a3ac0e45d6b69d5567f80b76815b2e6997128d (patch) | |
tree | 646b1c75be504045b073da7f7b5a4d2621f9b712 | |
parent | 62f6e550138ebccbdeb8dd044eabf757d5482126 (diff) |
i915: Check the program size when uploading a program. fix bug 13494
-rw-r--r-- | src/mesa/drivers/dri/i915/i915_vtbl.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c index 5decffa116..4590057a2f 100644 --- a/src/mesa/drivers/dri/i915/i915_vtbl.c +++ b/src/mesa/drivers/dri/i915/i915_vtbl.c @@ -442,14 +442,16 @@ i915_do_emit_state(struct intel_context *intel) } if (dirty & I915_UPLOAD_PROGRAM) { - if (INTEL_DEBUG & DEBUG_STATE) - fprintf(stderr, "I915_UPLOAD_PROGRAM:\n"); + if (ProgramSize) { + if (INTEL_DEBUG & DEBUG_STATE) + fprintf(stderr, "I915_UPLOAD_PROGRAM:\n"); - assert((state->Program[0] & 0x1ff) + 2 == state->ProgramSize); + assert((state->Program[0] & 0x1ff) + 2 == state->ProgramSize); - emit(intel, state->Program, state->ProgramSize * sizeof(GLuint)); - if (INTEL_DEBUG & DEBUG_STATE) - i915_disassemble_program(state->Program, state->ProgramSize); + emit(intel, state->Program, state->ProgramSize * sizeof(GLuint)); + if (INTEL_DEBUG & DEBUG_STATE) + i915_disassemble_program(state->Program, state->ProgramSize); + } } intel->batch->dirty_state &= ~dirty; |