Path: blob/21.2-virgl/src/broadcom/vulkan/v3dv_limits.h
4560 views
/*1* Copyright © 2020 Raspberry Pi2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice (including the next11* paragraph) shall be included in all copies or substantial portions of the12* Software.13*14* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR15* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,16* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL17* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER18* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING19* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS20* IN THE SOFTWARE.21*/22#ifndef V3DV_LIMITS_H23#define V3DV_LIMITS_H2425#define NSEC_PER_SEC 1000000000ull2627/* From vulkan spec "If the multiple viewports feature is not enabled,28* scissorCount must be 1", ditto for viewportCount. For now we don't support29* that feature.30*/31#define MAX_VIEWPORTS 132#define MAX_SCISSORS 13334#define MAX_VBS 1635#define MAX_VERTEX_ATTRIBS 163637#define MAX_SETS 163839#define MAX_PUSH_CONSTANTS_SIZE 1284041#define MAX_SAMPLED_IMAGES 1642#define MAX_STORAGE_IMAGES 443#define MAX_INPUT_ATTACHMENTS 44445#define MAX_UNIFORM_BUFFERS 1246#define MAX_STORAGE_BUFFERS 84748#define MAX_DYNAMIC_UNIFORM_BUFFERS 849#define MAX_DYNAMIC_STORAGE_BUFFERS 450#define MAX_DYNAMIC_BUFFERS (MAX_DYNAMIC_UNIFORM_BUFFERS + \51MAX_DYNAMIC_STORAGE_BUFFERS)5253#define MAX_RENDER_TARGETS 45455/* These are tunable parameters in the HW design, but all the V3D56* implementations agree.57*/58#define V3D_UIFCFG_BANKS 859#define V3D_UIFCFG_PAGE_SIZE 409660#define V3D_UIFCFG_XOR_VALUE (1 << 4)61#define V3D_PAGE_CACHE_SIZE (V3D_UIFCFG_PAGE_SIZE * V3D_UIFCFG_BANKS)62#define V3D_UBLOCK_SIZE 6463#define V3D_UIFBLOCK_SIZE (4 * V3D_UBLOCK_SIZE)64#define V3D_UIFBLOCK_ROW_SIZE (4 * V3D_UIFBLOCK_SIZE)6566#define PAGE_UB_ROWS (V3D_UIFCFG_PAGE_SIZE / V3D_UIFBLOCK_ROW_SIZE)67#define PAGE_UB_ROWS_TIMES_1_5 ((PAGE_UB_ROWS * 3) >> 1)68#define PAGE_CACHE_UB_ROWS (V3D_PAGE_CACHE_SIZE / V3D_UIFBLOCK_ROW_SIZE)69#define PAGE_CACHE_MINUS_1_5_UB_ROWS (PAGE_CACHE_UB_ROWS - PAGE_UB_ROWS_TIMES_1_5)7071#endif /* V3DV_LIMITS_H */727374