From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Aaron Jensen Newsgroups: gmane.emacs.devel Subject: Re: macOS metal rendering engine in mac port Date: Tue, 25 May 2021 17:32:09 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12962"; mail-complaints-to="usenet@ciao.gmane.io" To: Alan Third , Aaron Jensen , emacs-devel@gnu.org, YAMAMOTO Mitsuharu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 26 02:57:40 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1llhrg-0003Ag-65 for ged-emacs-devel@m.gmane-mx.org; Wed, 26 May 2021 02:57:40 +0200 Original-Received: from localhost ([::1]:50476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llhrf-0007YX-92 for ged-emacs-devel@m.gmane-mx.org; Tue, 25 May 2021 20:57:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42828) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llhTF-000671-2q for emacs-devel@gnu.org; Tue, 25 May 2021 20:32:25 -0400 Original-Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]:39511) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llhTC-0002Es-EH for emacs-devel@gnu.org; Tue, 25 May 2021 20:32:24 -0400 Original-Received: by mail-pl1-x62e.google.com with SMTP id q16so1457345pls.6 for ; Tue, 25 May 2021 17:32:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=ucL4FTzZOnVkwubk4equFzO3hvLg8DVE/llmwxgXB3s=; b=lq5ehA4FPHYkTcAmJkLEbXZUUpSts1LEaY4ugsVyHqT/fF3htWTaKQcEi68BFTyatN 7Pk4eY/PHgPnxPiaUO5jcViZMIp1Og98rdUkNSRkDy4BJmA1l39kZN8Yq4lUbrCSYtIE gw3EAWfscqtQNjMEcRsllz6pgA+nz32wVk/NapThVvL+8sb5OahFo8VL9WG/76XhsIUD ju9Aov2BQM1PWUEQux3AVeOuKa9A7z1ggLZXTFwg25a1gkQLBxyvSS23JTpAG2dXTZ/4 hHtoBVx7SaQ3H7xK/3KtWkr+ztRdZSUTmkQzJPSREdITpwzBa9uxV1ZzzcHD/BsAoPtf 2nQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=ucL4FTzZOnVkwubk4equFzO3hvLg8DVE/llmwxgXB3s=; b=P2Puc010Q6fhCoVy0Mn3j+RUzoWJaavS/AplY6fAdwRr+PxhK9V2s2k+W5PtHmFNeo 8N3j+kcTWFdUkberKVaay4zLGwAuIsO3QdZEJ/8cXkjrRi/WWl4cRqXNsV9WBCvuhYX6 dGIeoeYqbD7uL5Bc+vwGwKYNfF2/AloO10t6uLeagTtNA63HqVjUXdH59wsmtzGhufqN AHaocV5pNI17fUJTtKXUo9lGNH26NnKXZ7N1Cz8vAbdLTJXCHWpEOeUuNZk+NCWf2x34 USg9g1sT4/ROoKjZiChNtC9Ild6dR+/WmwuVvX/J3EunTge6xeyz2Kdz+eG7ARUI14lf jAoQ== X-Gm-Message-State: AOAM533rofcRL1+s8zq+x51z/P2ptvcXlL30z1NeNC+AikrPCn7mWlgL zmGw0UnGMFwn0to0BnRXKxJQzZdqqjcxdsh8rAI= X-Google-Smtp-Source: ABdhPJxhjXTdbslKFQOBau0d6183vlK9AG3/AX5zcpSeGKHY+/ex2P5b+bExcfjJdgrbVn6izoZ0gCT00axOwB05qp0= X-Received: by 2002:a17:90a:e50b:: with SMTP id t11mr33645271pjy.181.1621989140848; Tue, 25 May 2021 17:32:20 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=aaronjensen@gmail.com; helo=mail-pl1-x62e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:269905 Archived-At: On Tue, May 25, 2021 at 9:31 AM Aaron Jensen wrote: > > On Mon, May 24, 2021 at 2:01 AM Alan Third wrote: > > > > I think so. A lot of what people like (smooth scrolling, etc.) would > > have to be removed. > > Weird, this has never worked for me, but maybe I've had it misconfigured > > > One more thing to try... > > > > modified src/nsterm.m > > @@ -8376,7 +8376,13 @@ - (void)unfocusDrawingBuffer > > NSTRACE ("[EmacsView unfocusDrawingBuffer]"); > > > > [NSGraphicsContext setCurrentContext:nil]; > > - [self setNeedsDisplay:YES]; > > + [surface releaseContext]; > > + [[self layer] setContents:(id)[surface getSurface]]; > > + [surface performSelectorOnMainThread:@selector (getContext) > > + withObject:nil > > + waitUntilDone:NO]; > > + > > + //[self setNeedsDisplay:YES]; > > } > > > > > > @@ -8513,11 +8519,11 @@ - (void)updateLayer > > There's a private method, -[CALayer setContentsChanged], that we > > could use to force it, but we shouldn't often get the same > > surface twice in a row. */ > > - [surface releaseContext]; > > - [[self layer] setContents:(id)[surface getSurface]]; > > - [surface performSelectorOnMainThread:@selector (getContext) > > - withObject:nil > > - waitUntilDone:NO]; > > + // [surface releaseContext]; > > + // [[self layer] setContents:(id)[surface getSurface]]; > > + // [surface performSelectorOnMainThread:@selector (getContext) > > + // withObject:nil > > + // waitUntilDone:NO]; > > } > > #endif > > > > > > All this does is reduce the time between us deciding we're done with > > drawing and sending it off to VRAM (although it might not, I'm not > > entirely sure when updateLayer gets called). > > > > I expect this to reduce frame rate, but perhaps it will improve input > > lag a little. > > I don't know if it's something funky with my machine or not but I've > noticed some stutters with this patch. As in, it appears to miss > paints. I'll type a character and won't see it until I type something > else. Is it possible that this patch could cause that? This stopped, so maybe it was something funky. So far, today, things feel pretty good from a latency perspective. I haven't measured anything yet. Thanks, Aaron