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

gfxutil: cache opened Shaders/Textures to aide anti-readers. #75

Closed
slimsag opened this issue Dec 21, 2014 · 1 comment
Closed

gfxutil: cache opened Shaders/Textures to aide anti-readers. #75

slimsag opened this issue Dec 21, 2014 · 1 comment
Assignees
Milestone

Comments

@slimsag
Copy link
Contributor

slimsag commented Dec 21, 2014

There are those anti-readers whom will not read the documentation but rather copy+paste example code in an effort to construct their games.

The downside to this is that they often end up creating several hundred shader/texture objects which is incredibly slow.

If the gfxutil.OpenShader and gfxutil.OpenTexture utility functions used a cache and returned the same shader/texture object in the event that the user specifies the same path, we could aid this specific case.

@slimsag slimsag added this to the Version 2 milestone Dec 21, 2014
@slimsag slimsag self-assigned this Dec 21, 2014
@slimsag slimsag changed the title gfxutil: cache opened Shaders/Textures to prevent anti-readers. gfxutil: cache opened Shaders/Textures to aide anti-readers. Dec 21, 2014
@slimsag
Copy link
Contributor Author

slimsag commented Dec 24, 2014

Today and yesterday I had the need to reload a shader I'd opened via gfxutil.OpenShader for development (I just bound the R key to perform reloading).

Of course, the shader was cached so I can't use gfxutil.OpenShader anymore. Then we have a few options:

  • Add something to clear the cache (gfxutil.ReopenShader).
  • Check the last-modified date on the file.
  • Revert the change.

I want the utility package to be simple, not a full-blown asset management package. For this reason I am opting for no. 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant