Skip to content

Possible bug in DynamicQuerySample / AddGpuMetric #684

Description

@goldwizard13

Possible bug in DynamicQuerySample / AddGpuMetric

I noticed what appears to be a typo in the AddGpuMetric() function of the Dynamic Query sample.

The code adds the fourth FPS percentile query as:

elements.push_back(PM_QUERY_ELEMENT{
    .metric = PM_METRIC_PRESENTED_FPS,
    .stat = PM_STAT_PERCENTILE_90,
    .deviceId = 0,
    .arrayIndex = 0
});

However, the corresponding output is labeled:

ConsolePrintLn("Presented FPS 99% = %f",
    *reinterpret_cast<const double*>(&pBlob[elements[4].dataOffset]));

Therefore, the output labeled Presented FPS 99% actually contains the 90th percentile value.

I believe this should be:

elements.push_back(PM_QUERY_ELEMENT{
    .metric = PM_METRIC_PRESENTED_FPS,
    .stat = PM_STAT_PERCENTILE_99,
    .deviceId = 0,
    .arrayIndex = 0
});

The same logic is already used correctly in the DynamicQuerySample() fixed query:

FixedQueryElement fps99{
    this,
    PM_METRIC_PRESENTED_FPS,
    PM_STAT_PERCENTILE_99
};

So it looks like the AddGpuMetric() version may simply contain a copy/paste typo.

Could you please confirm whether this is an unintended error in the sample?

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions