mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 15:38:09 +02:00
i965: Add var->location != -1 assertions.
We shouldn't receive variables with invalid locations set - adding these assertions should help catch problems before they cause crashes later. Inspired by similar code in st_glsl_to_tgsi. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
parent
b5b18e4687
commit
bcc7eb115e
2 changed files with 3 additions and 0 deletions
|
|
@ -57,6 +57,7 @@ fs_visitor::visit(ir_variable *ir)
|
|||
return;
|
||||
|
||||
if (ir->data.mode == ir_var_shader_in) {
|
||||
assert(ir->data.location != -1);
|
||||
if (!strcmp(ir->name, "gl_FragCoord")) {
|
||||
reg = emit_fragcoord_interpolation(ir);
|
||||
} else if (!strcmp(ir->name, "gl_FrontFacing")) {
|
||||
|
|
|
|||
|
|
@ -1020,10 +1020,12 @@ vec4_visitor::visit(ir_variable *ir)
|
|||
|
||||
switch (ir->data.mode) {
|
||||
case ir_var_shader_in:
|
||||
assert(ir->data.location != -1);
|
||||
reg = new(mem_ctx) dst_reg(ATTR, ir->data.location);
|
||||
break;
|
||||
|
||||
case ir_var_shader_out:
|
||||
assert(ir->data.location != -1);
|
||||
reg = new(mem_ctx) dst_reg(this, ir->type);
|
||||
|
||||
for (int i = 0; i < type_size(ir->type); i++) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue