Class GpuContext
-
Method Summary
Modifier and TypeMethodDescriptionvoidMarks the beginning of a GPU zone.voidendZone(int query) Marks the end of a GPU zone.Sets a name of this context.voidsubmitQueryTimestamp(int query, long timestamp) Submits a timestamp for a query, freeing the ID for reuse.
-
Method Details
-
setName
Sets a name of this context.- Parameters:
name- Name of this context- Returns:
- This context, for builder-style creation
-
beginZone
Marks the beginning of a GPU zone.Query is an arbitrary value that must be unique per frame. You are not permitted to reuse a query ID until it is later freed with
submitQueryTimestamp(int, long).You are expected to record a GPU timestamp as close as possible to this function, and then call
submitQueryTimestamp(int, long).Unlike with CPU Zones, GPU zones are started and ended as a stack. You do not explicitly mark _which_ zone you're ending, so calling this and
endZone(int)correctly is vitally important and errors will not be caught for you.- Parameters:
query- A unique ID to associate the start of this zone with a gpu timestamp latername- Name of the zone to displayfunction- Name of the function that this zone belongs tofile- Name of the file that this zone belongs toline- Line number of the file that this zone belongs to
-
endZone
public void endZone(int query) Marks the end of a GPU zone.Query is an arbitrary value that must be unique per frame. You are not permitted to reuse a query ID until it is later freed with
submitQueryTimestamp(int, long).You are expected to record a GPU timestamp as close as possible to this function, and then call
submitQueryTimestamp(int, long).Unlike with CPU Zones, GPU zones are started and ended as a stack. You do not explicitly mark _which_ zone you're ending, so calling this and
beginZone(int, String, String, String, int)correctly is vitally important and errors will not be caught for you.- Parameters:
query- A unique ID to associate the end of a zone with a gpu timestamp later
-
submitQueryTimestamp
public void submitQueryTimestamp(int query, long timestamp) Submits a timestamp for a query, freeing the ID for reuse.- Parameters:
query- Query ID previously generated for a zone's start or end.timestamp- GPU timestamp corresponding to that query ID.
-