blob: 7725aefc0da84eed44fa972e7ee547c76f1aab81 [file] [log] [blame]
Nicolas Capens68a82382018-10-02 13:16:55 -04001// 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 Capens1d8c8db2018-11-05 16:30:42 -050019#include "System/Types.hpp"
20#include "Device/Config.hpp"
Nicolas Capens68a82382018-10-02 13:16:55 -040021
22namespace sw
23{
Nicolas Capens68a82382018-10-02 13:16:55 -040024 ALIGN(16, struct Vertex
25 {
Nicolas Capens8bcd1742019-06-12 11:41:14 -040026 float4 position;
27 float pointSize;
Chris Forbes26f1a862019-02-02 15:23:01 -080028
Nicolas Capens8bcd1742019-06-12 11:41:14 -040029 int clipFlags;
30
31 alignas(16) struct
Chris Forbes26f1a862019-02-02 15:23:01 -080032 {
33 int x;
34 int y;
35 float z;
36 float w;
37 } projected;
Nicolas Capens68a82382018-10-02 13:16:55 -040038
Nicolas Capens8bcd1742019-06-12 11:41:14 -040039 alignas(16) float v[MAX_INTERFACE_COMPONENTS];
Nicolas Capens68a82382018-10-02 13:16:55 -040040 });
41
42 static_assert((sizeof(Vertex) & 0x0000000F) == 0, "Vertex size not a multiple of 16 bytes (alignment requirement)");
43}
44
45#endif // Vertex_hpp