Merge pull request #826 from kawa-yoiko/fix-sokol-blurry

Fix Sokol build vertically flipped under Linux
This commit is contained in:
Vadim Grigoruk 2019-03-28 10:43:34 +03:00 committed by GitHub
commit e4875a5f56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 8 deletions

View File

@ -115,14 +115,8 @@ void sokol_gfx_init(int w, int h, int sx, int sy, bool integer_scale, bool portr
.d3d11_depth_stencil_view_cb = sapp_d3d11_get_depth_stencil_view .d3d11_depth_stencil_view_cb = sapp_d3d11_get_depth_stencil_view
}); });
/* quad vertex buffers with and without flipped UVs */ /* the vertex buffer representing screen rectangle */
float verts[] = { float verts[] = {
0.0f, 0.0f, 0.0f, 0.0f,
1.0f, 0.0f, 1.0f, 0.0f,
0.0f, 1.0f, 0.0f, 1.0f,
1.0f, 1.0f, 1.0f, 1.0f
};
float verts_flipped[] = {
0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f,
1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f,
0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f,
@ -130,7 +124,7 @@ void sokol_gfx_init(int w, int h, int sx, int sy, bool integer_scale, bool portr
}; };
sokol_gfx.draw_state.vertex_buffers[0] = sg_make_buffer(&(sg_buffer_desc){ sokol_gfx.draw_state.vertex_buffers[0] = sg_make_buffer(&(sg_buffer_desc){
.size = sizeof(verts), .size = sizeof(verts),
.content = sg_query_feature(SG_FEATURE_ORIGIN_TOP_LEFT) ? verts_flipped : verts, .content = verts,
}); });
/* a shader to render a textured quad */ /* a shader to render a textured quad */