/**
- * Scale a normalised value from src_bits to dst_bits
+ * Scale a normalized value from src_bits to dst_bits
*/
static INLINE LLVMValueRef
scale_bits(struct gallivm_state *gallivm,
result = LLVMBuildOr(builder, result, lower, "");
} else if (db > src_bits) {
- /* Need to repeatedely copy src bits to fill remainder in dst */
+ /* Need to repeatedly copy src bits to fill remainder in dst */
unsigned n;
for (n = src_bits; n < dst_bits; n *= 2) {
}
}
- /* No bit arithmitic to do */
+ /* No bit arithmetic to do */
if (!is_arith) {
return;
}
unsigned pixels = block_size / src_count;
unsigned channels = pad_inline ? TGSI_NUM_CHANNELS : dst_channels;
unsigned alpha_span = 1;
+ LLVMValueRef shuffles[LP_MAX_VECTOR_LENGTH];
/* Check if we need 2 src_alphas for our shuffles */
if (pixels > alpha_type.length) {
}
/* Broadcast alpha across all channels, e.g. a1a2 to a1a1a1a1a2a2a2a2 */
+ for (j = 0; j < row_type.length; ++j) {
+ if (j < pixels * channels) {
+ shuffles[j] = lp_build_const_int32(gallivm, j / channels);
+ } else {
+ shuffles[j] = LLVMGetUndef(LLVMInt32TypeInContext(gallivm->context));
+ }
+ }
+
for (i = 0; i < src_count; ++i) {
- LLVMValueRef shuffles[LP_MAX_VECTOR_LENGTH];
unsigned idx1 = i, idx2 = i;
if (alpha_span > 1){
idx2 = idx1 + 1;
}
- for (j = 0; j < row_type.length; ++j) {
- if (j < pixels * channels) {
- shuffles[j] = lp_build_const_int32(gallivm, j / channels);
- } else {
- shuffles[j] = LLVMGetUndef(LLVMInt32TypeInContext(gallivm->context));
- }
- }
-
src_alpha[i] = LLVMBuildShuffleVector(builder,
src_alpha[idx1],
src_alpha[idx2],
-
-
void
llvmpipe_init_fs_funcs(struct llvmpipe_context *llvmpipe)
{