Thursday night’s game between the Raiders and 49ers in Santa Clara is perhaps the worst primetime game in the history of the NFL — a true Toilet Bowl between two teams with a combined two wins at the halfway point of the season.

This has truly been a lost fall for Bay Area pro football — Jon Gruden decided to spectacularly rebuild the Raiders just before the start of the season, and the 49ers, in year two of their rebuild, lost any chance of relevancy the moment Jimmy Garoppolo tore his ACL in Week 3.

And with both squads seemingly at rock-bottom, it’s easy to imagine theoretically better times — to mentally skip ahead to 2019 and beyond.

But taking a look around the NFL and recent league history, I’m less and less convinced that either of these teams will be competing for a Super Bowl anytime soon.

The reason: their quarterbacks.

I’m not trying to slam or hate on Garoppolo and Raiders’ quarterback Derek Carr when I say that neither appears — at least to me — to be a generational talent.

They both have plenty of upside. And I think both can carry a team to wins.

Both quarterbacks are highly paid, too.

It’s that last part that’s problematic.

Don’t get me wrong: both Garoppolo and Carr deserved the money they landed as free agents. But if you look at the title-contending teams in the NFL over the last few years, you won’t find many quarterbacks making top dollar.

Thanks to the rookie wage scale, implemented after the 2011 lockout, NFL roster building is just as much accounting as it is scouting. There’s a model for success out there, one I would argue has been tried and proven — the Niners and Raiders don’t appear to be following it.

There have been seven Super Bowl winners since the rookie wage scale was implemented for the 2011 NFL Draft. The last six have been teams that, consciously or not, understood how that model works.

Three of those Super Bowl-winning teams have been led by quarterbacks on rookie contracts, making tens of millions less than their fair market value.

The other three were won by two all-time great quarterbacks — arguably the two greatest quarterbacks of all-time, Tom Brady and Peyton Manning — playing on below-market-rate contracts.

What’s even more interesting — and damning to the Niners and Raiders as we look forward — is that the losers in the Super Bowl seemingly understood the paradigm, too.

That was the past, though — the NFL is undergoing a spread-offense revolution that will radically change the game as we know it, right?

Well, looking at the current landscape of the league, I’d say that the roster-building model is holding strong. The NFL’s four best teams this season — the Rams, Chiefs, Patriots, Saints — all adhere to the aforementioned guidelines.

Jared Goff has led the Rams to an undefeated record, but as the 168th highest-paid player in the NFL, he allowed general manager Les Snead to add crazy talent to the roster this offseason and sign Todd Gurley to an extension.

Chiefs quarterback and MVP frontrunner Pat Mahomes’ contract is even more ridiculous — it’s worth two percent of the salary cap.

And just behind those two teams are two of the greatest quarterbacks of all time, who are making less than they could demand, even at their advanced ages:

• Brady, arguably the greatest player of all time, is the 11th highest-paid player in the league.

• Drew Brees, the fifth-highest paid QB in the NFL

And this season’s biggest disappointments? The model shows up with them, too.

The Jaguars missed their chance to compete for a title when quarterback Blake Bortles was on his rookie deal. Now they’re paying him 47 percent more than DeShaun Watson (who has the Texans in first place) and Mahomes, combined, and with their defense’s natural regression, they’re out of the playoff picture.

The Vikings and Falcons both gave quarterbacks $30 million per year deals this past offseason — is it any surprise that it looks like both teams appear to have taken a step back?

The rookie wage scale isn’t going anywhere, and quarterbacks will always be the highest-paid players in the sports, because a good quarterback can make a bad team good. We saw that with Carr in 2016 (he was on a rookie deal) and Garoppolo last year (also on a rookie deal).

But it takes more than that to win a Super Bowl.

To compete for titles — and that’s the goal, isn’t it? — teams either need to have a great quarterback on a rookie deal, allowing them to spend on 52 other roster spots, or you need to have a certain Hall of Fame signal-caller (the less he makes, the better).

(Conversations can be had about Ryan, whose Hall of Fame candidacy is hardly locked in, and Manning’s title with the Broncos, which was really won by Von Miller, who was on a rookie deal, and a great defense.)

This season, Garoppolo has the highest salary cap hit of any player in the NFL and Carr is third on that list. Those rankings will fall in the years to come, but these guys are on anything but artificially depressed contracts.

Perhaps the Niners and Raiders can build title-contending teams around those quarterbacks while having less pie to give out than other NFL teams — it’s certainly not impossible.

After all, Shanahan is one hell of an offensive coach — he proved that in Atlanta in 2016, when he took a Ryan-led team to the Super Bowl (that’s the outlier). Gruden might be a good offensive coach as well, and he has five first-round picks in the next two drafts — that’s plenty of cheap, talented labor to recreate the moonshot Broncos model, if he makes the right selections.

Hey, maybe Gruden and Niners general manager John Lynch will turn into West Coast Belichicks, establishing themselves as the best in the league at signing bargains.

But that’s asking for a lot across the board, isn’t it?

The way I see it, there’s a reason that Aaron Rodgers, whose cap hit has consistently been in the top-10 of the league (save for this year), has only been to one Super Bowl (in an uncapped, pre-lockout season, no less) and Matt Stafford has played only three playoff games.

They’re both exceptional quarterbacks (the former more than the latter, but both are Hall of Famers), but it takes far more than a good quarterback to win a title.

So really, the only question left to ask about the Niners and Raiders is this: Are Garoppolo and Carr going to the Hall of Fame?

They’re both talented and have coaches who, in theory, can get the most out of them. Perhaps that all-time-great best is yet to come for both quarterbacks.

For the sake of both teams, it better.

Because the paychecks have already arrived.