mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-15 03:41:34 +00:00
Add timestamp period calculation for timestamp-query-inside-passes
Timestamp period is also needed by the timestamp-query-inside-passes feature, which is enabled separately from the timestamp-query feature. Bug: dawn:1193 Change-Id: I8a1f87f8d7931261b87608306820daefc4c3dc55 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/107880 Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Hao Li <hao.x.li@intel.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
parent
3f24fdc447
commit
dec01f1fd5
@ -86,7 +86,7 @@ MaybeError Device::Initialize(const DeviceDescriptor* descriptor) {
|
|||||||
CheckHRESULT(mD3d12Device->CreateCommandQueue(&queueDesc, IID_PPV_ARGS(&mCommandQueue)),
|
CheckHRESULT(mD3d12Device->CreateCommandQueue(&queueDesc, IID_PPV_ARGS(&mCommandQueue)),
|
||||||
"D3D12 create command queue"));
|
"D3D12 create command queue"));
|
||||||
|
|
||||||
if (HasFeature(Feature::TimestampQuery) &&
|
if ((HasFeature(Feature::TimestampQuery) || HasFeature(Feature::TimestampQueryInsidePasses)) &&
|
||||||
!IsToggleEnabled(Toggle::DisableTimestampQueryConversion)) {
|
!IsToggleEnabled(Toggle::DisableTimestampQueryConversion)) {
|
||||||
// Get GPU timestamp counter frequency (in ticks/second). This fails if the specified
|
// Get GPU timestamp counter frequency (in ticks/second). This fails if the specified
|
||||||
// command queue doesn't support timestamps. D3D12_COMMAND_LIST_TYPE_DIRECT queues
|
// command queue doesn't support timestamps. D3D12_COMMAND_LIST_TYPE_DIRECT queues
|
||||||
|
@ -345,8 +345,10 @@ ResultOrError<ExecutionSerial> Device::CheckAndUpdateCompletedSerials() {
|
|||||||
MaybeError Device::TickImpl() {
|
MaybeError Device::TickImpl() {
|
||||||
DAWN_TRY(SubmitPendingCommandBuffer());
|
DAWN_TRY(SubmitPendingCommandBuffer());
|
||||||
|
|
||||||
// Just run timestamp period calculation when timestamp feature is enabled.
|
// Just run timestamp period calculation when timestamp feature is enabled and timestamp
|
||||||
if (HasFeature(Feature::TimestampQuery)) {
|
// conversion is not disabled.
|
||||||
|
if ((HasFeature(Feature::TimestampQuery) || HasFeature(Feature::TimestampQueryInsidePasses)) &&
|
||||||
|
!IsToggleEnabled(Toggle::DisableTimestampQueryConversion)) {
|
||||||
if (@available(macos 10.15, iOS 14.0, *)) {
|
if (@available(macos 10.15, iOS 14.0, *)) {
|
||||||
UpdateTimestampPeriod(GetMTLDevice(), mKalmanInfo.get(), &mCpuTimestamp, &mGpuTimestamp,
|
UpdateTimestampPeriod(GetMTLDevice(), mKalmanInfo.get(), &mCpuTimestamp, &mGpuTimestamp,
|
||||||
&mTimestampPeriod);
|
&mTimestampPeriod);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user