Home | History | Annotate | Download | only in util
      1 #ifndef UTIL_BOX_INLINES_H
      2 #define UTIL_BOX_INLINES_H
      3 
      4 #include "pipe/p_state.h"
      5 
      6 static INLINE
      7 void u_box_1d( unsigned x,
      8 	       unsigned w,
      9 	       struct pipe_box *box )
     10 {
     11    box->x = x;
     12    box->y = 0;
     13    box->z = 0;
     14    box->width = w;
     15    box->height = 1;
     16    box->depth = 1;
     17 }
     18 
     19 static INLINE
     20 void u_box_2d( unsigned x,
     21 	       unsigned y,
     22 	       unsigned w,
     23 	       unsigned h,
     24 	       struct pipe_box *box )
     25 {
     26    box->x = x;
     27    box->y = y;
     28    box->z = 0;
     29    box->width = w;
     30    box->height = h;
     31    box->depth = 1;
     32 }
     33 
     34 static INLINE
     35 void u_box_origin_2d( unsigned w,
     36 		      unsigned h,
     37 		      struct pipe_box *box )
     38 {
     39    box->x = 0;
     40    box->y = 0;
     41    box->z = 0;
     42    box->width = w;
     43    box->height = h;
     44    box->depth = 1;
     45 }
     46 
     47 static INLINE
     48 void u_box_2d_zslice( unsigned x,
     49 		      unsigned y,
     50 		      unsigned z,
     51 		      unsigned w,
     52 		      unsigned h,
     53 		      struct pipe_box *box )
     54 {
     55    box->x = x;
     56    box->y = y;
     57    box->z = z;
     58    box->width = w;
     59    box->height = h;
     60    box->depth = 1;
     61 }
     62 
     63 static INLINE
     64 void u_box_3d( unsigned x,
     65 	       unsigned y,
     66 	       unsigned z,
     67 	       unsigned w,
     68 	       unsigned h,
     69 	       unsigned d,
     70 	       struct pipe_box *box )
     71 {
     72    box->x = x;
     73    box->y = y;
     74    box->z = z;
     75    box->width = w;
     76    box->height = h;
     77    box->depth = d;
     78 }
     79 
     80 #endif
     81