summaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2016-11-16 03:54:22 +0000
committerDave Airlie <[email protected]>2016-11-22 17:15:54 +1000
commit3c6151ccafeb47febb8320b7f4f7bbc0e819708e (patch)
treeaf173224f1c7153553253ff9517eb207fdcf5de3 /src/amd
parent5697cfb7ec08e827a48adc2cd34364696e209147 (diff)
radv/ac: add implementation of load_sample_pos intrinsic.
This fixes a bunch of crashes in CTS tests looking for this. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/common/ac_nir_to_llvm.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 17cefea34a9..741a082c484 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -2764,6 +2764,15 @@ static LLVMValueRef load_sample_position(struct nir_to_llvm_context *ctx,
return build_gather_values(ctx, result, 2);
}
+static LLVMValueRef load_sample_pos(struct nir_to_llvm_context *ctx)
+{
+ LLVMValueRef values[2];
+
+ values[0] = emit_ffract(ctx, ctx->frag_pos[0]);
+ values[1] = emit_ffract(ctx, ctx->frag_pos[1]);
+ return build_gather_values(ctx, values, 2);
+}
+
static LLVMValueRef visit_interp(struct nir_to_llvm_context *ctx,
nir_intrinsic_instr *instr)
{
@@ -2888,6 +2897,9 @@ static void visit_intrinsic(struct nir_to_llvm_context *ctx,
case nir_intrinsic_load_sample_id:
result = ctx->ancillary;
break;
+ case nir_intrinsic_load_sample_pos:
+ result = load_sample_pos(ctx);
+ break;
case nir_intrinsic_load_front_face:
result = ctx->front_face;
break;