I neglected to free the sampler view which was created earlier in the
function. So for each glCallLists() command that used the bitmap atlas
to draw text, we'd leak a sampler view object.
Also, check for st_create_texture_sampler_view() failure and record
GL_OUT_OF_MEMORY.
Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
st_validate_state(st, ST_PIPELINE_RENDER);
sv = st_create_texture_sampler_view(pipe, stObj->pt);
+ if (!sv) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCallLists(bitmap text)");
+ return;
+ }
setup_render_state(ctx, sv, color, true);
pipe_resource_reference(&vb.buffer, NULL);
+ pipe_sampler_view_reference(&sv, NULL);
+
/* We uploaded modified constants, need to invalidate them. */
st->dirty.mesa |= _NEW_PROGRAM_CONSTANTS;
}