| 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 |
enum agx_robustness_level { |
| 21 |
/* No robustness */ |
| 22 |
AGX_ROBUSTNESS_DISABLED, |
| 23 |
|
| 24 |
/* Invalid load/store must not fault, but undefined value/effect */ |
| 25 |
AGX_ROBUSTNESS_GLES, |
| 26 |
|
| 27 |
/* Invalid load/store access something from the array (or 0) */ |
| 28 |
AGX_ROBUSTNESS_GL, |
| 29 |
|
| 30 |
/* Invalid loads return 0 and invalid stores are dropped */ |
| 31 |
AGX_ROBUSTNESS_D3D, |
| 32 |
}; |
| 33 |
|
| 34 |
struct agx_robustness { |
| 35 |
enum agx_robustness_level level; |
| 36 |
|
| 37 |
/* Whether hardware "soft fault" is enabled. */ |
| 38 |
bool soft_fault; |
| 39 |
}; |
| 40 |
|
| 41 |
struct agx_velem_key; |
| 42 |
|
| 43 |
bool agx_nir_lower_vbo(nir_shader *shader, const struct agx_velem_key *attribs, |
| 44 |
struct agx_robustness rs, bool dynamic_strides); |
| 45 |
|
| 46 |
enum pipe_format agx_vbo_internal_format(enum pipe_format format); |
| 47 |
|
| 48 |
bool agx_vbo_supports_format(enum pipe_format format); |
| 49 |
|
| 50 |
#ifdef __cplusplus |
| 51 |
} /* extern C */ |
| 52 |
#endif |