blob: 2ec5c1eecc258165721892e516c38716f4d37116 [file] [log] [blame]
// Copyright (C) 2016 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Package replay is used to issue replay requests to replay devices.
package replay
import (
"android.googlesource.com/platform/tools/gpu/framework/device"
"android.googlesource.com/platform/tools/gpu/framework/id"
"android.googlesource.com/platform/tools/gpu/framework/log"
"android.googlesource.com/platform/tools/gpu/gapid/atom"
"android.googlesource.com/platform/tools/gpu/gapid/database"
)
// Generator is the interface for types that support replay generation.
type Generator interface {
// Replay is called when a replay pass is ready to be sent to the replay
// device. Replay may filter or transform the list of atoms, satisfying all
// the specified requests and config, before outputting the final atom stream
// to out.
Replay(
ctx log.Context,
intent Intent,
cfg Config,
requests []Request,
device *device.Information,
atoms atom.List,
out atom.Writer,
db database.Database) error
}
// Intent describes the source capture and replay target information used for
// issuing a replay request.
type Intent struct {
Device id.ID // The identifier of the device being used for replay.
Capture id.ID // The identifier of the capture that is being replayed.
}
// Config is a user-defined type used to describe the type of replay being
// requested. Replay requests made with configs that have equality (==) will
// likely be batched into the same replay pass. Configs can be used to force
// requests into different replay passes. For example, by issuing requests with
// different configs we can prevent a profiling Request from being issued in the
// same pass as a Request to render all draw calls in wireframe.
type Config interface{}
// Request is a user-defined type that holds information relevant to a single
// replay request. An example Request would be one that informs ReplayTransforms
// to insert a postback of the currently bound render-target content at a
// specific atom.
type Request interface{}