             encoder.setTexture(textureOut0, at: 1)
             encoder.dispatchThreadgroups(threadGroupCount, threadsPerThreadgroup: threadGroupSize)
             encoder.endEncoding()
-            return commandBuffer
-        }()
-        
-        let cmGaussian:MTLCommandBuffer = {
-            let commandBuffer = commandQueue.makeCommandBuffer()
+
             guassian?.encode(commandBuffer: commandBuffer, sourceTexture: textureOut0!, destinationTexture: textureOut1!)
             return commandBuffer
         }()

            return commandBuffer
        }()
        
        cmGrayScale.commit()
        cmGaussian.commit()
        cmRender.commit()
    }
}

            print("VSS:draw texture not updated")
            return
        }
        let cmCompute:MTLCommandBuffer = {
            let commandBuffer = commandQueue.makeCommandBuffer()
            let encoder = commandBuffer.makeComputeCommandEncoder()
            encoder.setComputePipelineState(psGrayScale!)
