Fix Graphical Glitches On Some NVIDIA GPUs And Fix Crash When Taking Large Screenshots
This commit is contained in:
parent
a622858a18
commit
de18189b44
@ -1,5 +1,5 @@
|
|||||||
#version 100
|
#version 100
|
||||||
precision mediump float;
|
precision highp float;
|
||||||
// Texture
|
// Texture
|
||||||
uniform bool u_has_texture;
|
uniform bool u_has_texture;
|
||||||
uniform sampler2D u_texture_unit;
|
uniform sampler2D u_texture_unit;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#version 100
|
#version 100
|
||||||
precision mediump float;
|
precision highp float;
|
||||||
// Matrices
|
// Matrices
|
||||||
uniform mat4 u_projection;
|
uniform mat4 u_projection;
|
||||||
uniform mat4 u_model_view;
|
uniform mat4 u_model_view;
|
||||||
|
@ -144,7 +144,8 @@ void screenshot_take(char *home) {
|
|||||||
int size = height * line_size;
|
int size = height * line_size;
|
||||||
|
|
||||||
// Read Pixels
|
// Read Pixels
|
||||||
unsigned char pixels[size];
|
unsigned char *pixels = (unsigned char *) malloc(size);
|
||||||
|
ALLOC_CHECK(pixels);
|
||||||
glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
|
glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
|
||||||
|
|
||||||
// Save Image
|
// Save Image
|
||||||
@ -157,4 +158,5 @@ void screenshot_take(char *home) {
|
|||||||
// Free
|
// Free
|
||||||
free(file);
|
free(file);
|
||||||
free(screenshots);
|
free(screenshots);
|
||||||
|
free(pixels);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user