diff options
author | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-07-04 11:09:24 +0200 |
---|---|---|
committer | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-07-05 12:34:00 +0200 |
commit | 256a1849c750df658a805fd236645a15dce23ecf (patch) | |
tree | 730796a6e6bd3b82d3ae130c2e8abb8697331c25 | |
parent | b3c0c7d0d786a40f08491028020fd8ab4a5ab49c (diff) |
ac/nir: implement load_frag_coord intrinsic
-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 9bb1904e54..5a972b798a 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -3986,6 +3986,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; |