Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tiled image support #897

Merged
merged 6 commits into from Feb 24, 2017

Automatically tile images that exceed the maximum texture size.

  • Loading branch information
nical committed Feb 23, 2017
commit 8e8e3e9b824fb7adb082971595f6a24ea85da26b
@@ -263,11 +263,11 @@ impl ResourceCache {
image_key: ImageKey,
descriptor: ImageDescriptor,
data: ImageData,
tiling: Option<u16>) {
mut tiling: Option<u16>) {
if descriptor.width > self.max_texture_size() || descriptor.height > self.max_texture_size() {
// TODO: we need to support handle this case gracefully, cf. issue #620.
println!("Warning: texture size ({} {}) larger than the maximum size",
descriptor.width, descriptor.height);
// We aren't going to be able to upload a texture this big, so tile it, even
// if tiling was not requested.
tiling = Some(512);
}

let resource = ImageResource {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.