mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-07 01:26:20 +00:00
video_core: Add multipler to handle special cases of texture buffer stride mismatch (#1640)
* page_manager: Enable userfaultfd by default * Much faster than page faults and causes less problems * shader_recompiler: Add texel buffer multiplier * Fixes format mismatch assert when vsharp stride is multiple of format stride * shader_recompiler: Specialize UBOs on size * Some games can perform manual vertex pulling and thus bind read only buffers of varying size. We only recompile when the vsharp size is larger than size in shader, in opposite case its not needed * clang format
This commit is contained in:
parent
d05846a327
commit
9e618c0e0c
8 changed files with 30 additions and 7 deletions
|
@ -9,7 +9,6 @@
|
|||
#include "frontend/fetch_shader.h"
|
||||
#include "shader_recompiler/backend/bindings.h"
|
||||
#include "shader_recompiler/info.h"
|
||||
#include "shader_recompiler/ir/passes/srt.h"
|
||||
|
||||
namespace Shader {
|
||||
|
||||
|
@ -22,8 +21,12 @@ struct VsAttribSpecialization {
|
|||
struct BufferSpecialization {
|
||||
u16 stride : 14;
|
||||
u16 is_storage : 1;
|
||||
u32 size = 0;
|
||||
|
||||
auto operator<=>(const BufferSpecialization&) const = default;
|
||||
bool operator==(const BufferSpecialization& other) const {
|
||||
return stride == other.stride && is_storage == other.is_storage &&
|
||||
(size >= other.is_storage || is_storage);
|
||||
}
|
||||
};
|
||||
|
||||
struct TextureBufferSpecialization {
|
||||
|
@ -86,6 +89,9 @@ struct StageSpecialization {
|
|||
[](auto& spec, const auto& desc, AmdGpu::Buffer sharp) {
|
||||
spec.stride = sharp.GetStride();
|
||||
spec.is_storage = desc.IsStorage(sharp);
|
||||
if (!spec.is_storage) {
|
||||
spec.size = sharp.GetSize();
|
||||
}
|
||||
});
|
||||
ForEachSharp(binding, tex_buffers, info->texture_buffers,
|
||||
[](auto& spec, const auto& desc, AmdGpu::Buffer sharp) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue