mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 04:48:08 +02:00
move ALIGN16-related macros into p_compiler.h
This commit is contained in:
parent
79b8f97457
commit
3772441c49
3 changed files with 14 additions and 33 deletions
|
|
@ -50,16 +50,6 @@
|
|||
#define VERT_RESULT_MAX 24
|
||||
|
||||
|
||||
#if defined __GNUC__
|
||||
#define ALIGN16_DECL(TYPE, NAME, SIZE) TYPE NAME[SIZE] __attribute__(( aligned( 16 ) ))
|
||||
#define ALIGN16_ASSIGN(P) P
|
||||
#else
|
||||
#define ALIGN16_DECL(TYPE, NAME, SIZE) TYPE NAME[SIZE + 1]
|
||||
#define ALIGN16_ASSIGN(P) align16(P)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
static INLINE unsigned
|
||||
compute_clipmask(float cx, float cy, float cz, float cw)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -68,4 +68,14 @@ typedef unsigned long long uint64;
|
|||
#endif
|
||||
|
||||
|
||||
#if defined __GNUC__
|
||||
#define ALIGN16_DECL(TYPE, NAME, SIZE) TYPE NAME[SIZE] __attribute__(( aligned( 16 ) ))
|
||||
#define ALIGN16_ASSIGN(P) P
|
||||
#else
|
||||
#define ALIGN16_DECL(TYPE, NAME, SIZE) TYPE NAME[SIZE + 1]
|
||||
#define ALIGN16_ASSIGN(P) align16(P)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif /* P_COMPILER_H */
|
||||
|
|
|
|||
|
|
@ -40,15 +40,6 @@
|
|||
#include "sp_tex_sample.h"
|
||||
|
||||
|
||||
#if defined __GNUC__
|
||||
#define USE_ALIGNED_ATTRIBS 1
|
||||
#define ALIGN16_SUFFIX __attribute__(( aligned( 16 ) ))
|
||||
#else
|
||||
#define USE_ALIGNED_ATTRIBS 0
|
||||
#define ALIGN16_SUFFIX
|
||||
#endif
|
||||
|
||||
|
||||
struct quad_shade_stage
|
||||
{
|
||||
struct quad_stage stage;
|
||||
|
|
@ -77,13 +68,8 @@ shade_quad(
|
|||
const float fy = (float) quad->y0;
|
||||
struct tgsi_exec_machine machine;
|
||||
|
||||
#if USE_ALIGNED_ATTRIBS
|
||||
struct tgsi_exec_vector inputs[PIPE_ATTRIB_MAX] ALIGN16_SUFFIX;
|
||||
struct tgsi_exec_vector outputs[PIPE_ATTRIB_MAX] ALIGN16_SUFFIX;
|
||||
#else
|
||||
struct tgsi_exec_vector inputs[PIPE_ATTRIB_MAX + 1];
|
||||
struct tgsi_exec_vector outputs[PIPE_ATTRIB_MAX + 1];
|
||||
#endif
|
||||
ALIGN16_DECL(struct tgsi_exec_vector, inputs, PIPE_ATTRIB_MAX);
|
||||
ALIGN16_DECL(struct tgsi_exec_vector, outputs, PIPE_ATTRIB_MAX);
|
||||
|
||||
#ifdef DEBUG
|
||||
memset( &machine, 0, sizeof( machine ) );
|
||||
|
|
@ -99,13 +85,8 @@ shade_quad(
|
|||
/* Consts does not require 16 byte alignment. */
|
||||
machine.Consts = softpipe->fs.constants->constant;
|
||||
|
||||
#if USE_ALIGNED_ATTRIBS
|
||||
machine.Inputs = inputs;
|
||||
machine.Outputs = outputs;
|
||||
#else
|
||||
machine.Inputs = (struct tgsi_exec_vector *) tgsi_align_128bit( inputs );
|
||||
machine.Outputs = (struct tgsi_exec_vector *) tgsi_align_128bit( outputs );
|
||||
#endif
|
||||
machine.Inputs = ALIGN16_ASSIGN(inputs);
|
||||
machine.Outputs = ALIGN16_ASSIGN(outputs);
|
||||
|
||||
machine.InterpCoefs = quad->coef;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue