Permalink
Browse files

added classes and test apps for texture upload and download

  • Loading branch information...
1 parent f7f9220 commit d301a4e014da9481c149fd23d34f6e9ab958b4ad @mrRay committed May 4, 2016
Showing with 8,904 additions and 506 deletions.
  1. +58 −0 GPUDownloadBenchmark/Assets.xcassets/AppIcon.appiconset/Contents.json
  2. +968 −0 GPUDownloadBenchmark/Base.lproj/MainMenu.xib
  3. +67 −0 GPUDownloadBenchmark/Checkerboard.fs
  4. +81 −0 GPUDownloadBenchmark/GPUDownloadBenchmarkAppDelegate.h
  5. +455 −0 GPUDownloadBenchmark/GPUDownloadBenchmarkAppDelegate.m
  6. +32 −0 GPUDownloadBenchmark/Info.plist
  7. +13 −0 GPUDownloadBenchmark/main.m
  8. +58 −0 GPUUploadBenchmark/Assets.xcassets/AppIcon.appiconset/Contents.json
  9. +929 −0 GPUUploadBenchmark/Base.lproj/MainMenu.xib
  10. +81 −0 GPUUploadBenchmark/GPUUploadBenchmarkAppDelegate.h
  11. +575 −0 GPUUploadBenchmark/GPUUploadBenchmarkAppDelegate.m
  12. BIN GPUUploadBenchmark/IMG_0885.JPG
  13. +32 −0 GPUUploadBenchmark/Info.plist
  14. +13 −0 GPUUploadBenchmark/main.m
  15. +58 −0 PBOGLtoCPUtoGL Test App/Assets.xcassets/AppIcon.appiconset/Contents.json
  16. +722 −0 PBOGLtoCPUtoGL Test App/Base.lproj/MainMenu.xib
  17. +32 −0 PBOGLtoCPUtoGL Test App/Info.plist
  18. +29 −0 PBOGLtoCPUtoGL Test App/PBOGLtoCPUtoGLAppDelegate.h
  19. +156 −0 PBOGLtoCPUtoGL Test App/PBOGLtoCPUtoGLAppDelegate.m
  20. +13 −0 PBOGLtoCPUtoGL Test App/main.m
  21. +58 −0 TexRangeGLtoCPU Test App/Assets.xcassets/AppIcon.appiconset/Contents.json
  22. +708 −0 TexRangeGLtoCPU Test App/Base.lproj/MainMenu.xib
  23. +32 −0 TexRangeGLtoCPU Test App/Info.plist
  24. +28 −0 TexRangeGLtoCPU Test App/TexRangeGLtoCPUtoGLAppDelegate.h
  25. +167 −0 TexRangeGLtoCPU Test App/TexRangeGLtoCPUtoGLAppDelegate.m
  26. +13 −0 TexRangeGLtoCPU Test App/main.m
  27. +1 −0 VVBasics/src/VVThreadLoop.h
  28. +18 −0 VVBufferPool/PBOCPUGLStreamer.h
  29. +150 −0 VVBufferPool/PBOCPUGLStreamer.m
  30. +33 −0 VVBufferPool/PBOGLCPUStreamer.h
  31. +306 −0 VVBufferPool/PBOGLCPUStreamer.m
  32. +48 −0 VVBufferPool/StreamProcessor.h
  33. +125 −0 VVBufferPool/StreamProcessor.m
  34. +33 −0 VVBufferPool/TexRangeCPUGLStreamer.h
  35. +79 −0 VVBufferPool/TexRangeCPUGLStreamer.m
  36. +22 −0 VVBufferPool/TexRangeGLCPUStreamer.h
  37. +258 −0 VVBufferPool/TexRangeGLCPUStreamer.m
  38. +116 −38 VVBufferPool/VVBufferPool.h
  39. +1,351 −448 VVBufferPool/VVBufferPool.m
  40. +986 −20 VVOpenSource.xcodeproj/project.pbxproj
