mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 13:10:10 +01:00
isl: Add more assertions to isl_surf_get_depth_format()
R16_UNORM and R32_FLOAT are illegal formats for interleaved depthstencil surfaces.
This commit is contained in:
parent
1d65abfa58
commit
bdab29a312
1 changed files with 6 additions and 2 deletions
|
|
@ -1397,9 +1397,11 @@ isl_surf_get_depth_format(const struct isl_device *dev,
|
|||
* Format (p321).
|
||||
*/
|
||||
|
||||
bool has_stencil = surf->usage & ISL_SURF_USAGE_STENCIL_BIT;
|
||||
|
||||
assert(surf->usage & ISL_SURF_USAGE_DEPTH_BIT);
|
||||
|
||||
if (surf->usage & ISL_SURF_USAGE_STENCIL_BIT)
|
||||
if (has_stencil)
|
||||
assert(ISL_DEV_GEN(dev) < 7);
|
||||
|
||||
switch (surf->format) {
|
||||
|
|
@ -1409,9 +1411,10 @@ isl_surf_get_depth_format(const struct isl_device *dev,
|
|||
assert(ISL_DEV_GEN(dev) < 7);
|
||||
return 0; /* D32_FLOAT_S8X24_UINT */
|
||||
case ISL_FORMAT_R32_FLOAT:
|
||||
assert(!has_stencil);
|
||||
return 1; /* D32_FLOAT */
|
||||
case ISL_FORMAT_R24_UNORM_X8_TYPELESS:
|
||||
if (surf->usage & ISL_SURF_USAGE_STENCIL_BIT) {
|
||||
if (has_stencil) {
|
||||
assert(ISL_DEV_GEN(dev) < 7);
|
||||
return 2; /* D24_UNORM_S8_UINT */
|
||||
} else {
|
||||
|
|
@ -1419,6 +1422,7 @@ isl_surf_get_depth_format(const struct isl_device *dev,
|
|||
return 3; /* D24_UNORM_X8_UINT */
|
||||
}
|
||||
case ISL_FORMAT_R16_UNORM:
|
||||
assert(!has_stencil);
|
||||
return 5; /* D16_UNORM */
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue