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 09:31:16 -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="6256"; 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 Tue May 25 19:31:26 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 1llatq-0001PR-Hy for ged-emacs-devel@m.gmane-mx.org; Tue, 25 May 2021 19:31:26 +0200 Original-Received: from localhost ([::1]:48170 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llatp-0000X0-Jr for ged-emacs-devel@m.gmane-mx.org; Tue, 25 May 2021 13:31:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50816) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llZxs-0003ky-KX for emacs-devel@gnu.org; Tue, 25 May 2021 12:31:32 -0400 Original-Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]:33566) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llZxq-0003jk-7N for emacs-devel@gnu.org; Tue, 25 May 2021 12:31:32 -0400 Original-Received: by mail-pg1-x529.google.com with SMTP id i5so23200507pgm.0 for ; Tue, 25 May 2021 09:31:28 -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=7NyJ6Mic7FKCd8NnHTIjG6ouzNvl+p8attrUXDs6Ozw=; b=ljDzwSLSyNaGhtFBkfKYFEN1jYUVFhXBCcVxVQ/YqcXrl0uAZ0CZ/f5alVCf4obYyN +hQIj1kiGyn5j2z/F9wml0hyGOKUXIIrGG5nuJVV5JJEuSX2M0I+C0BGMbnGM9xjX+Kn qiElaGDFaWPqDdNFP4a6qNLjJgYXwheyvNFrBsksIekzDTixCQ4T4E1OuM+pIFEOUPnj I7uNvI6YT/mUS3QztrLBR6rooeERAmXkm57KFIgiUZR1a4B1M3jeagiEV6zEPrMh+BB7 T/AUjMlqcAXMtyJBLXche7msylgAYFqIE+N3E8Ngl41JJAD0/Tn539evfjyhcedTaFRS F39Q== 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=7NyJ6Mic7FKCd8NnHTIjG6ouzNvl+p8attrUXDs6Ozw=; b=kqG3WtL7ubIY6kHCM6CStKsLZxcx6456u5TWRld9o3zsuRFuv9u36CaqZ0wlwVLlaY oJpDNJTQVv7hKdbfFEjrgq/cOLl3VOen7AtDAE4qzq4YERlYSKXHIwyLzkuW3GCSGgGJ M5/70TJUFhlGTrOx84cM7ntg6nsUTAbHukvwhFCR60QLQOP7vE4q6aJ+JJ0oRjKuATAo TSDIN14c5py+lq31FT5Zc61v1Ri4s0OkpGhe8DE5E0RQQCy4BIL3qy/Ru6jVAOJWreHF gSv+G0P+AzaDAN7AlajcxOY+Nmls7qWkmynypyQpHxY0wfSMThj3F0DDcYHFRRhqnr1R KGng== X-Gm-Message-State: AOAM5313zxdQlQSVczHZJThNdrhRI62wx0qU72ZcruXGxOCkn3+DTsuS a0GTbj8M1QQ64blCklVx5ztYSlKggAOqs9Reimk= X-Google-Smtp-Source: ABdhPJzv3JeUwGaPiIF8+bOQyPIiSCRp4SdX82RneE7qcIPMsg3e3lNUXpqBMBWAerebAcn+zuAzUM+u0UI5hEMmleY= X-Received: by 2002:a63:4662:: with SMTP id v34mr17278665pgk.358.1621960287835; Tue, 25 May 2021 09:31:27 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=aaronjensen@gmail.com; helo=mail-pg1-x529.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:269868 Archived-At: 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? Thanks, Aaron