early-access version 2889
This commit is contained in:
parent
4d812d4e3b
commit
5105aef684
7 changed files with 205 additions and 273 deletions
|
@ -1,7 +1,7 @@
|
|||
yuzu emulator early access
|
||||
=============
|
||||
|
||||
This is the source code for early-access 2888.
|
||||
This is the source code for early-access 2889.
|
||||
|
||||
## Legal Notice
|
||||
|
||||
|
|
|
@ -737,8 +737,7 @@ Image::Image(TextureCacheRuntime& runtime_, const VideoCommon::ImageInfo& info_,
|
|||
}
|
||||
}
|
||||
|
||||
Image::Image(TextureCacheRuntime&, const VideoCommon::NullImageParams& params)
|
||||
: VideoCommon::ImageBase{params} {}
|
||||
Image::Image(const VideoCommon::NullImageParams& params) : VideoCommon::ImageBase{params} {}
|
||||
|
||||
Image::~Image() = default;
|
||||
|
||||
|
@ -1079,7 +1078,7 @@ bool Image::ScaleDown(bool ignore) {
|
|||
}
|
||||
|
||||
ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageViewInfo& info,
|
||||
ImageId image_id_, Image& image)
|
||||
ImageId image_id_, Image& image, const SlotVector<Image>&)
|
||||
: VideoCommon::ImageViewBase{info, image.info, image_id_}, views{runtime.null_image_views} {
|
||||
const Device& device = runtime.device;
|
||||
if (True(image.flags & ImageFlagBits::Converted)) {
|
||||
|
|
|
@ -189,7 +189,7 @@ class Image : public VideoCommon::ImageBase {
|
|||
public:
|
||||
explicit Image(TextureCacheRuntime&, const VideoCommon::ImageInfo& info, GPUVAddr gpu_addr,
|
||||
VAddr cpu_addr);
|
||||
explicit Image(TextureCacheRuntime&, const VideoCommon::NullImageParams&);
|
||||
explicit Image(const VideoCommon::NullImageParams&);
|
||||
|
||||
~Image();
|
||||
|
||||
|
@ -244,7 +244,8 @@ class ImageView : public VideoCommon::ImageViewBase {
|
|||
friend Image;
|
||||
|
||||
public:
|
||||
explicit ImageView(TextureCacheRuntime&, const VideoCommon::ImageViewInfo&, ImageId, Image&);
|
||||
explicit ImageView(TextureCacheRuntime&, const VideoCommon::ImageViewInfo&, ImageId, Image&,
|
||||
const SlotVector<Image>&);
|
||||
explicit ImageView(TextureCacheRuntime&, const VideoCommon::ImageInfo&,
|
||||
const VideoCommon::ImageViewInfo&, GPUVAddr);
|
||||
explicit ImageView(TextureCacheRuntime&, const VideoCommon::ImageInfo& info,
|
||||
|
|
|
@ -319,265 +319,195 @@ VkPrimitiveTopology PrimitiveTopology([[maybe_unused]] const Device& device,
|
|||
|
||||
VkFormat VertexFormat(const Device& device, Maxwell::VertexAttribute::Type type,
|
||||
Maxwell::VertexAttribute::Size size) {
|
||||
auto format = VK_FORMAT_UNDEFINED;
|
||||
|
||||
switch (type) {
|
||||
case Maxwell::VertexAttribute::Type::UnsignedNorm:
|
||||
switch (size) {
|
||||
case Maxwell::VertexAttribute::Size::Size_8:
|
||||
format = VK_FORMAT_R8_UNORM;
|
||||
const VkFormat format{([&]() {
|
||||
switch (type) {
|
||||
case Maxwell::VertexAttribute::Type::UnsignedNorm:
|
||||
switch (size) {
|
||||
case Maxwell::VertexAttribute::Size::Size_8:
|
||||
return VK_FORMAT_R8_UNORM;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8:
|
||||
return VK_FORMAT_R8G8_UNORM;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8_8:
|
||||
return VK_FORMAT_R8G8B8_UNORM;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8_8_8:
|
||||
return VK_FORMAT_R8G8B8A8_UNORM;
|
||||
case Maxwell::VertexAttribute::Size::Size_16:
|
||||
return VK_FORMAT_R16_UNORM;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16:
|
||||
return VK_FORMAT_R16G16_UNORM;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16:
|
||||
return VK_FORMAT_R16G16B16_UNORM;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16_16:
|
||||
return VK_FORMAT_R16G16B16A16_UNORM;
|
||||
case Maxwell::VertexAttribute::Size::Size_10_10_10_2:
|
||||
return VK_FORMAT_A2B10G10R10_UNORM_PACK32;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8:
|
||||
format = VK_FORMAT_R8G8_UNORM;
|
||||
case Maxwell::VertexAttribute::Type::SignedNorm:
|
||||
switch (size) {
|
||||
case Maxwell::VertexAttribute::Size::Size_8:
|
||||
return VK_FORMAT_R8_SNORM;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8:
|
||||
return VK_FORMAT_R8G8_SNORM;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8_8:
|
||||
return VK_FORMAT_R8G8B8_SNORM;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8_8_8:
|
||||
return VK_FORMAT_R8G8B8A8_SNORM;
|
||||
case Maxwell::VertexAttribute::Size::Size_16:
|
||||
return VK_FORMAT_R16_SNORM;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16:
|
||||
return VK_FORMAT_R16G16_SNORM;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16:
|
||||
return VK_FORMAT_R16G16B16_SNORM;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16_16:
|
||||
return VK_FORMAT_R16G16B16A16_SNORM;
|
||||
case Maxwell::VertexAttribute::Size::Size_10_10_10_2:
|
||||
return VK_FORMAT_A2B10G10R10_SNORM_PACK32;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8_8:
|
||||
format = VK_FORMAT_R8G8B8_UNORM;
|
||||
case Maxwell::VertexAttribute::Type::UnsignedScaled:
|
||||
switch (size) {
|
||||
case Maxwell::VertexAttribute::Size::Size_8:
|
||||
return VK_FORMAT_R8_USCALED;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8:
|
||||
return VK_FORMAT_R8G8_USCALED;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8_8:
|
||||
return VK_FORMAT_R8G8B8_USCALED;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8_8_8:
|
||||
return VK_FORMAT_R8G8B8A8_USCALED;
|
||||
case Maxwell::VertexAttribute::Size::Size_16:
|
||||
return VK_FORMAT_R16_USCALED;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16:
|
||||
return VK_FORMAT_R16G16_USCALED;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16:
|
||||
return VK_FORMAT_R16G16B16_USCALED;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16_16:
|
||||
return VK_FORMAT_R16G16B16A16_USCALED;
|
||||
case Maxwell::VertexAttribute::Size::Size_10_10_10_2:
|
||||
return VK_FORMAT_A2B10G10R10_USCALED_PACK32;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8_8_8:
|
||||
format = VK_FORMAT_R8G8B8A8_UNORM;
|
||||
case Maxwell::VertexAttribute::Type::SignedScaled:
|
||||
switch (size) {
|
||||
case Maxwell::VertexAttribute::Size::Size_8:
|
||||
return VK_FORMAT_R8_SSCALED;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8:
|
||||
return VK_FORMAT_R8G8_SSCALED;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8_8:
|
||||
return VK_FORMAT_R8G8B8_SSCALED;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8_8_8:
|
||||
return VK_FORMAT_R8G8B8A8_SSCALED;
|
||||
case Maxwell::VertexAttribute::Size::Size_16:
|
||||
return VK_FORMAT_R16_SSCALED;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16:
|
||||
return VK_FORMAT_R16G16_SSCALED;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16:
|
||||
return VK_FORMAT_R16G16B16_SSCALED;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16_16:
|
||||
return VK_FORMAT_R16G16B16A16_SSCALED;
|
||||
case Maxwell::VertexAttribute::Size::Size_10_10_10_2:
|
||||
return VK_FORMAT_A2B10G10R10_SSCALED_PACK32;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_16:
|
||||
format = VK_FORMAT_R16_UNORM;
|
||||
case Maxwell::VertexAttribute::Type::UnsignedInt:
|
||||
switch (size) {
|
||||
case Maxwell::VertexAttribute::Size::Size_8:
|
||||
return VK_FORMAT_R8_UINT;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8:
|
||||
return VK_FORMAT_R8G8_UINT;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8_8:
|
||||
return VK_FORMAT_R8G8B8_UINT;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8_8_8:
|
||||
return VK_FORMAT_R8G8B8A8_UINT;
|
||||
case Maxwell::VertexAttribute::Size::Size_16:
|
||||
return VK_FORMAT_R16_UINT;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16:
|
||||
return VK_FORMAT_R16G16_UINT;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16:
|
||||
return VK_FORMAT_R16G16B16_UINT;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16_16:
|
||||
return VK_FORMAT_R16G16B16A16_UINT;
|
||||
case Maxwell::VertexAttribute::Size::Size_32:
|
||||
return VK_FORMAT_R32_UINT;
|
||||
case Maxwell::VertexAttribute::Size::Size_32_32:
|
||||
return VK_FORMAT_R32G32_UINT;
|
||||
case Maxwell::VertexAttribute::Size::Size_32_32_32:
|
||||
return VK_FORMAT_R32G32B32_UINT;
|
||||
case Maxwell::VertexAttribute::Size::Size_32_32_32_32:
|
||||
return VK_FORMAT_R32G32B32A32_UINT;
|
||||
case Maxwell::VertexAttribute::Size::Size_10_10_10_2:
|
||||
return VK_FORMAT_A2B10G10R10_UINT_PACK32;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16:
|
||||
format = VK_FORMAT_R16G16_UNORM;
|
||||
case Maxwell::VertexAttribute::Type::SignedInt:
|
||||
switch (size) {
|
||||
case Maxwell::VertexAttribute::Size::Size_8:
|
||||
return VK_FORMAT_R8_SINT;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8:
|
||||
return VK_FORMAT_R8G8_SINT;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8_8:
|
||||
return VK_FORMAT_R8G8B8_SINT;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8_8_8:
|
||||
return VK_FORMAT_R8G8B8A8_SINT;
|
||||
case Maxwell::VertexAttribute::Size::Size_16:
|
||||
return VK_FORMAT_R16_SINT;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16:
|
||||
return VK_FORMAT_R16G16_SINT;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16:
|
||||
return VK_FORMAT_R16G16B16_SINT;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16_16:
|
||||
return VK_FORMAT_R16G16B16A16_SINT;
|
||||
case Maxwell::VertexAttribute::Size::Size_32:
|
||||
return VK_FORMAT_R32_SINT;
|
||||
case Maxwell::VertexAttribute::Size::Size_32_32:
|
||||
return VK_FORMAT_R32G32_SINT;
|
||||
case Maxwell::VertexAttribute::Size::Size_32_32_32:
|
||||
return VK_FORMAT_R32G32B32_SINT;
|
||||
case Maxwell::VertexAttribute::Size::Size_32_32_32_32:
|
||||
return VK_FORMAT_R32G32B32A32_SINT;
|
||||
case Maxwell::VertexAttribute::Size::Size_10_10_10_2:
|
||||
return VK_FORMAT_A2B10G10R10_SINT_PACK32;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16:
|
||||
format = VK_FORMAT_R16G16B16_UNORM;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16_16:
|
||||
format = VK_FORMAT_R16G16B16A16_UNORM;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_10_10_10_2:
|
||||
format = VK_FORMAT_A2B10G10R10_UNORM_PACK32;
|
||||
break;
|
||||
default:
|
||||
case Maxwell::VertexAttribute::Type::Float:
|
||||
switch (size) {
|
||||
case Maxwell::VertexAttribute::Size::Size_16:
|
||||
return VK_FORMAT_R16_SFLOAT;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16:
|
||||
return VK_FORMAT_R16G16_SFLOAT;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16:
|
||||
return VK_FORMAT_R16G16B16_SFLOAT;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16_16:
|
||||
return VK_FORMAT_R16G16B16A16_SFLOAT;
|
||||
case Maxwell::VertexAttribute::Size::Size_32:
|
||||
return VK_FORMAT_R32_SFLOAT;
|
||||
case Maxwell::VertexAttribute::Size::Size_32_32:
|
||||
return VK_FORMAT_R32G32_SFLOAT;
|
||||
case Maxwell::VertexAttribute::Size::Size_32_32_32:
|
||||
return VK_FORMAT_R32G32B32_SFLOAT;
|
||||
case Maxwell::VertexAttribute::Size::Size_32_32_32_32:
|
||||
return VK_FORMAT_R32G32B32A32_SFLOAT;
|
||||
case Maxwell::VertexAttribute::Size::Size_11_11_10:
|
||||
return VK_FORMAT_B10G11R11_UFLOAT_PACK32;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Type::SignedNorm:
|
||||
switch (size) {
|
||||
case Maxwell::VertexAttribute::Size::Size_8:
|
||||
format = VK_FORMAT_R8_SNORM;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8:
|
||||
format = VK_FORMAT_R8G8_SNORM;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8_8:
|
||||
format = VK_FORMAT_R8G8B8_SNORM;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8_8_8:
|
||||
format = VK_FORMAT_R8G8B8A8_SNORM;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_16:
|
||||
format = VK_FORMAT_R16_SNORM;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16:
|
||||
format = VK_FORMAT_R16G16_SNORM;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16:
|
||||
format = VK_FORMAT_R16G16B16_SNORM;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16_16:
|
||||
format = VK_FORMAT_R16G16B16A16_SNORM;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_10_10_10_2:
|
||||
format = VK_FORMAT_A2B10G10R10_SNORM_PACK32;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Type::UnsignedScaled:
|
||||
switch (size) {
|
||||
case Maxwell::VertexAttribute::Size::Size_8:
|
||||
format = VK_FORMAT_R8_USCALED;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8:
|
||||
format = VK_FORMAT_R8G8_USCALED;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8_8:
|
||||
format = VK_FORMAT_R8G8B8_USCALED;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8_8_8:
|
||||
format = VK_FORMAT_R8G8B8A8_USCALED;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_16:
|
||||
format = VK_FORMAT_R16_USCALED;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16:
|
||||
format = VK_FORMAT_R16G16_USCALED;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16:
|
||||
format = VK_FORMAT_R16G16B16_USCALED;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16_16:
|
||||
format = VK_FORMAT_R16G16B16A16_USCALED;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_10_10_10_2:
|
||||
format = VK_FORMAT_A2B10G10R10_USCALED_PACK32;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Type::SignedScaled:
|
||||
switch (size) {
|
||||
case Maxwell::VertexAttribute::Size::Size_8:
|
||||
format = VK_FORMAT_R8_SSCALED;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8:
|
||||
format = VK_FORMAT_R8G8_SSCALED;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8_8:
|
||||
format = VK_FORMAT_R8G8B8_SSCALED;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8_8_8:
|
||||
format = VK_FORMAT_R8G8B8A8_SSCALED;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_16:
|
||||
format = VK_FORMAT_R16_SSCALED;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16:
|
||||
format = VK_FORMAT_R16G16_SSCALED;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16:
|
||||
format = VK_FORMAT_R16G16B16_SSCALED;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16_16:
|
||||
format = VK_FORMAT_R16G16B16A16_SSCALED;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_10_10_10_2:
|
||||
format = VK_FORMAT_A2B10G10R10_SSCALED_PACK32;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Type::UnsignedInt:
|
||||
switch (size) {
|
||||
case Maxwell::VertexAttribute::Size::Size_8:
|
||||
format = VK_FORMAT_R8_UINT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8:
|
||||
format = VK_FORMAT_R8G8_UINT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8_8:
|
||||
format = VK_FORMAT_R8G8B8_UINT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8_8_8:
|
||||
format = VK_FORMAT_R8G8B8A8_UINT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_16:
|
||||
format = VK_FORMAT_R16_UINT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16:
|
||||
format = VK_FORMAT_R16G16_UINT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16:
|
||||
format = VK_FORMAT_R16G16B16_UINT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16_16:
|
||||
format = VK_FORMAT_R16G16B16A16_UINT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_32:
|
||||
format = VK_FORMAT_R32_UINT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_32_32:
|
||||
format = VK_FORMAT_R32G32_UINT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_32_32_32:
|
||||
format = VK_FORMAT_R32G32B32_UINT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_32_32_32_32:
|
||||
format = VK_FORMAT_R32G32B32A32_UINT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_10_10_10_2:
|
||||
format = VK_FORMAT_A2B10G10R10_UINT_PACK32;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Type::SignedInt:
|
||||
switch (size) {
|
||||
case Maxwell::VertexAttribute::Size::Size_8:
|
||||
format = VK_FORMAT_R8_SINT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8:
|
||||
format = VK_FORMAT_R8G8_SINT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8_8:
|
||||
format = VK_FORMAT_R8G8B8_SINT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_8_8_8_8:
|
||||
format = VK_FORMAT_R8G8B8A8_SINT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_16:
|
||||
format = VK_FORMAT_R16_SINT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16:
|
||||
format = VK_FORMAT_R16G16_SINT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16:
|
||||
format = VK_FORMAT_R16G16B16_SINT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16_16:
|
||||
format = VK_FORMAT_R16G16B16A16_SINT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_32:
|
||||
format = VK_FORMAT_R32_SINT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_32_32:
|
||||
format = VK_FORMAT_R32G32_SINT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_32_32_32:
|
||||
format = VK_FORMAT_R32G32B32_SINT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_32_32_32_32:
|
||||
format = VK_FORMAT_R32G32B32A32_SINT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_10_10_10_2:
|
||||
format = VK_FORMAT_A2B10G10R10_SINT_PACK32;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Type::Float:
|
||||
switch (size) {
|
||||
case Maxwell::VertexAttribute::Size::Size_16:
|
||||
format = VK_FORMAT_R16_SFLOAT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16:
|
||||
format = VK_FORMAT_R16G16_SFLOAT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16:
|
||||
format = VK_FORMAT_R16G16B16_SFLOAT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_16_16_16_16:
|
||||
format = VK_FORMAT_R16G16B16A16_SFLOAT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_32:
|
||||
format = VK_FORMAT_R32_SFLOAT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_32_32:
|
||||
format = VK_FORMAT_R32G32_SFLOAT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_32_32_32:
|
||||
format = VK_FORMAT_R32G32B32_SFLOAT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_32_32_32_32:
|
||||
format = VK_FORMAT_R32G32B32A32_SFLOAT;
|
||||
break;
|
||||
case Maxwell::VertexAttribute::Size::Size_11_11_10:
|
||||
format = VK_FORMAT_B10G11R11_UFLOAT_PACK32;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return VK_FORMAT_UNDEFINED;
|
||||
})()};
|
||||
|
||||
if (format == VK_FORMAT_UNDEFINED) {
|
||||
UNIMPLEMENTED_MSG("Unimplemented vertex format of type={} and size={}", type, size);
|
||||
|
|
|
@ -1287,17 +1287,7 @@ Image::Image(TextureCacheRuntime& runtime_, const ImageInfo& info_, GPUVAddr gpu
|
|||
}
|
||||
}
|
||||
|
||||
Image::Image(TextureCacheRuntime& runtime_, const VideoCommon::NullImageParams& params)
|
||||
: VideoCommon::ImageBase(params), scheduler{&runtime_.scheduler}, runtime{&runtime_} {
|
||||
info.format = PixelFormat::A8B8G8R8_UNORM;
|
||||
original_image = MakeImage(runtime_.device, info);
|
||||
aspect_mask = ImageAspectMask(info.format);
|
||||
commit = runtime_.memory_allocator.Commit(original_image, MemoryUsage::DeviceLocal);
|
||||
if (runtime->device.HasDebuggingToolAttached()) {
|
||||
original_image.SetObjectNameEXT("NullImage");
|
||||
}
|
||||
current_image = *original_image;
|
||||
}
|
||||
Image::Image(const VideoCommon::NullImageParams& params) : VideoCommon::ImageBase{params} {}
|
||||
|
||||
Image::~Image() = default;
|
||||
|
||||
|
@ -1630,6 +1620,9 @@ ImageView::ImageView(TextureCacheRuntime&, const VideoCommon::NullImageViewParam
|
|||
ImageView::~ImageView() = default;
|
||||
|
||||
VkImageView ImageView::DepthView() {
|
||||
if (!image_handle) {
|
||||
return VK_NULL_HANDLE;
|
||||
}
|
||||
if (depth_view) {
|
||||
return *depth_view;
|
||||
}
|
||||
|
@ -1639,6 +1632,9 @@ VkImageView ImageView::DepthView() {
|
|||
}
|
||||
|
||||
VkImageView ImageView::StencilView() {
|
||||
if (!image_handle) {
|
||||
return VK_NULL_HANDLE;
|
||||
}
|
||||
if (stencil_view) {
|
||||
return *stencil_view;
|
||||
}
|
||||
|
@ -1648,6 +1644,9 @@ VkImageView ImageView::StencilView() {
|
|||
}
|
||||
|
||||
VkImageView ImageView::ColorView() {
|
||||
if (!image_handle) {
|
||||
return VK_NULL_HANDLE;
|
||||
}
|
||||
if (color_view) {
|
||||
return *color_view;
|
||||
}
|
||||
|
@ -1657,6 +1656,9 @@ VkImageView ImageView::ColorView() {
|
|||
|
||||
VkImageView ImageView::StorageView(Shader::TextureType texture_type,
|
||||
Shader::ImageFormat image_format) {
|
||||
if (!image_handle) {
|
||||
return VK_NULL_HANDLE;
|
||||
}
|
||||
if (image_format == Shader::ImageFormat::Typeless) {
|
||||
return Handle(texture_type);
|
||||
}
|
||||
|
|
|
@ -110,7 +110,7 @@ class Image : public VideoCommon::ImageBase {
|
|||
public:
|
||||
explicit Image(TextureCacheRuntime&, const VideoCommon::ImageInfo& info, GPUVAddr gpu_addr,
|
||||
VAddr cpu_addr);
|
||||
explicit Image(TextureCacheRuntime&, const VideoCommon::NullImageParams&);
|
||||
explicit Image(const VideoCommon::NullImageParams&);
|
||||
|
||||
~Image();
|
||||
|
||||
|
|
|
@ -41,9 +41,8 @@ TextureCache<P>::TextureCache(Runtime& runtime_, VideoCore::RasterizerInterface&
|
|||
|
||||
// Make sure the first index is reserved for the null resources
|
||||
// This way the null resource becomes a compile time constant
|
||||
void(slot_images.insert(runtime, NullImageParams{}));
|
||||
void(slot_image_views.insert(runtime, ImageViewInfo{}, NULL_IMAGE_ID,
|
||||
slot_images[NULL_IMAGE_ID]));
|
||||
void(slot_images.insert(NullImageParams{}));
|
||||
void(slot_image_views.insert(runtime, NullImageViewParams{}));
|
||||
void(slot_samplers.insert(runtime, sampler_descriptor));
|
||||
|
||||
if constexpr (HAS_DEVICE_MEMORY_INFO) {
|
||||
|
@ -1444,7 +1443,8 @@ ImageViewId TextureCache<P>::FindOrEmplaceImageView(ImageId image_id, const Imag
|
|||
if (const ImageViewId image_view_id = image.FindView(info); image_view_id) {
|
||||
return image_view_id;
|
||||
}
|
||||
const ImageViewId image_view_id = slot_image_views.insert(runtime, info, image_id, image);
|
||||
const ImageViewId image_view_id =
|
||||
slot_image_views.insert(runtime, info, image_id, image, slot_images);
|
||||
image.InsertView(info, image_view_id);
|
||||
return image_view_id;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue