mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-24 12:25:00 +00:00
shader_recompiler: patch fmask access instructions (#1439)
* Fix multisample texture fetch * Patch some fmask reads * clang-format * Assert insteed of ignore, coordinate fixes * Patch ImageQueryDimensions
This commit is contained in:
parent
fe389e560a
commit
aa4c6c0178
5 changed files with 94 additions and 5 deletions
|
@ -86,6 +86,14 @@ struct SamplerResource {
|
|||
};
|
||||
using SamplerResourceList = boost::container::small_vector<SamplerResource, 16>;
|
||||
|
||||
struct FMaskResource {
|
||||
u32 sgpr_base;
|
||||
u32 dword_offset;
|
||||
|
||||
constexpr AmdGpu::Image GetSharp(const Info& info) const noexcept;
|
||||
};
|
||||
using FMaskResourceList = boost::container::small_vector<FMaskResource, 16>;
|
||||
|
||||
struct PushData {
|
||||
static constexpr u32 BufOffsetIndex = 2;
|
||||
static constexpr u32 UdRegsIndex = 4;
|
||||
|
@ -178,6 +186,7 @@ struct Info {
|
|||
TextureBufferResourceList texture_buffers;
|
||||
ImageResourceList images;
|
||||
SamplerResourceList samplers;
|
||||
FMaskResourceList fmasks;
|
||||
|
||||
PersistentSrtInfo srt_info;
|
||||
std::vector<u32> flattened_ud_buf;
|
||||
|
@ -282,6 +291,10 @@ constexpr AmdGpu::Sampler SamplerResource::GetSharp(const Info& info) const noex
|
|||
return inline_sampler ? inline_sampler : info.ReadUdSharp<AmdGpu::Sampler>(sharp_idx);
|
||||
}
|
||||
|
||||
constexpr AmdGpu::Image FMaskResource::GetSharp(const Info& info) const noexcept {
|
||||
return info.ReadUd<AmdGpu::Image>(sgpr_base, dword_offset);
|
||||
}
|
||||
|
||||
} // namespace Shader
|
||||
|
||||
template <>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue