mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-02 07:22:24 +00:00
* 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
29 lines
979 B
C++
29 lines
979 B
C++
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <vector>
|
|
#include "common/types.h"
|
|
|
|
namespace Shader::Gcn {
|
|
|
|
struct VertexAttribute {
|
|
u8 semantic; ///< Semantic index of the attribute
|
|
u8 dest_vgpr; ///< Destination VGPR to load first component.
|
|
u8 num_elements; ///< Number of components to load
|
|
u8 sgpr_base; ///< SGPR that contains the pointer to the list of vertex V#
|
|
u8 dword_offset; ///< The dword offset of the V# that describes this attribute.
|
|
u8 instance_data; ///< Indicates that the buffer will be accessed in instance rate
|
|
};
|
|
|
|
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
|