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

bug fix for removing texture #1850

Closed
wants to merge 1 commit into from
Closed

Conversation

NolaDonato
Copy link
Contributor

When a texture is set to null, GearVRf was not always regenerating the shader. This patch fixes that - issue #1848.
GearVRF DCO signed off by: Nola Donato [email protected]

When a texture is set to null, GearVRf was not always regenerating the shader. This patch fixes that - issue Samsung#1848
@@ -68,7 +68,7 @@ void ShaderData::setTexture(const char* key, Texture* texture)
if (temp.compare(key) == 0)
{
Texture* oldtex = mTextures[i];
makeDirty(oldtex ? MOD_TEXTURE : NEW_TEXTURE);
makeDirty(((oldtex != nullptr) && (texture != nullptr)) ? MOD_TEXTURE : NEW_TEXTURE);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference between MOD_TEXTURE and NEW_TEXTURE? Also I don't see obvious use of MOD_TEXTURE.

@NolaDonato
Copy link
Contributor Author

MOD_TEXTURE means you are changing which texture the material uses. NEW_TEXTURE means that a) the material had a texture previously and you are removing it or b) the material did not have a texture previously and you are adding it. Cases A and B require the shader to be changed. MOD_TEXTURE does not.

@NolaDonato
Copy link
Contributor Author

This PR is not finished yet. I am working with a user and there is still a case that fails.

@NolaDonato NolaDonato closed this May 16, 2018
@NolaDonato NolaDonato deleted the removetex branch May 16, 2018 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants