I don't think this is as much a race or gun issue as much as it's a mental health issue. Obviously we don't know much at this point, but even a hard line racist will not usually do something this extreme, it usually takes some form of mental health issue.
There is a problem in this country with how we deal with the mentally ill. Too often parents are forced to stand by while their adult children cycle in and out through the mental health system. They hit a low and are hospitalized, where they receive medication and improve, so they are released. Once released they often stop taking medication and start acting out again. At one time people were often hospitalized against their will when they didn't need to be, but we have gone too far in the other direction and a good percentage of the homeless population are mentally ill, which is not good for them or for society.
There are laws that prevent people who are mentally from buying guns, but there are a few loopholes. A former co-worker of mine had a wife who threatened suicide. She was taken to the emergency room, but talked her way out of it. The next day she bought a gun and killed herself and their two children. She was diagnosed as bipolar and should not have been able to buy a gun, especially after threatening suicide.
Unfortunately in this church shooter's case his father bought the gun for him and it's it's hard to legislate against stupidity