Pica: Set program code / swizzle data limit to 4096
One of the later commits will enable writing to GS regs. It turns out that on startup, most games will write 4096 GS program words. The current limit of 1024 would hence result in 3072 (4096 - 1024) error messages: ``` HW.GPU <Error> video_core/shader/shader.cpp:WriteProgramCode:229: Invalid GS program offset 1024 ``` New constants have been introduced to represent these limits. The swizzle data size has also been raised. This matches the given field sizes of [GPUREG_SH_OPDESCS_INDEX](https://3dbrew.org/wiki/GPU/Internal_Registers#GPUREG_SH_OPDESCS_INDEX) and [GPUREG_SH_CODETRANSFER_INDEX](https://www.3dbrew.org/wiki/GPU/Internal_Registers#GPUREG_SH_CODETRANSFER_INDEX) (12 bit = [0; 4095]).
This commit is contained in:
parent
e33558c6ce
commit
925724c990
5 changed files with 16 additions and 13 deletions
|
@ -24,6 +24,9 @@ namespace Pica {
|
|||
|
||||
namespace Shader {
|
||||
|
||||
constexpr unsigned MAX_PROGRAM_CODE_LENGTH = 4096;
|
||||
constexpr unsigned MAX_SWIZZLE_DATA_LENGTH = 4096;
|
||||
|
||||
struct AttributeBuffer {
|
||||
alignas(16) Math::Vec4<float24> attr[16];
|
||||
};
|
||||
|
@ -144,8 +147,8 @@ struct ShaderSetup {
|
|||
return offsetof(ShaderSetup, uniforms.i) + index * sizeof(Math::Vec4<u8>);
|
||||
}
|
||||
|
||||
std::array<u32, 1024> program_code;
|
||||
std::array<u32, 1024> swizzle_data;
|
||||
std::array<u32, MAX_PROGRAM_CODE_LENGTH> program_code;
|
||||
std::array<u32, MAX_SWIZZLE_DATA_LENGTH> swizzle_data;
|
||||
|
||||
/// Data private to ShaderEngines
|
||||
struct EngineData {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue