Commit 9c540247 authored by Philip Trettner's avatar Philip Trettner

async tex support in new uniform syntax

parent 9d530fda
......@@ -57,4 +57,18 @@ struct BoundShaderStorageBuffer;
struct BoundTransformFeedback;
struct BoundUniformBuffer;
struct BoundVertexArray;
template <class TextureT>
struct AsyncTexture;
using AsyncTexture1D = AsyncTexture<Texture1D>;
using AsyncTexture2D = AsyncTexture<Texture2D>;
using AsyncTexture3D = AsyncTexture<Texture3D>;
using AsyncTextureBuffer = AsyncTexture<TextureBuffer>;
using AsyncTexture1DArray = AsyncTexture<Texture1DArray>;
using AsyncTexture2DArray = AsyncTexture<Texture2DArray>;
using AsyncTextureCubeMap = AsyncTexture<TextureCubeMap>;
using AsyncTextureRectangle = AsyncTexture<TextureRectangle>;
using AsyncTextureCubeMapArray = AsyncTexture<TextureCubeMapArray>;
using AsyncTexture2DMultisample = AsyncTexture<Texture2DMultisample>;
using AsyncTexture2DMultisampleArray = AsyncTexture<Texture2DMultisampleArray>;
}
......@@ -162,5 +162,10 @@ void uniform_proxy::operator=(std::shared_ptr<TextureT> const& tex) &&
{
prog.setTexture(name, tex);
}
template <class TextureT>
void uniform_proxy::operator=(AsyncTexture<TextureT> const& tex) &&
{
prog.setTexture(name, tex.texture());
}
}
}
......@@ -80,16 +80,4 @@ private:
friend class AsyncTextureLoader;
};
using AsyncTexture1D = AsyncTexture<Texture1D>;
using AsyncTexture2D = AsyncTexture<Texture2D>;
using AsyncTexture3D = AsyncTexture<Texture3D>;
using AsyncTextureBuffer = AsyncTexture<TextureBuffer>;
using AsyncTexture1DArray = AsyncTexture<Texture1DArray>;
using AsyncTexture2DArray = AsyncTexture<Texture2DArray>;
using AsyncTextureCubeMap = AsyncTexture<TextureCubeMap>;
using AsyncTextureRectangle = AsyncTexture<TextureRectangle>;
using AsyncTextureCubeMapArray = AsyncTexture<TextureCubeMapArray>;
using AsyncTexture2DMultisample = AsyncTexture<Texture2DMultisample>;
using AsyncTexture2DMultisampleArray = AsyncTexture<Texture2DMultisampleArray>;
}
......@@ -54,6 +54,8 @@ struct uniform_proxy
void operator=(std::initializer_list<T> v) &&;
template <class TextureT>
void operator=(std::shared_ptr<TextureT> const& tex) &&;
template <class TextureT>
void operator=(AsyncTexture<TextureT> const& tex) &&;
template <class T>
void operator=(T const&) &
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment