Skip to main content
gamedev.net
🔒 Locked

GLSL issues

Started by swiftcoder 2 replies 700+ views
Original Post
swiftcoder
swiftcoder
I have one query and one problem, hopefully you can answer both [smile] Firstly, glUseProgram(0) is not disabling shaders in my game. Any ideas on issues that could cause this/problems to look for? I have made sure that gluseprogram(0) is actually being called, and I can tell it is not disabled because I am rendering some fixed function geometry right after, which is inheriting the previously active program. (Never mind, I was re-enabling the last program by mistake) Secondly, in debugging this I decided to output all my program and shader handles, with this interesting result:
program:  1
shader:  2
shader:  3
program:  4
shader:  5
shader:  6

Is it entirely normal that my driver is using the same namespace for programs as for shaders? [Edited by - swiftcoder on February 26, 2008 8:18:55 AM]
Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]
polymorphed
polymorphed
Yes, that's normal.
A shader is basically independent until you add it to a program, and you can reuse it in other programs if you wish, so it's vital that everything has its own handle to avoid conflicts. [smile]
while (tired) DrinkCoffee();
swiftcoder
swiftcoder
Quote:
Original post by polymorphed
Yes, that's normal.
A shader is basically independent until you add it to a program, and you can reuse it in other programs if you wish, so it's vital that everything has its own handle to avoid conflicts. [smile]

I understand that, but in what case could a shader handle ever conflict with a program handle?
Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]
_the_phantom_
_the_phantom_
Never; the driver will handle the allocation of IDs as it sees fit. The number is effectively meaningless and could very well change between driver revisions and vendors (AMD for example allocates program and shader object at very high numbers, or at least did when I last checked).

In short, don't worry about it and just trust in the driver...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.