Skip to content

Commit

Permalink
add max texture size property to render context
Browse files Browse the repository at this point in the history
  • Loading branch information
ghugues committed Oct 6, 2024
1 parent b9bda16 commit ef6c7bb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Source/Renderer/RenderContextManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ - (instancetype)init
}
_metalQueue = [_metalDevice newCommandQueue];
_depthStencilPixelFormat = MTLPixelFormatInvalid;
// See https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
if ([_metalDevice supportsFamily:MTLGPUFamilyApple3]) {
_maxTextureSize = 16384;
} else if ([_metalDevice supportsFamily:MTLGPUFamilyApple2]) {
_maxTextureSize = 8192;
} else {
_maxTextureSize = 4096; // See archive.org for older versions of the document.
}
_framebufferOnly = NO;

return self;
Expand Down
1 change: 1 addition & 0 deletions Source/Renderer/include/RenderContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
@property(strong) id<MTLDevice> metalDevice;
@property(strong) id<MTLCommandQueue> metalQueue;
@property MTLPixelFormat depthStencilPixelFormat;
@property NSInteger maxTextureSize;
@property BOOL framebufferOnly;
- (rive::Factory*)factory;
- (rive::Renderer*)beginFrame:(MTKView*)view;
Expand Down

0 comments on commit ef6c7bb

Please sign in to comment.