Program Listing for File range-validator.h

Return to documentation for file (include\playback\range-validator.h)

/******************************************************************************
© Intel Corporation.

This software and the related documents are Intel copyrighted materials,
and your use of them is governed by the express license under which they
were provided to you ("License"). Unless the License provides otherwise,
you may not use, modify, copy, publish, distribute, disclose or transmit
this software or the related documents without Intel's prior written
permission.


 This software and the related documents are provided as is, with no express
or implied warranties, other than those that are expressly stated in the
License.

******************************************************************************/
#pragma once

#include "igpa-config.h"
#include "playback/range-object-accessor.h"
#include <stdint.h>

namespace gpa {
namespace playback {

class Callable;
class CallableCache;

class RangeValidator
{
public:
    enum ResultMaskBits : uint32_t {
        kValid = 0x0,
        kInvalidCache = 0x1,
        kInvalidRange = 0x2,
        kMultiplePrimaryCommandBuffersInRange =
            0x4,
        kFirstRangeCallIsBoundary =
            0x8,
        kLastRangeCallIsBoundary =
            0x10,
    };

    RangeValidator(CallableCache* cache);
    ~RangeValidator();

    bool IsValidRangeForMeasurements(uint64_t first, uint64_t last, uint32_t* reason = nullptr, bool checkForNativeCalls = true, bool checkForSingleCmdBuf = true);
    void* GetNativeCommandBufferKeyFromCall(uint64_t index);

private:
    bool IsSinglePrimaryCommandBufferUsedInRange(uint64_t first, uint64_t last);
    void UpdateSecondaryCommandBufferOverrideMapping(uint64_t index, uint16_t* markerCount);

    RangeObjectAccessor mObjectAccessor;
    CallableCache* mCache;
};

}  // namespace playback
}  // namespace gpa