1bf215546Sopenharmony_ci/* 2bf215546Sopenharmony_ci * Copyright © 2019 Advanced Micro Devices, Inc. 3bf215546Sopenharmony_ci * All Rights Reserved. 4bf215546Sopenharmony_ci * 5bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining 6bf215546Sopenharmony_ci * a copy of this software and associated documentation files (the 7bf215546Sopenharmony_ci * "Software"), to deal in the Software without restriction, including 8bf215546Sopenharmony_ci * without limitation the rights to use, copy, modify, merge, publish, 9bf215546Sopenharmony_ci * distribute, sub license, and/or sell copies of the Software, and to 10bf215546Sopenharmony_ci * permit persons to whom the Software is furnished to do so, subject to 11bf215546Sopenharmony_ci * the following conditions: 12bf215546Sopenharmony_ci * 13bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 14bf215546Sopenharmony_ci * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 15bf215546Sopenharmony_ci * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 16bf215546Sopenharmony_ci * NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS 17bf215546Sopenharmony_ci * AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18bf215546Sopenharmony_ci * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19bf215546Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 20bf215546Sopenharmony_ci * USE OR OTHER DEALINGS IN THE SOFTWARE. 21bf215546Sopenharmony_ci * 22bf215546Sopenharmony_ci * The above copyright notice and this permission notice (including the 23bf215546Sopenharmony_ci * next paragraph) shall be included in all copies or substantial portions 24bf215546Sopenharmony_ci * of the Software. 25bf215546Sopenharmony_ci */ 26bf215546Sopenharmony_ci 27bf215546Sopenharmony_ci#ifndef GFX10_FORMAT_TABLE_H 28bf215546Sopenharmony_ci#define GFX10_FORMAT_TABLE_H 29bf215546Sopenharmony_ci 30bf215546Sopenharmony_ci#include "pipe/p_format.h" 31bf215546Sopenharmony_ci#include "ac_gpu_info.h" 32bf215546Sopenharmony_ci 33bf215546Sopenharmony_ci#include <stdbool.h> 34bf215546Sopenharmony_ci 35bf215546Sopenharmony_cistruct gfx10_format { 36bf215546Sopenharmony_ci unsigned img_format : 9; 37bf215546Sopenharmony_ci 38bf215546Sopenharmony_ci /* Various formats are only supported with workarounds for vertex fetch, 39bf215546Sopenharmony_ci * and some 32_32_32 formats are supported natively, but only for buffers 40bf215546Sopenharmony_ci * (possibly with some image support, actually, but no filtering). */ 41bf215546Sopenharmony_ci bool buffers_only : 1; 42bf215546Sopenharmony_ci}; 43bf215546Sopenharmony_ci 44bf215546Sopenharmony_ciextern const struct gfx10_format gfx10_format_table[PIPE_FORMAT_COUNT]; 45bf215546Sopenharmony_ciextern const struct gfx10_format gfx11_format_table[PIPE_FORMAT_COUNT]; 46bf215546Sopenharmony_ci 47bf215546Sopenharmony_cistatic inline 48bf215546Sopenharmony_ciconst struct gfx10_format* ac_get_gfx10_format_table(struct radeon_info *info) 49bf215546Sopenharmony_ci{ 50bf215546Sopenharmony_ci if (info->gfx_level >= GFX11) 51bf215546Sopenharmony_ci return gfx11_format_table; 52bf215546Sopenharmony_ci else 53bf215546Sopenharmony_ci return gfx10_format_table; 54bf215546Sopenharmony_ci} 55bf215546Sopenharmony_ci 56bf215546Sopenharmony_ci#endif /* GFX10_FORMAT_TABLE_H */ 57