66 lines
3.1 KiB
Diff
66 lines
3.1 KiB
Diff
From 22eaac79757b0e4fe011deef9cc0596ba35c22b0 Mon Sep 17 00:00:00 2001
|
|
From: ptitSeb <sebastien.chev@gmail.com>
|
|
Date: Wed, 15 Mar 2023 11:14:29 +0100
|
|
Subject: [PATCH 238/249] Fixed use of real buffer in fpe (fixed Duckstation,
|
|
probably a lot of other game/emu too)
|
|
|
|
---
|
|
src/gl/buffers.c | 8 ++++----
|
|
src/gl/fpe.c | 4 ++--
|
|
2 files changed, 6 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/src/gl/buffers.c b/src/gl/buffers.c
|
|
index 682a9d8d..eaf881f0 100644
|
|
--- a/src/gl/buffers.c
|
|
+++ b/src/gl/buffers.c
|
|
@@ -88,8 +88,8 @@ void rebind_real_buff_arrays(int old_buffer, int new_buffer) {
|
|
for (int j = 0; j < hardext.maxvattrib; j++) {
|
|
if (glstate->vao->vertexattrib[j].real_buffer == old_buffer) {
|
|
glstate->vao->vertexattrib[j].real_buffer = new_buffer;
|
|
- if(!new_buffer)
|
|
- glstate->vao->vertexattrib[j].real_pointer = 0;
|
|
+ /*if(!new_buffer)
|
|
+ glstate->vao->vertexattrib[j].real_pointer = 0;*/
|
|
}
|
|
}
|
|
}
|
|
@@ -218,7 +218,7 @@ void APIENTRY_GL4ES gl4es_glBufferData(GLenum target, GLsizeiptr size, const GLv
|
|
vertexattrib_t *v = &glstate->vao->vertexattrib[i];
|
|
if( v->buffer == buff ) {
|
|
v->real_buffer = v->buffer->real_buffer;
|
|
- v->real_pointer = buff->data;
|
|
+ // do not update real_pointer, as it's the relative start in the buffer
|
|
}
|
|
}
|
|
noerrorShim();
|
|
@@ -269,7 +269,7 @@ void APIENTRY_GL4ES gl4es_glNamedBufferData(GLuint buffer, GLsizeiptr size, cons
|
|
vertexattrib_t *v = &glstate->vao->vertexattrib[i];
|
|
if( v->buffer == buff ) {
|
|
v->real_buffer = v->buffer->real_buffer;
|
|
- v->real_pointer = buff->data;
|
|
+ // do not update real_pointer, as it's the relative start in the buffer
|
|
}
|
|
}
|
|
noerrorShim();
|
|
diff --git a/src/gl/fpe.c b/src/gl/fpe.c
|
|
index 550b0ebc..23748ed6 100644
|
|
--- a/src/gl/fpe.c
|
|
+++ b/src/gl/fpe.c
|
|
@@ -1494,11 +1494,11 @@ void realize_glenv(int ispoint, int first, int count, GLenum type, const void* i
|
|
gles_glVertexAttribIPointer(i, v->size, v->type, v->stride, v->pointer);
|
|
else
|
|
gles_glVertexAttribPointer(i, v->size, v->type, 0, v->stride, v->pointer);
|
|
- DBG(printf("glVertexAttribIPointer(%d, %d, %s, %d, %p)\n", i, v->size, PrintEnum(v->type), v->stride, (GLvoid*)((uintptr_t)v->pointer+((v->buffer)?(uintptr_t)v->buffer->data:0)));)
|
|
+ DBG(printf("glVertexAttribIPointer(%d, %d, %s, %d, %p)\n", i, v->size, PrintEnum(v->type), v->stride, v->pointer);)
|
|
}
|
|
else {
|
|
gles_glVertexAttribPointer(i, v->size, v->type, v->normalized, v->stride, v->pointer);
|
|
- DBG(printf("glVertexAttribPointer(%d, %d, %s, %d, %d, %p)\n", i, v->size, PrintEnum(v->type), v->normalized, v->stride, (GLvoid*)((uintptr_t)v->pointer+((v->buffer)?(uintptr_t)v->buffer->data:0)));)
|
|
+ DBG(printf("glVertexAttribPointer(%d, %d, %s, %d, %d, %p)\n", i, v->size, PrintEnum(v->type), v->normalized, v->stride, v->pointer);)
|
|
}
|
|
}
|
|
} else {
|
|
--
|
|
2.30.2
|
|
|