vk_texture_runtime: Add explicit "sub-image" index to View accessors
This needs a new pattern, the current one introduces lots of bugs when we're trying to access the MSAA image.
This commit is contained in:
parent
8356700ef7
commit
64a116b254
2 changed files with 12 additions and 12 deletions
|
@ -1278,18 +1278,18 @@ vk::ImageView Surface::ImageView(u32 index) const noexcept {
|
||||||
return image_view;
|
return image_view;
|
||||||
}
|
}
|
||||||
|
|
||||||
vk::ImageView Surface::FramebufferView() noexcept {
|
vk::ImageView Surface::FramebufferView(u32 index) noexcept {
|
||||||
is_framebuffer = true;
|
is_framebuffer = true;
|
||||||
return ImageView();
|
return ImageView(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
vk::ImageView Surface::DepthView() noexcept {
|
vk::ImageView Surface::DepthView(u32 index) noexcept {
|
||||||
if (depth_view) {
|
if (depth_view) {
|
||||||
return depth_view.get();
|
return depth_view.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
const vk::ImageViewCreateInfo view_info = {
|
const vk::ImageViewCreateInfo view_info = {
|
||||||
.image = Image(),
|
.image = Image(index),
|
||||||
.viewType = vk::ImageViewType::e2D,
|
.viewType = vk::ImageViewType::e2D,
|
||||||
.format = instance->GetTraits(pixel_format).native,
|
.format = instance->GetTraits(pixel_format).native,
|
||||||
.subresourceRange{
|
.subresourceRange{
|
||||||
|
@ -1305,13 +1305,13 @@ vk::ImageView Surface::DepthView() noexcept {
|
||||||
return depth_view.get();
|
return depth_view.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
vk::ImageView Surface::StencilView() noexcept {
|
vk::ImageView Surface::StencilView(u32 index) noexcept {
|
||||||
if (stencil_view) {
|
if (stencil_view) {
|
||||||
return stencil_view.get();
|
return stencil_view.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
const vk::ImageViewCreateInfo view_info = {
|
const vk::ImageViewCreateInfo view_info = {
|
||||||
.image = Image(),
|
.image = Image(index),
|
||||||
.viewType = vk::ImageViewType::e2D,
|
.viewType = vk::ImageViewType::e2D,
|
||||||
.format = instance->GetTraits(pixel_format).native,
|
.format = instance->GetTraits(pixel_format).native,
|
||||||
.subresourceRange{
|
.subresourceRange{
|
||||||
|
@ -1327,7 +1327,7 @@ vk::ImageView Surface::StencilView() noexcept {
|
||||||
return stencil_view.get();
|
return stencil_view.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
vk::ImageView Surface::StorageView() noexcept {
|
vk::ImageView Surface::StorageView(u32 index) noexcept {
|
||||||
if (storage_view) {
|
if (storage_view) {
|
||||||
return storage_view.get();
|
return storage_view.get();
|
||||||
}
|
}
|
||||||
|
@ -1336,7 +1336,7 @@ vk::ImageView Surface::StorageView() noexcept {
|
||||||
LOG_WARNING(Render_Vulkan,
|
LOG_WARNING(Render_Vulkan,
|
||||||
"Attempted to retrieve storage view from unsupported surface with format {}",
|
"Attempted to retrieve storage view from unsupported surface with format {}",
|
||||||
VideoCore::PixelFormatAsString(pixel_format));
|
VideoCore::PixelFormatAsString(pixel_format));
|
||||||
return ImageView();
|
return ImageView(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
is_storage = true;
|
is_storage = true;
|
||||||
|
|
|
@ -132,16 +132,16 @@ public:
|
||||||
vk::ImageView CopyImageView() noexcept;
|
vk::ImageView CopyImageView() noexcept;
|
||||||
|
|
||||||
/// Returns the framebuffer view of the surface image
|
/// Returns the framebuffer view of the surface image
|
||||||
vk::ImageView FramebufferView() noexcept;
|
vk::ImageView FramebufferView(u32 index = 1) noexcept;
|
||||||
|
|
||||||
/// Returns the depth view of the surface image
|
/// Returns the depth view of the surface image
|
||||||
vk::ImageView DepthView() noexcept;
|
vk::ImageView DepthView(u32 index = 1) noexcept;
|
||||||
|
|
||||||
/// Returns the stencil view of the surface image
|
/// Returns the stencil view of the surface image
|
||||||
vk::ImageView StencilView() noexcept;
|
vk::ImageView StencilView(u32 index = 1) noexcept;
|
||||||
|
|
||||||
/// Returns the R32 image view used for atomic load/store
|
/// Returns the R32 image view used for atomic load/store
|
||||||
vk::ImageView StorageView() noexcept;
|
vk::ImageView StorageView(u32 index = 1) noexcept;
|
||||||
|
|
||||||
/// Returns a framebuffer handle for rendering to this surface
|
/// Returns a framebuffer handle for rendering to this surface
|
||||||
vk::Framebuffer Framebuffer() noexcept;
|
vk::Framebuffer Framebuffer() noexcept;
|
||||||
|
|
Loading…
Reference in a new issue