diff --git a/src/vs/editor/browser/gpu/atlas/textureAtlasPage.ts b/src/vs/editor/browser/gpu/atlas/textureAtlasPage.ts index 8c0d35ee85e75..01edf66913051 100644 --- a/src/vs/editor/browser/gpu/atlas/textureAtlasPage.ts +++ b/src/vs/editor/browser/gpu/atlas/textureAtlasPage.ts @@ -83,6 +83,8 @@ export class TextureAtlasPage extends Disposable implements IReadableTextureAtla // Ensure the glyph was allocated if (glyph === undefined) { + // TODO: undefined here can mean the glyph was too large for a slab on the page, this + // can lead to big problems if we don't handle it properly https://github.com/microsoft/vscode/issues/232984 return undefined; } diff --git a/src/vs/editor/browser/viewParts/viewLinesGpu/viewLinesGpu.ts b/src/vs/editor/browser/viewParts/viewLinesGpu/viewLinesGpu.ts index b31a5f62fd97f..0f8e263c2b0f8 100644 --- a/src/vs/editor/browser/viewParts/viewLinesGpu/viewLinesGpu.ts +++ b/src/vs/editor/browser/viewParts/viewLinesGpu/viewLinesGpu.ts @@ -177,12 +177,12 @@ export class ViewLinesGpu extends ViewPart implements IViewLines { this._renderStrategy = this._register(this._instantiationService.createInstance(FullFileRenderStrategy, this._context, this._device, this.canvas, atlas)); this._glyphStorageBuffer[0] = this._register(GPULifecycle.createBuffer(this._device, { - label: 'Monaco glyph storage buffer', + label: 'Monaco glyph storage buffer [0]', size: GlyphStorageBufferInfo.BytesPerEntry * TextureAtlasPage.maximumGlyphCount, usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST, })).object; this._glyphStorageBuffer[1] = this._register(GPULifecycle.createBuffer(this._device, { - label: 'Monaco glyph storage buffer', + label: 'Monaco glyph storage buffer [1]', size: GlyphStorageBufferInfo.BytesPerEntry * TextureAtlasPage.maximumGlyphCount, usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST, })).object; @@ -300,6 +300,12 @@ export class ViewLinesGpu extends ViewPart implements IViewLines { private _updateAtlasStorageBufferAndTexture() { for (const [layerIndex, page] of ViewGpuContext.atlas.pages.entries()) { + if (layerIndex >= 2) { + // TODO: Support arbitrary number of layers + console.log(`Attempt to upload atlas page [${layerIndex}], only 2 are supported currently`); + continue; + } + // Skip the update if it's already the latest version if (page.version === this._atlasGpuTextureVersions[layerIndex]) { continue;