这是indexloc提供的服务,不要输入任何密码
Skip to content

Are duplicate timestamp locations allowed on the same pass? #2662

@haoxli

Description

@haoxli
dictionary GPURenderPassTimestampWrite {
    required GPUQuerySet querySet;
    required GPUSize32 queryIndex;
    required GPURenderPassTimestampLocation location;
};

partial  dictionary GPURenderPassDescriptor : GPUObjectDescriptorBase {
    GPURenderPassTimestampWrites timestampWrites = [];
};

Following the SPEC, we could set timestampWrites as below:

GPURenderPassDescriptor  descriptor;
descriptor.timestampWrites[0].querySet = querySet;
descriptor.timestampWrites[0].queryIndex = 0;
descriptor.timestampWrites[0].location = "beginning";
descriptor.timestampWrites[1].querySet = querySet;
descriptor.timestampWrites[1].queryIndex = 1;
descriptor.timestampWrites[1].location = "beginning";

But for Metal on TBDR devices, only the queryIndex 1 has timestamp values, the value at queryIndex 0 is always zero.

I'm not sure whether it's a bug of MTLRenderPassDescriptor.sampleBufferAttachments, or it's a real limition (No error from validation layer).

Another issue is writing the timestamp of the different location to a different querySet, it also does not work:

GPURenderPassDescriptor  descriptor;
descriptor.timestampWrites[0].querySet = querySet0;
descriptor.timestampWrites[0].queryIndex = 0;
descriptor.timestampWrites[0].location = "beginning";
descriptor.timestampWrites[1].querySet = querySet1;
descriptor.timestampWrites[1].queryIndex = 1;
descriptor.timestampWrites[1].location = "end";

Only the seond querySet could be written with timestamp value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    copyeditingPure editorial stuff (copyediting, *.bs file syntax, etc.)

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions