mesa: Fix glBegin/End when LINE_LOOP is not supported
Emits the first vertex inside glEnd. cc: mesa-stable Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25346>
This commit is contained in:

committed by
Marge Bot

parent
7b4f0e714c
commit
ac838c1c5c
@@ -39,10 +39,6 @@ glx@glx_ext_import_context@make current- multi process,Fail
|
||||
glx@glx_ext_import_context@make current- single process,Fail
|
||||
glx@glx_ext_import_context@query context info,Fail
|
||||
spec@!opengl 1.0@gl-1.0-no-op-paths,Fail
|
||||
spec@!opengl 1.1@linestipple,Fail
|
||||
spec@!opengl 1.1@linestipple@Factor 2x,Fail
|
||||
spec@!opengl 1.1@linestipple@Factor 3x,Fail
|
||||
spec@!opengl 1.1@linestipple@Line loop,Fail
|
||||
spec@!opengl 1.1@polygon-mode,Fail
|
||||
spec@!opengl 1.1@polygon-mode-facing,Fail
|
||||
spec@!opengl 1.1@polygon-mode-offset,Fail
|
||||
|
@@ -181,10 +181,6 @@ spec@khr_texture_compression_astc@sliced-3d-miptree-gl srgb-fp@sRGB decode full
|
||||
spec@oes_shader_io_blocks@compiler@layout-location-aliasing.vert,Fail
|
||||
|
||||
spec@!opengl 1.0@gl-1.0-no-op-paths,Fail
|
||||
spec@!opengl 1.1@linestipple@Factor 2x,Fail
|
||||
spec@!opengl 1.1@linestipple@Factor 3x,Fail
|
||||
spec@!opengl 1.1@linestipple,Fail
|
||||
spec@!opengl 1.1@linestipple@Line loop,Fail
|
||||
spec@!opengl 1.1@polygon-mode-facing,Fail
|
||||
spec@!opengl 1.1@polygon-mode,Fail
|
||||
spec@!opengl 1.1@polygon-mode-offset@config 0: Expected white pixel on bottom edge,Fail
|
||||
|
@@ -192,10 +192,6 @@ spec@khr_texture_compression_astc@sliced-3d-miptree-gl srgb-fp@sRGB decode full
|
||||
spec@oes_shader_io_blocks@compiler@layout-location-aliasing.vert,Fail
|
||||
|
||||
spec@!opengl 1.0@gl-1.0-no-op-paths,Fail
|
||||
spec@!opengl 1.1@linestipple@Factor 2x,Fail
|
||||
spec@!opengl 1.1@linestipple@Factor 3x,Fail
|
||||
spec@!opengl 1.1@linestipple,Fail
|
||||
spec@!opengl 1.1@linestipple@Line loop,Fail
|
||||
spec@!opengl 1.1@polygon-mode-facing,Fail
|
||||
spec@!opengl 1.1@polygon-mode,Fail
|
||||
spec@!opengl 1.1@polygon-mode-offset@config 0: Expected white pixel on bottom edge,Fail
|
||||
|
@@ -180,10 +180,6 @@ spec@khr_texture_compression_astc@sliced-3d-miptree-gl srgb-fp@sRGB decode full
|
||||
spec@oes_shader_io_blocks@compiler@layout-location-aliasing.vert,Fail
|
||||
|
||||
spec@!opengl 1.0@gl-1.0-no-op-paths,Fail
|
||||
spec@!opengl 1.1@linestipple@Factor 2x,Fail
|
||||
spec@!opengl 1.1@linestipple@Factor 3x,Fail
|
||||
spec@!opengl 1.1@linestipple,Fail
|
||||
spec@!opengl 1.1@linestipple@Line loop,Fail
|
||||
spec@!opengl 1.1@polygon-mode-facing,Fail
|
||||
spec@!opengl 1.1@polygon-mode,Fail
|
||||
spec@!opengl 1.1@polygon-mode-offset@config 0: Expected white pixel on bottom edge,Fail
|
||||
|
@@ -951,8 +951,10 @@ _mesa_End(void)
|
||||
}
|
||||
|
||||
/* Special handling for GL_LINE_LOOP */
|
||||
bool driver_supports_lineloop =
|
||||
ctx->Const.DriverSupportedPrimMask & BITFIELD_BIT(MESA_PRIM_LINE_LOOP);
|
||||
if (exec->vtx.mode[last] == GL_LINE_LOOP &&
|
||||
exec->vtx.markers[last].begin == 0) {
|
||||
(exec->vtx.markers[last].begin == 0 || !driver_supports_lineloop)) {
|
||||
/* We're finishing drawing a line loop. Append 0th vertex onto
|
||||
* end of vertex buffer so we can draw it as a line strip.
|
||||
*/
|
||||
@@ -964,7 +966,9 @@ _mesa_End(void)
|
||||
/* copy 0th vertex to end of buffer */
|
||||
memcpy(dst, src, exec->vtx.vertex_size * sizeof(fi_type));
|
||||
|
||||
last_draw->start++; /* skip vertex0 */
|
||||
if (exec->vtx.markers[last].begin == 0)
|
||||
last_draw->start++; /* skip vertex0 */
|
||||
|
||||
/* note that the count stays unchanged */
|
||||
exec->vtx.mode[last] = GL_LINE_STRIP;
|
||||
|
||||
@@ -973,6 +977,9 @@ _mesa_End(void)
|
||||
*/
|
||||
exec->vtx.vert_count++;
|
||||
exec->vtx.buffer_ptr += exec->vtx.vertex_size;
|
||||
|
||||
if (!driver_supports_lineloop)
|
||||
last_draw->count++;
|
||||
}
|
||||
|
||||
try_vbo_merge(exec);
|
||||
|
Reference in New Issue
Block a user