mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 16:32:39 +00:00
Shader specialization
This commit is contained in:
parent
008d2ac1db
commit
fe3b41c64b
@ -26,8 +26,15 @@ struct TextureBufferSpecialization {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct ImageSpecialization {
|
struct ImageSpecialization {
|
||||||
|
enum class Normalization : u8 {
|
||||||
|
None,
|
||||||
|
Signed,
|
||||||
|
Unsigned,
|
||||||
|
};
|
||||||
|
|
||||||
AmdGpu::ImageType type = AmdGpu::ImageType::Color2D;
|
AmdGpu::ImageType type = AmdGpu::ImageType::Color2D;
|
||||||
bool is_integer = false;
|
bool is_integer = false;
|
||||||
|
Normalization normalization = Normalization::None;
|
||||||
|
|
||||||
auto operator<=>(const ImageSpecialization&) const = default;
|
auto operator<=>(const ImageSpecialization&) const = default;
|
||||||
};
|
};
|
||||||
@ -73,12 +80,18 @@ struct StageSpecialization {
|
|||||||
[](auto& spec, const auto& desc, AmdGpu::Buffer sharp) {
|
[](auto& spec, const auto& desc, AmdGpu::Buffer sharp) {
|
||||||
spec.is_integer = AmdGpu::IsInteger(sharp.GetNumberFmt());
|
spec.is_integer = AmdGpu::IsInteger(sharp.GetNumberFmt());
|
||||||
});
|
});
|
||||||
ForEachSharp(binding, images, info->images,
|
ForEachSharp(
|
||||||
[](auto& spec, const auto& desc, AmdGpu::Image sharp) {
|
binding, images, info->images, [](auto& spec, const auto& desc, AmdGpu::Image sharp) {
|
||||||
spec.type = sharp.IsPartialCubemap() ? AmdGpu::ImageType::Color2DArray
|
spec.type =
|
||||||
: sharp.GetType();
|
sharp.IsPartialCubemap() ? AmdGpu::ImageType::Color2DArray : sharp.GetType();
|
||||||
spec.is_integer = AmdGpu::IsInteger(sharp.GetNumberFmt());
|
spec.is_integer = AmdGpu::IsInteger(sharp.GetNumberFmt());
|
||||||
});
|
|
||||||
|
if (sharp.NeedsNormalizationPatch()) {
|
||||||
|
spec.normalization = sharp.GetNumberFmt() == AmdGpu::NumberFormat::Snorm
|
||||||
|
? ImageSpecialization::Normalization::Signed
|
||||||
|
: ImageSpecialization::Normalization::Unsigned;
|
||||||
|
}
|
||||||
|
});
|
||||||
ForEachSharp(binding, fmasks, info->fmasks,
|
ForEachSharp(binding, fmasks, info->fmasks,
|
||||||
[](auto& spec, const auto& desc, AmdGpu::Image sharp) {
|
[](auto& spec, const auto& desc, AmdGpu::Image sharp) {
|
||||||
spec.width = sharp.width;
|
spec.width = sharp.width;
|
||||||
|
Loading…
Reference in New Issue
Block a user