Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 860 vs 863 for /trunk/Source Code/Platform/Video/Shaders/Headers/ShaderProgram.h

Diff revisions: vs.
  @@ -54,10 +54,10 @@
54 54
55 55 FWD_DECLARE_MANAGED_CLASS(ShaderProgram);
56 56
57 - class NOINITVTABLE ShaderProgram : public Resource,
57 + class NOINITVTABLE ShaderProgram : public CachedResource,
58 58 public GraphicsResource {
59 59 public:
60 - typedef hashMapImpl<U64, ShaderProgram_ptr> ShaderProgramMap;
60 + typedef hashMapImpl<size_t, ShaderProgram_ptr> ShaderProgramMap;
61 61 typedef hashMapImpl<U64, stringImpl> AtomMap;
62 62 typedef std::stack<ShaderProgram_ptr, vectorImpl<ShaderProgram_ptr> > ShaderQueue;
63 63 /// A list of built-in sampler slots. Use these if possible
  @@ -96,6 +96,7 @@
96 96 };
97 97
98 98 explicit ShaderProgram(GFXDevice& context,
99 + size_t descriptorHash,
99 100 const stringImpl& name,
100 101 const stringImpl& resourceName,
101 102 const stringImpl& resourceLocation,
  @@ -108,7 +109,7 @@
108 109 /// Is the shader ready for drawing?
109 110 virtual bool isValid() const = 0;
110 111 virtual bool update(const U64 deltaTime);
111 - virtual bool load(const DELEGATE_CBK<void, Resource_wptr>& onLoadCallback) override;
112 + virtual bool load(const DELEGATE_CBK<void, CachedResource_wptr>& onLoadCallback) override;
112 113 virtual bool unload() override;
113 114
114 115 /// Uniforms (update constant buffer for D3D. Use index as location in
  @@ -263,9 +264,9 @@
263 264 static void shaderFileRead(const stringImpl& filePath, bool buildVariant, stringImpl& sourceCodeOut);
264 265 static void shaderFileWrite(const stringImpl& atomName, const char* sourceCode);
265 266 /// Remove a shaderProgram from the program cache
266 - static bool unregisterShaderProgram(const stringImpl& name);
267 + static bool unregisterShaderProgram(size_t shaderHash);
267 268 /// Add a shaderProgram to the program cache
268 - static void registerShaderProgram(const stringImpl& name, const ShaderProgram_ptr& shaderProgram);
269 + static void registerShaderProgram(const ShaderProgram_ptr& shaderProgram);
269 270 /// Bind the null shader
270 271 static bool unbind();
271 272 /// Return a default shader used for general purpose rendering