diff --git a/gapis/api/templates/api.go.tmpl b/gapis/api/templates/api.go.tmpl index 001202bf75..736d435c42 100644 --- a/gapis/api/templates/api.go.tmpl +++ b/gapis/api/templates/api.go.tmpl @@ -954,13 +954,13 @@ {{Template "ClassFields" $}} {{/* TODO: Remove this once closure support is in the API language */}} {{if (eq $.Name "CommandBufferObject")}} - Commands CommandBufferCommands `nobox:"true"` + Commands CommandBufferCommands `hidden:"true" nobox:"true"` {{end}} {{if (eq $.Name "QueueObject")}} - PendingCommands CommandBufferCommands `nobox:"true"` + PendingCommands CommandBufferCommands `hidden:"true" nobox:"true"` {{end}} {{if (eq $.Name "RecreateCmdUpdateBufferData")}} - Data []uint8 `nobox:"true"` + Data []uint8 `hidden:"true" nobox:"true"` {{end}} } @@ -989,12 +989,26 @@ {{AssertType $ "Class"}} {{range $v := $.Fields}} {{$name := $v.Name | GoPublicName}} - {{$cs := ConstantSetIndex $v}} - {{$name}} {{Template "Go.Type" $v}} {{if ge $cs 0}}`constset:"{{$cs}}"`{{end}}{{if GetAnnotation $v "hidden"}}`nobox:"true"`{{end}} + {{$tags := Macro "ClassFieldTags" $v}} + {{$name}} {{Template "Go.Type" $v}} {{if $tags}}`{{$tags}}`{{end}} {{end}} {{end}} +{{/* +------------------------------------------------------------------------------- + Emits a list of tags for the given class field. +------------------------------------------------------------------------------- +*/}} +{{define "ClassFieldTags"}} + {{AssertType $ "Field"}} + {{$cs := ConstantSetIndex $}} + {{if ge $cs 0}}constset:"{{$cs}}" §{{end}} + {{if GetAnnotation $ "hidden"}}hidden:"true" §{{end}} + {{if GetAnnotation $ "nobox"}}nobox:"true" §{{end}} +{{end}} + + {{/* ------------------------------------------------------------------------------- Emits the default value for the specified type. @@ -1103,7 +1117,7 @@ {{range $g := $.Globals}} {{Title $g.Name}} {{Template "Go.Type" $g}} {{end}} - CustomState `nobox:"true"` + CustomState `hidden:"true" nobox:"true"` } func (g *State) Init() { diff --git a/gapis/api/vulkan/vulkan.api b/gapis/api/vulkan/vulkan.api index b10796da63..6f7c8b40da 100644 --- a/gapis/api/vulkan/vulkan.api +++ b/gapis/api/vulkan/vulkan.api @@ -9406,8 +9406,8 @@ enum RecordingState { VkDeviceSize MappedSize void* MappedLocation u32 MemoryTypeIndex - @hidden @internal u8[] Data - @unused ref!VulkanDebugMarkerInfo DebugInfo + @hidden @nobox @internal u8[] Data + @unused ref!VulkanDebugMarkerInfo DebugInfo ref!DedicatedAllocationMemoryAllocateInfoNV DedicatedAllocationNV } @@ -9475,11 +9475,11 @@ enum RecordingState { } @internal class ImageLevel { - u32 Width - u32 Height - @unused u32 Depth - @hidden @internal u8[] Data - @unused u32 Size + u32 Width + u32 Height + @unused u32 Depth + @hidden @nobox @internal u8[] Data + @unused u32 Size } @internal class ImageViewObject { diff --git a/gapis/resolve/state_tree.go b/gapis/resolve/state_tree.go index 0b781a6104..a18ba5e76d 100644 --- a/gapis/resolve/state_tree.go +++ b/gapis/resolve/state_tree.go @@ -305,7 +305,7 @@ func (n *stn) service(ctx context.Context, tree *stateTree) *service.StateTreeNo } func isFieldVisible(f reflect.StructField) bool { - return f.PkgPath == "" && f.Tag.Get("nobox") != "true" + return f.PkgPath == "" && f.Tag.Get("hidden") != "true" } func stateValuePreview(v reflect.Value) (*box.Value, bool) {