mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-10 13:48:40 +00:00
video_core: Add depth buffer support and fix some bugs (#172)
* memory: Avoid crash when alignment is zero * Also remove unused file * shader_recompiler: Add more instructions * Also fix some minor issues with a few existing instructions * control_flow: Don't emit discard for null exports * renderer_vulkan: Add depth buffer support * liverpool: Fix wrong color buffer number type and viewport zscale * Also add some more formats
This commit is contained in:
@@ -148,10 +148,20 @@ struct Image {
|
||||
}
|
||||
|
||||
u32 NumLayers() const {
|
||||
return last_array - base_array + 1;
|
||||
u32 slices = type == ImageType::Color3D ? 1 : depth.Value() + 1;
|
||||
if (type == ImageType::Cube) {
|
||||
slices *= 6;
|
||||
}
|
||||
if (pow2pad) {
|
||||
slices = std::bit_ceil(slices);
|
||||
}
|
||||
return slices;
|
||||
}
|
||||
|
||||
u32 NumLevels() const {
|
||||
if (type == ImageType::Color2DMsaa || type == ImageType::Color2DMsaaArray) {
|
||||
return 1;
|
||||
}
|
||||
return last_level + 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user