mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-02 11:18:17 +02:00
draw llvm: fix translation of formats with variable components
This commit is contained in:
parent
ab5c097387
commit
557b75248a
1 changed files with 13 additions and 0 deletions
|
|
@ -428,6 +428,12 @@ fetch(LLVMBuilderRef builder,
|
|||
int offset = 0;
|
||||
LLVMValueRef res = LLVMConstNull(
|
||||
LLVMVectorType(LLVMFloatType(), 4));
|
||||
LLVMValueRef defaults[4];
|
||||
|
||||
defaults[0] = LLVMConstReal(LLVMFloatType(), 0);
|
||||
defaults[1] = LLVMConstReal(LLVMFloatType(), 0);
|
||||
defaults[2] = LLVMConstReal(LLVMFloatType(), 0);
|
||||
defaults[3] = LLVMConstReal(LLVMFloatType(), 1);
|
||||
|
||||
for (i = 0; i < nr_components; ++i) {
|
||||
LLVMValueRef src_index = LLVMConstInt(LLVMInt32Type(), offset, 0);
|
||||
|
|
@ -447,6 +453,13 @@ fetch(LLVMBuilderRef builder,
|
|||
dst_index, "");
|
||||
offset += val_size;
|
||||
}
|
||||
for (; i < 4; ++i) {
|
||||
LLVMValueRef dst_index = LLVMConstInt(LLVMInt32Type(), i, 0);
|
||||
res = LLVMBuildInsertElement(builder,
|
||||
res,
|
||||
defaults[i],
|
||||
dst_index, "");
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue