Rev 3291 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3291 | Rev 4251 | ||
---|---|---|---|
Line 15... | Line 15... | ||
15 | /* Is the pixmap too large to render to? */ |
15 | /* Is the pixmap too large to render to? */ |
16 | return (dst->drawable.width > sna->render.max_3d_size || |
16 | return (dst->drawable.width > sna->render.max_3d_size || |
17 | dst->drawable.height > sna->render.max_3d_size); |
17 | dst->drawable.height > sna->render.max_3d_size); |
18 | } |
18 | } |
Line 19... | Line 19... | ||
19 | 19 | ||
20 | static inline float pack_2s(int16_t x, int16_t y) |
20 | static force_inline float pack_2s(int16_t x, int16_t y) |
21 | { |
21 | { |
22 | union { |
22 | union { |
23 | struct sna_coordinate p; |
23 | struct sna_coordinate p; |
24 | float f; |
24 | float f; |
25 | } u; |
25 | } u; |
26 | u.p.x = x; |
26 | u.p.x = x; |
27 | u.p.y = y; |
27 | u.p.y = y; |
28 | return u.f; |
28 | return u.f; |
Line 29... | Line 29... | ||
29 | } |
29 | } |
30 | 30 | ||
31 | static inline int vertex_space(struct sna *sna) |
31 | static force_inline int vertex_space(struct sna *sna) |
32 | { |
32 | { |
33 | return sna->render.vertex_size - sna->render.vertex_used; |
33 | return sna->render.vertex_size - sna->render.vertex_used; |
34 | } |
34 | } |
35 | static inline void vertex_emit(struct sna *sna, float v) |
35 | static force_inline void vertex_emit(struct sna *sna, float v) |
36 | { |
36 | { |
37 | assert(sna->render.vertex_used < sna->render.vertex_size); |
37 | assert(sna->render.vertex_used < sna->render.vertex_size); |
38 | sna->render.vertices[sna->render.vertex_used++] = v; |
38 | sna->render.vertices[sna->render.vertex_used++] = v; |
39 | } |
39 | } |
40 | static inline void vertex_emit_2s(struct sna *sna, int16_t x, int16_t y) |
40 | static force_inline void vertex_emit_2s(struct sna *sna, int16_t x, int16_t y) |
41 | { |
41 | { |
Line 42... | Line 42... | ||
42 | vertex_emit(sna, pack_2s(x, y)); |
42 | vertex_emit(sna, pack_2s(x, y)); |
43 | } |
43 | } |
44 | 44 | ||
45 | static inline int batch_space(struct sna *sna) |
45 | static force_inline int batch_space(struct sna *sna) |
46 | { |
46 | { |
47 | assert(sna->kgem.nbatch <= KGEM_BATCH_SIZE(&sna->kgem)); |
47 | assert(sna->kgem.nbatch <= KGEM_BATCH_SIZE(&sna->kgem)); |
Line 48... | Line 48... | ||
48 | assert(sna->kgem.nbatch + KGEM_BATCH_RESERVED <= sna->kgem.surface); |
48 | assert(sna->kgem.nbatch + KGEM_BATCH_RESERVED <= sna->kgem.surface); |
49 | return sna->kgem.surface - sna->kgem.nbatch - KGEM_BATCH_RESERVED; |
49 | return sna->kgem.surface - sna->kgem.nbatch - KGEM_BATCH_RESERVED; |
50 | } |
50 | } |
51 | 51 | ||
52 | static inline void batch_emit(struct sna *sna, uint32_t dword) |
52 | static force_inline void batch_emit(struct sna *sna, uint32_t dword) |
53 | { |
53 | { |
Line 54... | Line 54... | ||
54 | assert(sna->kgem.mode != KGEM_NONE); |
54 | assert(sna->kgem.mode != KGEM_NONE); |
55 | assert(sna->kgem.nbatch + KGEM_BATCH_RESERVED < sna->kgem.surface); |
55 | assert(sna->kgem.nbatch + KGEM_BATCH_RESERVED < sna->kgem.surface); |
56 | sna->kgem.batch[sna->kgem.nbatch++] = dword; |
56 | sna->kgem.batch[sna->kgem.nbatch++] = dword; |
57 | } |
57 | } |
58 | 58 | ||
59 | static inline void batch_emit_float(struct sna *sna, float f) |
59 | static force_inline void batch_emit_float(struct sna *sna, float f) |
60 | { |
60 | { |
61 | union { |
61 | union { |
62 | uint32_t dw; |
62 | uint32_t dw; |
Line 63... | Line -... | ||
63 | float f; |
- | |
64 | } u; |
63 | float f; |