diff options
author | Nicolai Hähnle <[email protected]> | 2017-07-04 11:09:24 +0200 |
---|---|---|
committer | Nicolai Hähnle <[email protected]> | 2017-07-31 14:55:44 +0200 |
commit | b7d36efc2d38fa39e860a734a2265b35c2a34e9c (patch) | |
tree | 5f89096f3ea0e45e3749cadab63004ac0945ec03 /src | |
parent | d5741489d3149c4a319df590872ee40c094ecf91 (diff) |
ac/nir: implement load_frag_coord intrinsic
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 9d159649c38..c08f1020e35 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -4012,6 +4012,16 @@ static void visit_intrinsic(struct ac_nir_context *ctx, case nir_intrinsic_load_sample_mask_in: result = ctx->abi->sample_coverage; break; + case nir_intrinsic_load_frag_coord: { + LLVMValueRef values[4] = { + ctx->abi->frag_pos[0], + ctx->abi->frag_pos[1], + ctx->abi->frag_pos[2], + ac_build_fdiv(&ctx->ac, ctx->ac.f32_1, ctx->abi->frag_pos[3]) + }; + result = ac_build_gather_values(&ctx->ac, values, 4); + break; + } case nir_intrinsic_load_front_face: result = ctx->abi->front_face; break; |