diff --git a/ISF Editor/ISFEditorAppDelegate.m b/ISF Editor/ISFEditorAppDelegate.m index c7531eae..113e2e84 100644 --- a/ISF Editor/ISFEditorAppDelegate.m +++ b/ISF Editor/ISFEditorAppDelegate.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 diff --git a/ISF Editor/ISFPDownloader.m b/ISF Editor/ISFPDownloader.m index 48cf002e..143f3646 100644 --- a/ISF Editor/ISFPDownloader.m +++ b/ISF Editor/ISFPDownloader.m @@ -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]); diff --git a/VVBufferPool/VVBufferPool.h b/VVBufferPool/VVBufferPool.h index 21dd67cd..7a83486d 100644 --- a/VVBufferPool/VVBufferPool.h +++ b/VVBufferPool/VVBufferPool.h @@ -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; diff --git a/VVBufferPool/VVBufferPool.m b/VVBufferPool/VVBufferPool.m index 5df2928f..3f907e77 100644 --- a/VVBufferPool/VVBufferPool.m +++ b/VVBufferPool/VVBufferPool.m @@ -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