Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading Cg shader with explicit profile will use profile in subsequent shaders #863

Closed
rdb opened this issue Jan 30, 2020 · 0 comments
Closed
Labels
bug

Comments

@rdb
Copy link
Member

@rdb rdb commented Jan 30, 2020

When loading a Cg shader with an explicit //Cg profile vp30 fp30, this will make these the new default active profiles, and subsequent shaders may fail to load if they don't work with the active profile.

This is unexpected. A //Cg profile should only affect the shader itself.

To reproduce, run this and observe the debug output:

from panda3d.core import *
load_prc_file_data("", "notify-level-shader debug")


sha1 = Shader.make("""
//Cg
//Cg profile vp30 fp30

void vshader(out float4 l_position : HPOS) { l_position = float4(0, 0, 0, 0); }
void fshader() {}

""", Shader.SL_Cg)

sha2 = Shader.make("""
//Cg

void vshader(out float4 l_position : HPOS) { l_position = float4(0, 0, 0, 0); }
void fshader() {}

""", Shader.SL_Cg)
@rdb rdb added the bug label Jan 30, 2020
@rdb rdb closed this in e13e985 Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.