From patchwork Sat Jun 23 15:15:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Keith Packard X-Patchwork-Id: 10483697 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AECF460230 for ; Sat, 23 Jun 2018 15:15:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A176928A8B for ; Sat, 23 Jun 2018 15:15:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9563028AA5; Sat, 23 Jun 2018 15:15:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2B10628A8B for ; Sat, 23 Jun 2018 15:15:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 677786E06D; Sat, 23 Jun 2018 15:15:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from elaine.keithp.com (home.keithp.com [63.227.221.253]) by gabe.freedesktop.org (Postfix) with ESMTP id 86B0B6E064; Sat, 23 Jun 2018 15:15:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by elaine.keithp.com (Postfix) with ESMTP id 592DE3F23AB9; Sat, 23 Jun 2018 08:15:23 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at keithp.com Received: from elaine.keithp.com ([127.0.0.1]) by localhost (elaine.keithp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ZzTNQsEPUYEO; Sat, 23 Jun 2018 08:15:23 -0700 (PDT) Received: from keithp.com (unknown [63.225.183.48]) by elaine.keithp.com (Postfix) with ESMTPSA id B5CC23F23AB3; Sat, 23 Jun 2018 08:15:22 -0700 (PDT) Received: by keithp.com (Postfix, from userid 1000) id 236E91582115; Sat, 23 Jun 2018 08:15:22 -0700 (PDT) From: Keith Packard To: mesa-dev@lists.freedesktop.org Subject: [PATCH 1/3] vulkan: Define new VK_MESA_query_timestamp extension [v2] Date: Sat, 23 Jun 2018 08:15:19 -0700 Message-Id: <20180623151521.8306-2-keithp@keithp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180623151521.8306-1-keithp@keithp.com> References: <20180623151521.8306-1-keithp@keithp.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Keith Packard , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This extension adds a single function to query the current GPU timestamp, just like glGetInteger64v(GL_TIMESTAMP, ×tamp). This function is needed to complete the implementation of GOOGLE_display_timing, which needs to be able to correlate GPU and CPU timestamps. v2: Adopt Jason Ekstrand's coding conventions Declare variables at first use, eliminate extra whitespace between types and names. Wrap lines to 80 columns. Add extension to list in alphabetical order Suggested-by: Jason Ekstrand Signed-off-by: Keith Packard --- include/vulkan/vk_mesa_query_timestamp.h | 41 ++++++++++++++++++++++++ src/vulkan/registry/vk.xml | 15 +++++++++ 2 files changed, 56 insertions(+) create mode 100644 include/vulkan/vk_mesa_query_timestamp.h diff --git a/include/vulkan/vk_mesa_query_timestamp.h b/include/vulkan/vk_mesa_query_timestamp.h new file mode 100644 index 00000000000..4e0b50cb9cc --- /dev/null +++ b/include/vulkan/vk_mesa_query_timestamp.h @@ -0,0 +1,41 @@ +/* + * Copyright © 2018 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#ifndef __VK_MESA_QUERY_TIMESTAMP_H__ +#define __VK_MESA_QUERY_TIMESTAMP_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef VkResult (VKAPI_PTR *PFN_vkQueryCurrentTimestampMESA)( + VkDevice device, uint64_t *timestamp); + +VKAPI_ATTR VkResult VKAPI_CALL vkQueryCurrentTimestampMESA( + VkDevice device, uint64_t *timestamp); + +#ifdef __cplusplus +} +#endif + +#endif /* __VK_MESA_QUERY_TIMESTAMP_H__ */ + diff --git a/src/vulkan/registry/vk.xml b/src/vulkan/registry/vk.xml index 7018bbe8421..3a5cecdc8e3 100644 --- a/src/vulkan/registry/vk.xml +++ b/src/vulkan/registry/vk.xml @@ -6102,6 +6102,11 @@ server. uint32_t maxDrawCount uint32_t stride + + VkResult vkQueryCurrentTimestampMESA + VkDevice device + uint64_t* pTimestamp + @@ -8826,5 +8831,15 @@ server. + + + + + + +