 
         threadGroupCount.width = (width + threadGroupSize.width - 1) / threadGroupSize.width
         threadGroupCount.height = (height + threadGroupSize.height - 1) / threadGroupSize.height
-
-        //print("VSContext:set", threadGroupCount, texture.usage)
     }
     
     func pop() -> VSTexture {
         if let texture = stack.popLast() {
             return texture
         }
-        return VSTexture(texture:source!, identity:-1)
+        return source!
     }
     
     func push(texture:VSTexture) {

    // pool: pool of textures to be reused for stack
    private var stack = [VSTexture]()
    private var pool = [VSTexture]()
    private var source:MTLTexture?
    
    init(device:MTLDevice, pixelFormat:MTLPixelFormat) {
        self.device = device

    func set(texture:MTLTexture) {
        assert(Thread.current == Thread.main)
        stack.removeAll() // HACK: for now
        source = VSTexture(texture:texture, identity:-1)
        
        if texture.width==width && texture.height==height {
            return
