isl: Add support for quering the string name of a format
This commit is contained in:
@@ -628,6 +628,7 @@ struct isl_channel_layout {
|
|||||||
*/
|
*/
|
||||||
struct isl_format_layout {
|
struct isl_format_layout {
|
||||||
enum isl_format format;
|
enum isl_format format;
|
||||||
|
const char *name;
|
||||||
|
|
||||||
uint8_t bs; /**< Block size, in bytes, rounded towards 0 */
|
uint8_t bs; /**< Block size, in bytes, rounded towards 0 */
|
||||||
uint8_t bw; /**< Block width, in pixels */
|
uint8_t bw; /**< Block width, in pixels */
|
||||||
@@ -855,6 +856,12 @@ isl_format_get_layout(enum isl_format fmt)
|
|||||||
return &isl_format_layouts[fmt];
|
return &isl_format_layouts[fmt];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline const char * ATTRIBUTE_CONST
|
||||||
|
isl_format_get_name(enum isl_format fmt)
|
||||||
|
{
|
||||||
|
return isl_format_layouts[fmt].name;
|
||||||
|
}
|
||||||
|
|
||||||
bool isl_format_has_unorm_channel(enum isl_format fmt) ATTRIBUTE_CONST;
|
bool isl_format_has_unorm_channel(enum isl_format fmt) ATTRIBUTE_CONST;
|
||||||
bool isl_format_has_snorm_channel(enum isl_format fmt) ATTRIBUTE_CONST;
|
bool isl_format_has_snorm_channel(enum isl_format fmt) ATTRIBUTE_CONST;
|
||||||
bool isl_format_has_ufloat_channel(enum isl_format fmt) ATTRIBUTE_CONST;
|
bool isl_format_has_ufloat_channel(enum isl_format fmt) ATTRIBUTE_CONST;
|
||||||
|
@@ -98,7 +98,8 @@ do
|
|||||||
|
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
[$format] = {
|
[$format] = {
|
||||||
$format,
|
.format = $format,
|
||||||
|
.name = "$format",
|
||||||
.bs = $((bpb/8)),
|
.bs = $((bpb/8)),
|
||||||
.bw = $bw, .bh = $bh, .bd = $bd,
|
.bw = $bw, .bh = $bh, .bd = $bd,
|
||||||
.channels = {
|
.channels = {
|
||||||
|
Reference in New Issue
Block a user