llvmpipe: check shader outputs are non-null before using

This commit is contained in:
Keith Whitwell 2010-10-15 13:23:05 +01:00
parent a14376218e
commit ffab84c9a2
1 changed files with 2 additions and 2 deletions

View File

@ -345,7 +345,7 @@ generate_fs(struct llvmpipe_context *lp,
TGSI_SEMANTIC_COLOR,
0);
if (color0 != -1) {
if (color0 != -1 && outputs[color0][3]) {
LLVMValueRef alpha = LLVMBuildLoad(builder, outputs[color0][3], "alpha");
LLVMValueRef alpha_ref_value;
@ -364,7 +364,7 @@ generate_fs(struct llvmpipe_context *lp,
TGSI_SEMANTIC_POSITION,
0);
if (pos0 != -1) {
if (pos0 != -1 && outputs[pos0][2]) {
z = LLVMBuildLoad(builder, outputs[pos0][2], "z");
lp_build_name(z, "output%u.%u.%c", i, pos0, "xyzw"[chan]);
}