@@ -0,0 +1,58 @@
+{
+ "images" : [
+ {
+ "idiom" : "mac",
+ "size" : "16x16",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "mac",
+ "size" : "16x16",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "mac",
+ "size" : "32x32",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "mac",
+ "size" : "32x32",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "mac",
+ "size" : "128x128",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "mac",
+ "size" : "128x128",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "mac",
+ "size" : "256x256",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "mac",
+ "size" : "256x256",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "mac",
+ "size" : "512x512",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "mac",
+ "size" : "512x512",
+ "scale" : "2x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
Oops, something went wrong.
@@ -0,0 +1,67 @@
+/*{
+ "CREDIT": "by VIDVOX",
+ "CATEGORIES": [
+ "Generator"
+ ],
+ "INPUTS": [
+ {
+ "NAME": "width",
+ "TYPE": "float",
+ "DEFAULT": 0.25
+ },
+ {
+ "NAME": "offset",
+ "TYPE": "point2D",
+ "DEFAULT": [
+ 0,
+ 0
+ ]
+ },
+ {
+ "NAME": "color1",
+ "TYPE": "color",
+ "DEFAULT": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ },
+ {
+ "NAME": "color2",
+ "TYPE": "color",
+ "DEFAULT": [
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0
+ ]
+ }
+ ]
+}*/
+
+
+
+void main() {
+ // determine if we are on an even or odd line
+ // math goes like..
+ // mod(((coord+offset) / width),2)
+
+
+ vec4 out_color = color2;
+ vec2 coord = vv_FragNormCoord * RENDERSIZE;
+ vec2 shift = offset;
+ float size = width * RENDERSIZE.x;
+
+ if (size == 0.0) {
+ out_color = color1;
+ }
+ else if ((mod(((coord.x+shift.x) / size),2.0) < 1.0)&&(mod(((coord.y+shift.y) / size),2.0) > 1.0)) {
+ out_color = color1;
+ }
+ else if ((mod(((coord.x+shift.x) / size),2.0) > 1.0)&&(mod(((coord.y+shift.y) / size),2.0) < 1.0)) {
+ out_color = color1;
+ }
+
+ gl_FragColor = out_color;
+}
@@ -0,0 +1,81 @@
+#import <Cocoa/Cocoa.h>
+#import <VVBufferPool/VVBufferPool.h>
+#import <DDMathParser/DDMathParser.h>
+#import <VVISFKit/VVISFKit.h>
+
+
+
+typedef enum {
+ DownloadMethod_PBO = 0,
+ DownloadMethod_TexRange = 1
+} DownloadMethod;
+
+typedef enum {
+ DownloadTexTarget_Rect = 0,
+ DownloadTexTarget_2D = 1,
+ DownloadTexTarget_NPOT2D = 2
+} DownloadTexTarget;
+
+typedef enum {
+ DownloadPixelFormat_RGBA = 0,
+ DownloadPixelFormat_BGRA = 1
+} DownloadPixelFormat;
+
+typedef enum {
+ DownloadInternalFormat_RGBA = 0,
+ DownloadInternalFormat_RGBA8 = 1
+} DownloadInternalFormat;
+
+typedef enum {
+ DownloadPixelType_UB = 0,
+ DownloadPixelType_8888_REV = 1,
+ DownloadPixelType_8888 = 2
+} DownloadPixelType;
+
+
+
+
+@interface GPUDownloadBenchmarkAppDelegate : NSObject <NSApplicationDelegate> {
+ NSOpenGLContext *sharedContext;
+
+ IBOutlet NSTextField *widthField;
+ IBOutlet NSTextField *heightField;
+
+ IBOutlet NSMatrix *pboVsRangeMatrix;
+ IBOutlet NSMatrix *targetMatrix;
+ IBOutlet NSMatrix *pixelFormatMatrix;
+ IBOutlet NSMatrix *internalFormatMatrix;
+ IBOutlet NSMatrix *pixelTypeMatrix;
+
+ IBOutlet NSTextField *resultsLabel;
+
+
+ IBOutlet VVBufferGLView *checkGLView;
+ IBOutlet NSImageView *checkImgView;
+
+
+ BOOL testInProgress;
+ NSUInteger testCount;
+ VVStopwatch *testSwatch;
+ NSSize testRes;
+ DownloadMethod testMethod;
+ DownloadTexTarget testTexTarget;
+ DownloadPixelFormat testColorFormat;
+ DownloadInternalFormat testInternalFormat;
+ DownloadPixelType testPixelType;
+ VVBuffer *testSrcBuffer; // this is copied into a buffer of the appropriate target/format, which is then downloaded
+
+ ISFGLScene *srcImgScene;
+ PBOGLCPUStreamer *pboStreamer;
+ TexRangeGLCPUStreamer *trStreamer;
+}
+
+- (IBAction) startTestClicked:(id)sender;
+- (IBAction) checkClicked:(id)sender;
+
+- (void) workMethod;
+
+- (VVBuffer *) _allocBufferToDownload;
+
+@end
+
Oops, something went wrong.

0 comments on commit d301a4e

Please sign in to comment.