It might be more accurate to call the genre "RPG Fantasy" because a lot of games other than D&D, in many media, use the same sword and sorcery-high fantasy-Tolkien Pastiche mash up. Early in the days of D&D, I would say it wasn't its own genre, just a mixture of a lot of fantasy sub-genre tropes and cliches. over time, though, as both D&D and derivatives of D&D grew in both popularity and sophistication, a distinct sub-genre of fantasy crystalized. And, like different high fantasy novels or whatever, different RPG Fantasy games and such vary more than a little in the details, but overall they are more alike than different -- World of Warcraft and D&D are good for this comparison I think. Each has a distinct milieu and many of the finer details of what makes them up varies, but ultimately they are the same genre, and unlike anything (non-game related) you're likely to pick up on the shelf at your local bookstore. In fact, perhaps the best evidence that D&D has created its own subgenre is many, many fantasy fiction writers guidelines warn against writing "D&D fantasy".