Permalink
Browse files

small changes

cleaned up a forgotten edge case, added var with max texture dimension
  • Loading branch information...
1 parent 3802cee commit 6b9de1622dea3a2d1b59859cbe29b321e1deaf37 @mrRay committed Sep 19, 2016
Showing with 16 additions and 2 deletions.
  1. +10 −2 ISF Editor/ISFEditorAppDelegate.m
  2. +2 −0 ISF Editor/ISFPDownloader.m
  3. +1 −0 VVBufferPool/VVBufferPool.h
  4. +3 −0 VVBufferPool/VVBufferPool.m
@@ -1048,8 +1048,16 @@ - (void) _renderCallback {
lineDelta = 0;
}
else {
- NSInteger numberOfLinesAppendedToVS = [[compiledVertSrc substringFromIndex:rangeOfEndOfVS.location] numberOfLines];
- lineDelta = [precompiledVertSrc numberOfLines] - ([compiledVertSrc numberOfLines]-numberOfLinesAppendedToVS);
+ firstLineAppendedToVS = @"\nvoid isf_vertShaderInit(void)\t{";
+ rangeOfEndOfVS = [compiledVertSrc rangeOfString:firstLineAppendedToVS];
+ if (rangeOfEndOfVS.location==NSNotFound || rangeOfEndOfVS.length!=[firstLineAppendedToVS length]) {
+ NSLog(@"\t\tERR: couldn't locate end of precompiled shader in compiled vertex shader, %s",__func__);
+ lineDelta = 0;
+ }
+ else {
+ NSInteger numberOfLinesAppendedToVS = [[compiledVertSrc substringFromIndex:rangeOfEndOfVS.location] numberOfLines];
+ lineDelta = [precompiledVertSrc numberOfLines] - ([compiledVertSrc numberOfLines]-numberOfLinesAppendedToVS);
+ }
}
}
// if there's no difference in line numbers, just copy the error log in its entirety
@@ -356,6 +356,8 @@ - (void) downloadResultsForURLString:(NSString *)address {
// if the vertString is the default vertString, we can skip it
if ([vertString isEqualToString:@"void main() {\n\tvv_vertShaderInit();\n}"])
vertString = nil;
+ else if ([vertString isEqualToString:@"void main() {\n\tisf_vertShaderInit();\n}"])
+ vertString = nil;
// if the folder doesn't already exist
NSString *shaderDir = VVFMTSTRING(@"%@/%d",baseDir,[idNum intValue]);
@@ -55,6 +55,7 @@
extern id _globalVVBufferPool; // retained, nil on launch- this is the "main" buffer pool, used to generate image resources for hardware-accelerated image processing. can't be created automatically, b/c it needs to be based on a shared context.
#if !TARGET_OS_IPHONE
extern int _msaaMaxSamples;
+extern int _glMaxTextureDimension;
#endif // !TARGET_OS_IPHONE
extern BOOL _bufferPoolInitialized;
extern VVStopwatch *_bufferTimestampMaker;
@@ -18,6 +18,7 @@
id _globalVVBufferPool = nil;
#if !TARGET_OS_IPHONE
int _msaaMaxSamples = 0;
+int _glMaxTextureDimension = 1024;
#endif // !TARGET_OS_IPHONE
BOOL _bufferPoolInitialized = NO;
VVStopwatch *_bufferTimestampMaker = nil;
@@ -58,6 +59,8 @@ + (void) initialize {
GLint tmp;
glGetIntegerv(GL_MAX_SAMPLES_EXT,&tmp);
_msaaMaxSamples = tmp;
+ glGetIntegerv(GL_MAX_TEXTURE_SIZE, &tmp);
+ _glMaxTextureDimension = tmp;
[tmpContext release];
}
#else // NOT !TARGET_OS_IPHONE

0 comments on commit 6b9de16

Please sign in to comment.