mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-07 22:55:40 +12:00
HW shaders: Fix indexed rendering
This commit is contained in:
parent
16425379e3
commit
09b04704f8
1 changed files with 2 additions and 2 deletions
|
@ -1067,7 +1067,7 @@ void RendererGL::screenshot(const std::string& name) {
|
||||||
|
|
||||||
// Flip the image vertically
|
// Flip the image vertically
|
||||||
for (int y = 0; y < height; y++) {
|
for (int y = 0; y < height; y++) {
|
||||||
memcpy(&flippedPixels[y * width * 4], &pixels[(height - y - 1) * width * 4], width * 4);
|
std::memcpy(&flippedPixels[y * width * 4], &pixels[(height - y - 1) * width * 4], width * 4);
|
||||||
// Swap R and B channels
|
// Swap R and B channels
|
||||||
for (int x = 0; x < width; x++) {
|
for (int x = 0; x < width; x++) {
|
||||||
std::swap(flippedPixels[y * width * 4 + x * 4 + 0], flippedPixels[y * width * 4 + x * 4 + 2]);
|
std::swap(flippedPixels[y * width * 4 + x * 4 + 0], flippedPixels[y * width * 4 + x * 4 + 2]);
|
||||||
|
@ -1152,7 +1152,7 @@ void RendererGL::accelerateVertexUpload(ShaderUnit& shaderUnit, PICA::DrawAccele
|
||||||
// Update index buffer if necessary
|
// Update index buffer if necessary
|
||||||
if (accel->indexed) {
|
if (accel->indexed) {
|
||||||
usingShortIndices = accel->useShortIndices;
|
usingShortIndices = accel->useShortIndices;
|
||||||
const usize indexBufferSize = usize(vertexCount) * (usingShortIndices ? sizeof(u16) : sizeof(u8));
|
const usize indexBufferSize = regs[PICA::InternalRegs::VertexCountReg] * (usingShortIndices ? sizeof(u16) : sizeof(u8));
|
||||||
|
|
||||||
hwIndexBuffer->Bind();
|
hwIndexBuffer->Bind();
|
||||||
auto indexBufferRes = hwIndexBuffer->Map(4, indexBufferSize);
|
auto indexBufferRes = hwIndexBuffer->Map(4, indexBufferSize);
|
||||||
|
|
Loading…
Add table
Reference in a new issue