mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-11 08:39:48 +12:00
Simply vertex cache code
This commit is contained in:
parent
0d6bef2d70
commit
1c9df7c02c
1 changed files with 5 additions and 2 deletions
|
@ -174,7 +174,9 @@ void GPU::drawArrays() {
|
|||
constexpr u32 maxAttrSizeInFloats = 16 * 4;
|
||||
auto& vertices = vertexBuffer.vertices;
|
||||
|
||||
setVsOutputMask(regs[PICA::InternalRegs::VertexShaderOutputMask]);
|
||||
if constexpr (mode != ShaderExecMode::Hardware) {
|
||||
setVsOutputMask(regs[PICA::InternalRegs::VertexShaderOutputMask]);
|
||||
}
|
||||
|
||||
// Base address for vertex attributes
|
||||
// The vertex base is always on a quadword boundary because the PICA does weird alignment shit any time possible
|
||||
|
@ -247,8 +249,9 @@ void GPU::drawArrays() {
|
|||
if constexpr (mode != ShaderExecMode::Hardware) {
|
||||
vertices[i] = vertices[cache.bufferPositions[tag]];
|
||||
} else {
|
||||
const u32 cachedBufferPosition = cache.bufferPositions[tag] * maxAttrSizeInFloats;
|
||||
std::memcpy(
|
||||
&vertexBuffer.vsInputs[i * maxAttrSizeInFloats], &vertexBuffer.vsInputs[cache.bufferPositions[tag] * maxAttrSizeInFloats],
|
||||
&vertexBuffer.vsInputs[i * maxAttrSizeInFloats], &vertexBuffer.vsInputs[cachedBufferPosition],
|
||||
sizeof(float) * maxAttrSizeInFloats
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue