mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
ac: rework ac_llvm_extract_elem()
Simplifies the logic a little and asserts index is 0. Suggested-by: Nicolai Hähnle <nhaehnle@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
parent
71f82dc9a3
commit
4a0c24f2dd
1 changed files with 3 additions and 3 deletions
|
|
@ -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), "");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue