         }
     }
     
-    private var textureOut:MTLTexture?
+    private var textureOut0:MTLTexture?
+    private var textureOut1:MTLTexture?
     private var threadGroupSize = MTLSizeMake(16,16,1)
     private var threadGroupCount = MTLSizeMake(1, 1, 1) // to be filled later
 

    
    private var pipelineState: MTLRenderPipelineState?
    private var psGrayScale: MTLComputePipelineState?
    
    struct VSVertex {
        let position:vector_float2

            descriptor.width = width
            descriptor.height = height
            descriptor.usage = [.shaderRead, .shaderWrite]
            textureOut0 = device.makeTexture(descriptor: descriptor)
            textureOut1 = device.makeTexture(descriptor: descriptor)
            
            guassian = MPSImageGaussianBlur(device: device, sigma: 5.0)
            
            threadGroupCount.width = (width + threadGroupSize.width - 1) / threadGroupSize.width
            threadGroupCount.height = (height + threadGroupSize.height - 1) / threadGroupSize.height
