mirror of https://github.com/xemu-project/xemu.git
Remove dead code and remind about inplace+vram
This commit is contained in:
parent
1040e2605b
commit
1efddc36d5
|
@ -2889,15 +2889,14 @@ static void pgraph_update_surface(NV2AState *d,
|
||||||
glGenTextures(1, &pg->gl_color_buffer);
|
glGenTextures(1, &pg->gl_color_buffer);
|
||||||
glBindTexture(GL_TEXTURE_2D, pg->gl_color_buffer);
|
glBindTexture(GL_TEXTURE_2D, pg->gl_color_buffer);
|
||||||
|
|
||||||
#if 0 // Removed with flipped_buf
|
/* This is VRAM so we can't do this inplace! */
|
||||||
glPixelStorei(GL_UNPACK_ROW_LENGTH,
|
|
||||||
pg->surface_color.pitch / f.bytes_per_pixel);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
uint8_t *flipped_buf = g_malloc(width * height * f.bytes_per_pixel);
|
uint8_t *flipped_buf = g_malloc(width * height * f.bytes_per_pixel);
|
||||||
unsigned int irow;
|
unsigned int irow;
|
||||||
for (irow = 0; irow < height; irow++) {
|
for (irow = 0; irow < height; irow++) {
|
||||||
memcpy(&flipped_buf[width * (height - irow - 1) * f.bytes_per_pixel], &buf[pg->surface_color.pitch * irow], width * f.bytes_per_pixel);
|
memcpy(&flipped_buf[width * (height - irow - 1)
|
||||||
|
* f.bytes_per_pixel],
|
||||||
|
&buf[pg->surface_color.pitch * irow],
|
||||||
|
width * f.bytes_per_pixel);
|
||||||
}
|
}
|
||||||
|
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, f.gl_internal_format,
|
glTexImage2D(GL_TEXTURE_2D, 0, f.gl_internal_format,
|
||||||
|
@ -2907,10 +2906,6 @@ static void pgraph_update_surface(NV2AState *d,
|
||||||
|
|
||||||
g_free(flipped_buf);
|
g_free(flipped_buf);
|
||||||
|
|
||||||
#if 0
|
|
||||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
glFramebufferTexture2D(GL_FRAMEBUFFER,
|
glFramebufferTexture2D(GL_FRAMEBUFFER,
|
||||||
GL_COLOR_ATTACHMENT0,
|
GL_COLOR_ATTACHMENT0,
|
||||||
GL_TEXTURE_2D,
|
GL_TEXTURE_2D,
|
||||||
|
@ -3084,15 +3079,14 @@ static void pgraph_update_surface(NV2AState *d,
|
||||||
glGenTextures(1, &pg->gl_zeta_buffer);
|
glGenTextures(1, &pg->gl_zeta_buffer);
|
||||||
glBindTexture(GL_TEXTURE_2D, pg->gl_zeta_buffer);
|
glBindTexture(GL_TEXTURE_2D, pg->gl_zeta_buffer);
|
||||||
|
|
||||||
#if 0
|
/* This is VRAM so we can't do this inplace! */
|
||||||
glPixelStorei(GL_UNPACK_ROW_LENGTH,
|
|
||||||
pg->surface_zeta.pitch / bytes_per_pixel);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
uint8_t *flipped_buf = g_malloc(width * height * bytes_per_pixel);
|
uint8_t *flipped_buf = g_malloc(width * height * bytes_per_pixel);
|
||||||
unsigned int irow;
|
unsigned int irow;
|
||||||
for (irow = 0; irow < height; irow++) {
|
for (irow = 0; irow < height; irow++) {
|
||||||
memcpy(&flipped_buf[width * (height - irow - 1) * bytes_per_pixel], &buf[pg->surface_zeta.pitch * irow], width * bytes_per_pixel);
|
memcpy(&flipped_buf[width * (height - irow - 1)
|
||||||
|
* bytes_per_pixel],
|
||||||
|
&buf[pg->surface_zeta.pitch * irow],
|
||||||
|
width * bytes_per_pixel);
|
||||||
}
|
}
|
||||||
|
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, gl_internal_format,
|
glTexImage2D(GL_TEXTURE_2D, 0, gl_internal_format,
|
||||||
|
@ -3102,10 +3096,6 @@ static void pgraph_update_surface(NV2AState *d,
|
||||||
|
|
||||||
g_free(flipped_buf);
|
g_free(flipped_buf);
|
||||||
|
|
||||||
#if 0
|
|
||||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
glFramebufferTexture2D(GL_FRAMEBUFFER,
|
glFramebufferTexture2D(GL_FRAMEBUFFER,
|
||||||
gl_attachment,
|
gl_attachment,
|
||||||
GL_TEXTURE_2D,
|
GL_TEXTURE_2D,
|
||||||
|
|
Loading…
Reference in New Issue