Module: Mesa Branch: master Commit: 4a0c24f2dd97c670259a7ab0ced701dbf9bb5dd7 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4a0c24f2dd97c670259a7ab0ced701dbf9bb5dd7
Author: Timothy Arceri <tarc...@itsqueeze.com> Date: Wed Dec 13 18:46:56 2017 +1100 ac: rework ac_llvm_extract_elem() Simplifies the logic a little and asserts index is 0. Suggested-by: Nicolai Hähnle <nhaeh...@gmail.com> Reviewed-by: Marek Olšák <marek.ol...@amd.com> --- src/amd/common/ac_llvm_build.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c index 0ea5e7f4ca..8a3a2abf17 100644 --- a/src/amd/common/ac_llvm_build.c +++ b/src/amd/common/ac_llvm_build.c @@ -114,10 +114,10 @@ ac_llvm_extract_elem(struct ac_llvm_context *ac, LLVMValueRef value, int index) { - int count = ac_get_llvm_num_components(value); - - if (count == 1) + if (LLVMGetTypeKind(LLVMTypeOf(value)) != LLVMVectorTypeKind) { + assert(index == 0); return value; + } return LLVMBuildExtractElement(ac->builder, value, LLVMConstInt(ac->i32, index, false), ""); _______________________________________________ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit