Skip to content

Commit d74f5b8

Browse files
committed
Fix scanlines with some OGL drivers
1 parent 598c8db commit d74f5b8

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

platforms/shared/desktop/ogl_renderer.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,21 @@ static int mix_uniform_decay = -1;
6363
static int mix_uniform_tex_scale_new = -1;
6464
static int mix_uniform_tex_scale_old = -1;
6565

66-
static u32 scanlines_horizontal[16] = {
67-
0x00000000, 0x00000000, 0x00000000, 0x00000000,
68-
0x00000000, 0x00000000, 0x00000000, 0x00000000,
69-
0x00000000, 0x00000000, 0x00000000, 0x00000000,
70-
0x000000FF, 0x000000FF, 0x000000FF, 0x000000FF};
71-
static u32 scanlines_vertical[16] = {
72-
0x00000000, 0x00000000, 0x00000000, 0x000000FF,
73-
0x00000000, 0x00000000, 0x00000000, 0x000000FF,
74-
0x00000000, 0x00000000, 0x00000000, 0x000000FF,
75-
0x00000000, 0x00000000, 0x00000000, 0x000000FF};
76-
static u32 scanlines_grid[16] = {
77-
0x00000000, 0x00000000, 0x00000000, 0x000000FF,
78-
0x00000000, 0x00000000, 0x00000000, 0x000000FF,
79-
0x00000000, 0x00000000, 0x00000000, 0x000000FF,
80-
0x000000FF, 0x000000FF, 0x000000FF, 0x000000FF};
66+
static u8 scanlines_horizontal[64] = {
67+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
68+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
69+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
70+
0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF};
71+
static u8 scanlines_vertical[64] = {
72+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
73+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
74+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
75+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF};
76+
static u8 scanlines_grid[64] = {
77+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
78+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
79+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
80+
0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF};
8181

8282
static void init_ogl_gui(void);
8383
static void init_ogl_emu(void);
@@ -288,23 +288,23 @@ static void init_scanlines_texture(void)
288288
{
289289
glGenTextures(1, &scanlines_horizontal_texture);
290290
glBindTexture(GL_TEXTURE_2D, scanlines_horizontal_texture);
291-
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 4, 4, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, (GLvoid*) scanlines_horizontal);
291+
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 4, 4, 0, GL_RGBA, GL_UNSIGNED_BYTE, (GLvoid*) scanlines_horizontal);
292292
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
293293
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
294294
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
295295
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
296296

297297
glGenTextures(1, &scanlines_vertical_texture);
298298
glBindTexture(GL_TEXTURE_2D, scanlines_vertical_texture);
299-
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 4, 4, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, (GLvoid*) scanlines_vertical);
299+
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 4, 4, 0, GL_RGBA, GL_UNSIGNED_BYTE, (GLvoid*) scanlines_vertical);
300300
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
301301
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
302302
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
303303
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
304304

305305
glGenTextures(1, &scanlines_grid_texture);
306306
glBindTexture(GL_TEXTURE_2D, scanlines_grid_texture);
307-
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 4, 4, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, (GLvoid*) scanlines_grid);
307+
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 4, 4, 0, GL_RGBA, GL_UNSIGNED_BYTE, (GLvoid*) scanlines_grid);
308308
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
309309
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
310310
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);

0 commit comments

Comments
 (0)