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

« back to all changes in this revision

Viewing changes to src/mesa/drivers/dri/r300/r300_maos.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-02-21 12:44:07 UTC
  • mfrom: (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 22.
  • Revision ID: james.westby@ubuntu.com-20070221124407-rgcacs32mycrtadl
ImportĀ upstreamĀ versionĀ 6.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
#include "colormac.h"
39
39
#include "imports.h"
40
40
#include "macros.h"
 
41
#include "image.h"
41
42
 
42
43
#include "swrast_setup/swrast_setup.h"
43
44
#include "math/m_translate.h"
289
290
        return 0;
290
291
}
291
292
 
292
 
static GLuint comp_bytes(struct dt *dt)
293
 
{
294
 
        switch (dt->type) {
295
 
        case GL_UNSIGNED_BYTE:
296
 
                return 1;
297
 
        
298
 
        case GL_SHORT:
299
 
                return 2;
300
 
        
301
 
        case GL_FLOAT:
302
 
                return 4;
303
 
        
304
 
        default:
305
 
                assert(0);
306
 
                break;
307
 
        }
308
 
        
309
 
        return 0;
310
 
}
311
 
 
312
293
static GLuint t_aos_size(struct dt *dt)
313
294
{
314
295
        switch (dt->type) {
426
407
        if (hw_tcl_on) {
427
408
                struct r300_vertex_program *prog=(struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx);
428
409
                inputs = prog->inputs;
429
 
                InputsRead = CURRENT_VERTEX_SHADER(ctx)->Base.InputsRead;
430
 
                OutputsWritten = CURRENT_VERTEX_SHADER(ctx)->Base.OutputsWritten;
 
410
                InputsRead = CURRENT_VERTEX_SHADER(ctx)->key.InputsRead;
 
411
                OutputsWritten = CURRENT_VERTEX_SHADER(ctx)->key.OutputsWritten;
431
412
        } else {
432
413
                DECLARE_RENDERINPUTS(inputs_bitset);
433
414
                inputs = r300->state.sw_tcl_inputs;
520
501
                
521
502
                rmesa->state.aos[i].aos_size = t_aos_size(&VB->AttribPtr[tab[i]]);
522
503
                
523
 
                comp_size = comp_bytes(&VB->AttribPtr[tab[i]]);
 
504
                comp_size = _mesa_sizeof_type(VB->AttribPtr[tab[i]].type);
524
505
                
525
 
#if MESA_LITTLE_ENDIAN
526
506
                for (fix = 0; fix <= 4 - VB->AttribPtr[tab[i]].size; fix++) {
527
507
                        if ((rmesa->state.aos[i].aos_offset - comp_size * fix) % 4)
528
508
                                continue;
530
510
                        found = 1;
531
511
                        break;
532
512
                }
533
 
#endif
534
513
                
535
514
                if (found) {
536
515
                        if (fix > 0) {