Commit 6b2ce13f authored by Erik Faye-Lund 's avatar Erik Faye-Lund

zink/n2s: be a bit more strict with fragment-results

parent 11f7b712
......@@ -280,14 +280,23 @@ emit_output(struct ntv_context *ctx, struct nir_variable *var)
}
}
} else if (ctx->stage == MESA_SHADER_FRAGMENT) {
switch (var->data.location) {
case FRAG_RESULT_DEPTH:
spirv_builder_emit_builtin(&ctx->builder, var_id, SpvBuiltInFragDepth);
break;
default:
if (var->data.location >= FRAG_RESULT_DATA0)
spirv_builder_emit_location(&ctx->builder, var_id,
var->data.driver_location);
var->data.location - FRAG_RESULT_DATA0);
else {
switch (var->data.location) {
case FRAG_RESULT_COLOR:
spirv_builder_emit_location(&ctx->builder, var_id, 0);
break;
case FRAG_RESULT_DEPTH:
spirv_builder_emit_builtin(&ctx->builder, var_id, SpvBuiltInFragDepth);
break;
default:
spirv_builder_emit_location(&ctx->builder, var_id,
var->data.driver_location);
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment