diff options
author | Nanley Chery <[email protected]> | 2016-11-02 16:18:44 -0700 |
---|---|---|
committer | Nanley Chery <[email protected]> | 2016-11-03 11:22:58 -0700 |
commit | 1625d911d7368a9a96411012c69512074a3ff506 (patch) | |
tree | 60e0d82df5870145bbe9b92ba59e04689b0eb493 /src | |
parent | bb550e297774bd1fdd274a98738e6353d1cda73e (diff) |
anv/blorp: Don't create linear ASTC surfaces for buffers
Such a surface is not possible on our hardware. Without this change, ISL
surface creation would fail with the next patch.
Signed-off-by: Nanley Chery <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/intel/vulkan/anv_blorp.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c index 87f242cb258..0feb5d5567a 100644 --- a/src/intel/vulkan/anv_blorp.c +++ b/src/intel/vulkan/anv_blorp.c @@ -126,6 +126,22 @@ get_blorp_surf_for_anv_buffer(struct anv_device *device, struct blorp_surf *blorp_surf, struct isl_surf *isl_surf) { + const struct isl_format_layout *fmtl = + isl_format_get_layout(format); + + /* ASTC is the only format which doesn't support linear layouts. + * Create an equivalently sized surface with ISL to get around this. + */ + if (fmtl->txc == ISL_TXC_ASTC) { + /* Use an equivalently sized format */ + format = ISL_FORMAT_R32G32B32A32_UINT; + assert(fmtl->bpb == isl_format_get_layout(format)->bpb); + + /* Shrink the dimensions for the new format */ + width = DIV_ROUND_UP(width, fmtl->bw); + height = DIV_ROUND_UP(height, fmtl->bh); + } + *blorp_surf = (struct blorp_surf) { .surf = isl_surf, .addr = { |