• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2022 Alyssa Rosenzweig
3  * SPDX-License-Identifier: MIT
4  */
5 
6 #pragma once
7 
8 #include <stdbool.h>
9 #include <stdint.h>
10 #include "util/format/u_formats.h"
11 #include "nir.h"
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 #define AGX_MAX_ATTRIBS (16)
18 #define AGX_MAX_VBUFS   (16)
19 
20 /* See pipe_vertex_element for justification on the sizes. This structure should
21  * be small so it can be embedded into a shader key.
22  */
23 struct agx_attribute {
24    uint32_t divisor;
25    uint32_t stride;
26    uint16_t src_offset;
27    uint8_t buf;
28 
29    /* pipe_format, all vertex formats should be <= 255 */
30    uint8_t format;
31 };
32 
33 bool agx_nir_lower_vbo(nir_shader *shader, struct agx_attribute *attribs);
34 bool agx_vbo_supports_format(enum pipe_format format);
35 
36 #ifdef __cplusplus
37 } /* extern C */
38 #endif
39