diff options
author | Erik Faye-Lund <[email protected]> | 2019-07-15 12:02:31 +0200 |
---|---|---|
committer | Erik Faye-Lund <[email protected]> | 2019-10-28 08:51:46 +0000 |
commit | c2f52cf94f68a918ecb5227074c6da03da34c4b0 (patch) | |
tree | 3908383ad5483f47126a35da941dc39a0f8cf2ac /src/gallium/drivers | |
parent | 97f4827e2ec9c311a669f1e64827ce52b12b4250 (diff) |
zink/spirv: be a bit more strict with fragment-results
Acked-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c index ca29e7e8398..3792729ccb3 100644 --- a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c +++ b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c @@ -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); + } } } |