aboutsummaryrefslogtreecommitdiff
path: root/service/device.go
diff options
context:
space:
mode:
authorSeb Noury <snoury@google.com>2015-06-24 18:56:33 +0100
committerSeb Noury <snoury@google.com>2015-06-25 14:03:16 +0100
commit9397e7ebbe0342866d4d40470cbfb2dabf68bbd4 (patch)
treeab7bb21bc757bcc3eb55a422868794f822f90459 /service/device.go
parent548758e1041cdf680be04594c26f54c2fed56d20 (diff)
downloadgpu-9397e7ebbe0342866d4d40470cbfb2dabf68bbd4.tar.gz
Make precisionStrip, halfFloat and decompressTextures depend on target version/extensions.
Also add a mapping of GL extension to compressed texture formats, so we can perform texture decompression only for formats used in the captured stream that are not supported by the target device. Change-Id: Ifa6bc896b7201532c8312bc0a3b8959782bdd693
Diffstat (limited to 'service/device.go')
-rw-r--r--service/device.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/service/device.go b/service/device.go
index bafb5845a..9439153ca 100644
--- a/service/device.go
+++ b/service/device.go
@@ -15,6 +15,9 @@
package service
import (
+ "fmt"
+ "regexp"
+
"android.googlesource.com/platform/tools/gpu/binary/endian"
"android.googlesource.com/platform/tools/gpu/device"
)
@@ -28,3 +31,10 @@ func (d Device) Architecture() device.Architecture {
ByteOrder: endian.Little, // TODO: Resolve
}
}
+
+func (d Device) HasExtension(extension string) bool {
+ if re, err := regexp.Compile(fmt.Sprintf(`\b%s\b`, extension)); err == nil {
+ return re.MatchString(d.Extensions)
+ }
+ return false
+}