| 1 | // Copyright 2016 The SwiftShader Authors. All Rights Reserved. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | #ifndef Vertex_hpp |
| 16 | #define Vertex_hpp |
| 17 | |
| 18 | #include "Color.hpp" |
| 19 | #include "System/Types.hpp" |
| 20 | #include "Device/Config.hpp" |
| 21 | |
| 22 | namespace sw |
| 23 | { |
| 24 | ALIGN(16, struct Vertex |
| 25 | { |
| 26 | union |
| 27 | { |
| 28 | struct |
| 29 | { |
| 30 | float x; |
| 31 | float y; |
| 32 | float z; |
| 33 | float w; |
| 34 | }; |
| 35 | |
| 36 | float4 position; |
| 37 | }; |
| 38 | |
| 39 | float pointSize; |
| 40 | |
| 41 | int clipFlags; |
| 42 | |
| 43 | alignas(16) struct |
| 44 | { |
| 45 | int x; |
| 46 | int y; |
| 47 | float z; |
| 48 | float w; |
| 49 | } projected; |
| 50 | |
| 51 | alignas(16) float v[MAX_INTERFACE_COMPONENTS]; |
| 52 | }); |
| 53 | |
| 54 | static_assert((sizeof(Vertex) & 0x0000000F) == 0, "Vertex size not a multiple of 16 bytes (alignment requirement)" ); |
| 55 | } |
| 56 | |
| 57 | #endif // Vertex_hpp |
| 58 | |