Texas legislators and the various interests they represent are in the midst of their biennial budget struggle. But unlike other states, the problem here is a giant surplus.

The surplus amounts to $3 billion - that's billion, not million - out of total revenues of $16 billion. And if there's one thing the legislators have more of than cash, it's ideas on how to spend it.

In fact, spending plans that encompass such projects as vaccinating 2.5 million calves across the state against brucellosis and building a roof over a house constructed of salt threaten to consume the entire $3 billion and $400 million more besides.

And despite the apparently frivolous nature of some of the proposals, the debate has been anything but good-natured. After the House Appropriations Committee recommended a two-year budget that would have run a $400 million deficit, its chairman washed his hands of it, urging the full House to do what it chose to get the measure into balance.

The bitterness of the debate was reflected in arguments over whether to cut the brucellosis program or limit funding for Aid to Families with Independent Children (AFDC).

Angry liberals tagged the brucellosis program Aid to Farmers with Dependent Cows.

The cows finally lost. The House eliminated the $4 million vaccine program.

But the welfare children also suffered. The House reduced the proposed increase for AFDC payments from $8.68 per child per month to $3, which would mean a grand total of $35 per child. There has been no increase in Texas AFDC payments since, 1969.

But the legislators were more generous with other items. One survivor was $17,000 to build the roof over the salt house in Grand Saline, a town of 2,300 in rural northeast Texas.

Fighting an amendment to delete that item, Rep. Bill Hollowell pleaded that the salt house would be a boon to tourism, which he said is lower in his district than anywhere else in all of Texas.

"This is the first time I have asked for anything special for my district," cried Hollowell, a veteran of 16 years.

The House obliged.

But it was even more obliging when it came to a pay raise for the state's 240 district court judges, voting to boost those salaries from 32,800 per year to $44,800.

The victorious proponents cited the importance of good pay in getting high caliber judges on the court Scant mention was made of the fact that retirement benefits of the legislators are tied to the level of judges' pay.If the $12,000 boost stays in, it would kick the annual retirement benefit for a legislator with 30 years' service to $26,880, up $7,200 from the present level.

The legislature's sense of priorities is reflected in the House decision to eliminate $72 million for expansion of a prison system that is bulging with more than 20,000 inmates, and also in its vote for minimal increases in support of mental health and mental retardation programs.

By contrast, the legislature already has passed and Gov. Dolph Briscoe has signed, a bill increasing state funding of highways $528 million over the next two years. It will mean an outlay of more than $1 billion a year to help assure what the governor hailed at "the finest highway system in the world."

The $3 billion bonanza stems largely from greater state revenues from its percentage taxes on the production of oil and natural gas. As the prices of those products have spiraled upward because of the national energy crunch, the Texas state treasury has been the beneficiary.