Skip to content

Commit

Permalink
small changes
Browse files Browse the repository at this point in the history
cleaned up a forgotten edge case, added var with max texture dimension
  • Loading branch information
mrRay committed Sep 19, 2016
1 parent 3802cee commit 6b9de16
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
12 changes: 10 additions & 2 deletions ISF Editor/ISFEditorAppDelegate.m
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions ISF Editor/ISFPDownloader.m
Expand Up @@ -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]);
Expand Down
1 change: 1 addition & 0 deletions VVBufferPool/VVBufferPool.h
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions VVBufferPool/VVBufferPool.m
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6b9de16

Please sign in to comment.