shader_recompiler: handle fetch shader address offsets (#538)

* shader_recompiler: handle fetch shader address offsets

parse index & offset sgpr from fetch shader and propagate them to vkBindVertexBuffers

* shader_recompiler: fix fetch_shader when offset is not present

* video_core: propagate index/offset SGPRs to vkCmdDraw instead of offsetting the buffer address

* video_core: add vertex_offset to non-indexed draw calls

renamed fetch offset fields
This commit is contained in:
Vinicius Rangel
2024-08-24 12:36:40 -03:00
committed by GitHub
parent 208575d392
commit 9e4fc17e6c
5 changed files with 53 additions and 9 deletions

View File

@@ -17,6 +17,12 @@ struct VertexAttribute {
u8 instance_data; ///< Indicates that the buffer will be accessed in instance rate
};
std::vector<VertexAttribute> ParseFetchShader(const u32* code, u32* out_size);
struct FetchShaderData {
std::vector<VertexAttribute> attributes;
s8 vertex_offset_sgpr = -1; ///< SGPR of vertex offset from VADDR
s8 instance_offset_sgpr = -1; ///< SGPR of instance offset from VADDR
};
FetchShaderData ParseFetchShader(const u32* code, u32* out_size);
} // namespace Shader::Gcn