~ubuntu-branches/ubuntu/quantal/mesa/quantal

« back to all changes in this revision

Viewing changes to src/gallium/drivers/llvmpipe/lp_bld_blend_soa.c

  • Committer: Package Import Robot
  • Author(s): Timo Aaltonen
  • Date: 2012-08-23 15:37:30 UTC
  • mfrom: (1.7.6)
  • Revision ID: package-import@ubuntu.com-20120823153730-c499sefj7btu4386
Tags: 9.0~git20120821.c1114c61-0ubuntu1
* Merge from unreleased debian git.
  - Includes support for ATI Trinity PCI IDs (LP: #1009089)
* rules, control, libgl1-mesa-swx11*: Remove swx11 support.
* Refresh patches:
  - drop 115_llvm_dynamic_linking.diff,
    117_nullptr_check_in_query_version.patch, and
    118_glsl_initialize_samplers.patch, all upstream
  - disable 116_use_shared_galliumcore.diff until it's reviewed and
    reworked to apply
* not-installed, libegl1-mesa-drivers-install.linux.in: Updated to
  match the single-pass build.
* libgl1-mesa-dri.*install.in: Drop libglsl.so, it's included in
  libdricore.so now.
* rules: Don't disable GLU on the common flags, we need to build it
  on the dri target.
* libglu*install.in: Fix the source file paths to match the build target.
  Drop the static lib from -dev since only shared libs get built.
* libgl1-mesa-dev.install.in: Fix the source file paths to match the
  build target.
* libgl1-mesa-dri.install.linux.in: Don't try to install libgallium.so,
  which isn't built yet.
* rules: Enable llvmpipe on armhf to see if it works or not.
* rules: Remove bin/install-sh on clean, and don't create a symlink for
  it.
* control: Add Pre-Depends on dpkg-dev due to the binaries using xz
  compression.

Show diffs side-by-side

added added

removed removed

Lines of Context:
196
196
}
197
197
 
198
198
 
199
 
static boolean
200
 
lp_build_blend_factor_complementary(unsigned src_factor, unsigned dst_factor)
201
 
{
202
 
   return dst_factor == (src_factor ^ 0x10);
203
 
}
204
 
 
205
 
 
206
199
/**
207
200
 * Generate blend code in SOA mode.
208
201
 * \param rt  render target index (to index the blend / colormask state)
252
245
            unsigned func = i < 3 ? blend->rt[rt].rgb_func : blend->rt[rt].alpha_func;
253
246
            boolean func_commutative = lp_build_blend_func_commutative(func);
254
247
 
255
 
            if (func == PIPE_BLEND_ADD &&
256
 
                lp_build_blend_factor_complementary(src_factor, dst_factor) && 0) {
257
 
               /*
258
 
                * Special case linear interpolation, (i.e., complementary factors).
259
 
                */
260
 
 
261
 
               LLVMValueRef weight;
262
 
               if (src_factor < dst_factor) {
263
 
                  weight = lp_build_blend_soa_factor(&bld, src_factor, i);
264
 
                  res[i] = lp_build_lerp(&bld.base, weight, dst[i], src[i]);
265
 
               } else {
266
 
                  weight = lp_build_blend_soa_factor(&bld, dst_factor, i);
267
 
                  res[i] = lp_build_lerp(&bld.base, weight, src[i], dst[i]);
268
 
               }
269
 
               continue;
270
 
            }
271
 
 
272
 
            if ((func == PIPE_BLEND_ADD ||
273
 
                 func == PIPE_BLEND_SUBTRACT ||
274
 
                 func == PIPE_BLEND_REVERSE_SUBTRACT) &&
275
 
                src_factor == dst_factor &&
276
 
                type.floating) {
277
 
               /*
278
 
                * Special common factor.
279
 
                *
280
 
                * XXX: Only for floating points for now, since saturation will
281
 
                * cause different results.
282
 
                */
283
 
 
284
 
               LLVMValueRef factor;
285
 
               factor = lp_build_blend_soa_factor(&bld, src_factor, i);
286
 
               res[i] = lp_build_blend_func(&bld.base, func, src[i], dst[i]);
287
 
               res[i] = lp_build_mul(&bld.base, res[i], factor);
288
 
               continue;
289
 
            }
290
 
 
291
248
            /*
292
249
             * Compute src/dst factors.
293
250
             */
298
255
            bld.factor[1][1][i] = lp_build_blend_soa_factor(&bld, dst_factor, i);
299
256
 
300
257
            /*
 
258
             * Check if lp_build_blend can perform any optimisations
 
259
             */
 
260
            res[i] = lp_build_blend(&bld.base,
 
261
                                    func,
 
262
                                    src_factor,
 
263
                                    dst_factor,
 
264
                                    bld.factor[0][0][i],
 
265
                                    bld.factor[1][0][i],
 
266
                                    bld.factor[0][1][i],
 
267
                                    bld.factor[1][1][i],
 
268
                                    true,
 
269
                                    true);
 
270
 
 
271
            if (res[i]) {
 
272
               continue;
 
273
            }
 
274
 
 
275
            /*
301
276
             * Compute src/dst terms
302
277
             */
303
278
 
311
286
                     break;
312
287
               }
313
288
 
314
 
               if(j < i)
 
289
               if(j < i && bld.term[k][j])
315
290
                  bld.term[k][i] = bld.term[k][j];
316
291
               else
317
292
                  bld.term[k][i] = lp_build_mul(&bld.base, bld.factor[k][0][i], bld.factor[k][1][i]);