Nicolas Capens | 68a8238 | 2018-10-02 13:16:55 -0400 | [diff] [blame] | 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" |
Nicolas Capens | 1d8c8db | 2018-11-05 16:30:42 -0500 | [diff] [blame] | 19 | #include "System/Types.hpp" |
| 20 | #include "Device/Config.hpp" |
Nicolas Capens | 68a8238 | 2018-10-02 13:16:55 -0400 | [diff] [blame] | 21 | |
| 22 | namespace sw |
| 23 | { |
Nicolas Capens | 68a8238 | 2018-10-02 13:16:55 -0400 | [diff] [blame] | 24 | ALIGN(16, struct Vertex |
| 25 | { |
Nicolas Capens | 8bcd174 | 2019-06-12 11:41:14 -0400 | [diff] [blame] | 26 | float4 position; |
| 27 | float pointSize; |
Chris Forbes | 26f1a86 | 2019-02-02 15:23:01 -0800 | [diff] [blame] | 28 | |
Nicolas Capens | 8bcd174 | 2019-06-12 11:41:14 -0400 | [diff] [blame] | 29 | int clipFlags; |
| 30 | |
| 31 | alignas(16) struct |
Chris Forbes | 26f1a86 | 2019-02-02 15:23:01 -0800 | [diff] [blame] | 32 | { |
| 33 | int x; |
| 34 | int y; |
| 35 | float z; |
| 36 | float w; |
| 37 | } projected; |
Nicolas Capens | 68a8238 | 2018-10-02 13:16:55 -0400 | [diff] [blame] | 38 | |
Nicolas Capens | 8bcd174 | 2019-06-12 11:41:14 -0400 | [diff] [blame] | 39 | alignas(16) float v[MAX_INTERFACE_COMPONENTS]; |
Nicolas Capens | 68a8238 | 2018-10-02 13:16:55 -0400 | [diff] [blame] | 40 | }); |
| 41 | |
| 42 | static_assert((sizeof(Vertex) & 0x0000000F) == 0, "Vertex size not a multiple of 16 bytes (alignment requirement)"); |
| 43 | } |
| 44 | |
| 45 | #endif // Vertex_hpp |