Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unity extension which groups unity state resets #992

Merged
merged 3 commits into from
Aug 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cmd/gapis/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ import (
"github.com/google/gapid/gapis/server"
"github.com/google/gapid/gapis/service"
"github.com/google/gapid/gapis/stringtable"

// Extensions
_ "github.com/google/gapid/gapis/extensions/unity"
)

var (
Expand Down
25 changes: 25 additions & 0 deletions gapis/extensions/CMakeFiles.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (C) 2017 Google Inc.
#
# 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.

# Generated globbing source file
# This file will be automatically regenerated if deleted, do not edit by hand.
# If you add a new file to the directory, just delete this file, run any cmake
# build and the file will be recreated, check in the new version.

set(files
extensions.go
)
set(dirs
unity
)
57 changes: 57 additions & 0 deletions gapis/extensions/extensions.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// Copyright (C) 2017 Google Inc.
//
// 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 extensions provides extension functionality to GAPIS.
//
// Extensions would ideally be plugins, but golang still doesn't have
// cross platform support. See: https://github.com/golang/go/issues/19282
package extensions

import (
"sync"

"github.com/google/gapid/gapis/resolve/cmdgrouper"
)

var (
extensions []Extension
mutex sync.Mutex
)

// Extension is a GAPIS extension.
// It should be registered at application initialization with Register.
type Extension struct {
// Name of the extension.
Name string
// Custom command groupers.
CmdGroupers []cmdgrouper.Grouper
}

// Register registers the extension e.
func Register(e Extension) {
mutex.Lock()
defer mutex.Unlock()

extensions = append(extensions, e)
}

// Get returns the full list of registered extensions.
func Get() []Extension {
mutex.Lock()
defer mutex.Unlock()

out := make([]Extension, len(extensions))
copy(out, extensions)
return out
}
26 changes: 26 additions & 0 deletions gapis/extensions/unity/CMakeFiles.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright (C) 2017 Google Inc.
#
# 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.

# Generated globbing source file
# This file will be automatically regenerated if deleted, do not edit by hand.
# If you add a new file to the directory, just delete this file, run any cmake
# build and the file will be recreated, check in the new version.

set(files
state_reset_grouper.go
unity.go
)
set(dirs

)
Loading