Well, possession of marijuana, less than 2 oz, is considered a class B misdemeanor in Texas. A class B misdemeanor carries a maximum punishment of up to 180 days in jail and a $2,000 fine. A conviction would also include a drivers license suspension.
Make sure to hire a competent attorney!
Having said that, you will likely have a few options. You might be eligible for a pre-trial diversion. Which is basically a probation that isn't registered on the books anywhere. Once completed, the case is dismissed and you can get it expunged.
You will likely be offered a Deferred Adjudication type of probation. Basically a probation that is on the books but is not considered a conviction. You cannot expunge it, but you can "seal" it with a petition for non-disclosure. Since it isn't a conviction, it saves your license.
You might be offered "straight" probation. This is considered a conviction and is on the books and you lose your license.
You will be offered jail time. Also might be offered a time served plea, meaning you just pay a fine. This is a conviction and you lose your license.
You might also have some chances to challenge the case on the merits. The cop may not have pulled you over for a valid reason. Maybe the search was bad. Maybe they can't tie you to the dope.
Get a decent lawyer that will fight for you and get you the best outcome possible.