mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-26 03:30:22 +01:00
Fix some assertions that could occur when an error was earlier logged.
This commit is contained in:
parent
e812a2a484
commit
3dfcd48469
1 changed files with 19 additions and 4 deletions
|
|
@ -151,6 +151,8 @@ alloc_temp_storage(slang_emit_info *emitInfo, slang_ir_node *n, GLint size)
|
|||
if (!_slang_alloc_temp(emitInfo->vt, n->Store)) {
|
||||
slang_info_log_error(emitInfo->log,
|
||||
"Ran out of registers, too many temporaries");
|
||||
_mesa_free(n->Store);
|
||||
n->Store = NULL;
|
||||
return GL_FALSE;
|
||||
}
|
||||
return GL_TRUE;
|
||||
|
|
@ -895,7 +897,11 @@ emit_tex(slang_emit_info *emitInfo, slang_ir_node *n)
|
|||
|
||||
/* Child[0] is the sampler (a uniform which'll indicate the texture unit) */
|
||||
assert(n->Children[0]->Store);
|
||||
/* Store->Index is the sampler index */
|
||||
assert(n->Children[0]->Store->Index >= 0);
|
||||
/* Store->Size is the texture target */
|
||||
assert(n->Children[0]->Store->Size >= TEXTURE_1D_INDEX);
|
||||
assert(n->Children[0]->Store->Size <= TEXTURE_RECT_INDEX);
|
||||
|
||||
inst->Sampler = n->Children[0]->Store->Index; /* i.e. uniform's index */
|
||||
inst->TexSrcTarget = n->Children[0]->Store->Size;
|
||||
|
|
@ -913,17 +919,26 @@ emit_move(slang_emit_info *emitInfo, slang_ir_node *n)
|
|||
|
||||
/* lhs */
|
||||
emit(emitInfo, n->Children[0]);
|
||||
if (!n->Children[0]->Store || n->Children[0]->Store->Index < 0) {
|
||||
/* an error should have been already recorded */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* rhs */
|
||||
assert(n->Children[1]);
|
||||
inst = emit(emitInfo, n->Children[1]);
|
||||
|
||||
if (!n->Children[1]->Store) {
|
||||
slang_info_log_error(emitInfo->log, "invalid assignment");
|
||||
if (!n->Children[1]->Store || n->Children[1]->Store->Index < 0) {
|
||||
if (!emitInfo->log->text) {
|
||||
slang_info_log_error(emitInfo->log, "invalid assignment");
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
assert(n->Children[1]->Store->Index >= 0);
|
||||
|
||||
/*assert(n->Children[0]->Store->Size == n->Children[1]->Store->Size);*/
|
||||
|
||||
n->Store = n->Children[0]->Store;
|
||||
|
||||
#if PEEPHOLE_OPTIMIZATIONS
|
||||
|
|
@ -1567,9 +1582,9 @@ emit(slang_emit_info *emitInfo, slang_ir_node *n)
|
|||
}
|
||||
|
||||
if (n->Store->Index < 0) {
|
||||
printf("#### VAR %s not allocated!\n", (char*)n->Var->a_name);
|
||||
/* probably ran out of registers */
|
||||
return NULL;
|
||||
}
|
||||
assert(n->Store->Index >= 0);
|
||||
assert(n->Store->Size > 0);
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue