Fix Graphical Glitches On Some NVIDIA GPUs And Fix Crash When Taking Large Screenshots
Build / build (push) Failing after 7m24s Details
minecraft-pi-reborn/pipeline/head This commit looks good Details

This commit is contained in:
TheBrokenRail 2023-08-02 01:08:31 -04:00
parent a622858a18
commit de18189b44
3 changed files with 5 additions and 3 deletions

View File

@ -1,5 +1,5 @@
#version 100
precision mediump float;
precision highp float;
// Texture
uniform bool u_has_texture;
uniform sampler2D u_texture_unit;

View File

@ -1,5 +1,5 @@
#version 100
precision mediump float;
precision highp float;
// Matrices
uniform mat4 u_projection;
uniform mat4 u_model_view;

View File

@ -144,7 +144,8 @@ void screenshot_take(char *home) {
int size = height * line_size;
// 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);
// Save Image
@ -157,4 +158,5 @@ void screenshot_take(char *home) {
// Free
free(file);
free(screenshots);
free(pixels);
}