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