mirror of
https://github.com/AxioDL/boo.git
synced 2025-12-16 08:27:10 +00:00
More D3D12 work
This commit is contained in:
@@ -35,6 +35,7 @@ public:
|
||||
ITextureS* newStaticTexture(size_t width, size_t height, size_t mips, TextureFormat fmt,
|
||||
const void* data, size_t sz);
|
||||
ITextureD* newDynamicTexture(size_t width, size_t height, TextureFormat fmt);
|
||||
ITextureR* newRenderTexture(size_t width, size_t height, size_t samples);
|
||||
|
||||
IVertexFormat* newVertexFormat(size_t elementCount, const VertexElementDescriptor* elements);
|
||||
|
||||
|
||||
@@ -21,8 +21,7 @@ struct IGraphicsCommandQueue
|
||||
virtual const char* platformName() const=0;
|
||||
|
||||
virtual void setShaderDataBinding(IShaderDataBinding* binding)=0;
|
||||
virtual void setRenderTarget(IWindow* window)=0;
|
||||
virtual void setRenderTarget(ITextureD* target)=0;
|
||||
virtual void setRenderTarget(ITextureR* target)=0;
|
||||
virtual void setViewport(const SWindowRect& rect)=0;
|
||||
|
||||
virtual void setClearColor(const float rgba[4])=0;
|
||||
@@ -34,7 +33,7 @@ struct IGraphicsCommandQueue
|
||||
virtual void drawInstances(size_t start, size_t count, size_t instCount)=0;
|
||||
virtual void drawInstancesIndexed(size_t start, size_t count, size_t instCount)=0;
|
||||
|
||||
virtual void present()=0;
|
||||
virtual void resolveDisplay(ITextureR* source)=0;
|
||||
virtual void execute()=0;
|
||||
};
|
||||
|
||||
|
||||
@@ -41,19 +41,31 @@ enum BufferUse
|
||||
BufferUseUniform
|
||||
};
|
||||
|
||||
enum TextureType
|
||||
{
|
||||
TextureStatic,
|
||||
Texture
|
||||
};
|
||||
|
||||
struct ITexture
|
||||
{
|
||||
bool dynamic() const {return m_dynamic;}
|
||||
enum Type
|
||||
{
|
||||
TextureStatic,
|
||||
TextureDynamic,
|
||||
TextureRender
|
||||
};
|
||||
Type type() const {return m_type;}
|
||||
protected:
|
||||
bool m_dynamic;
|
||||
ITexture(bool dynamic) : m_dynamic(dynamic) {}
|
||||
Type m_type;
|
||||
ITexture(Type type) : m_type(type) {}
|
||||
};
|
||||
|
||||
/** Static resource buffer for textures */
|
||||
struct ITextureS : ITexture
|
||||
{
|
||||
protected:
|
||||
ITextureS() : ITexture(false) {}
|
||||
ITextureS() : ITexture(TextureStatic) {}
|
||||
};
|
||||
|
||||
/** Dynamic resource buffer for textures */
|
||||
@@ -63,7 +75,14 @@ struct ITextureD : ITexture
|
||||
virtual void* map(size_t sz)=0;
|
||||
virtual void unmap()=0;
|
||||
protected:
|
||||
ITextureD() : ITexture(true) {}
|
||||
ITextureD() : ITexture(TextureDynamic) {}
|
||||
};
|
||||
|
||||
/** Resource buffer for render-target textures */
|
||||
struct ITextureR : ITexture
|
||||
{
|
||||
protected:
|
||||
ITextureR() : ITexture(TextureRender) {}
|
||||
};
|
||||
|
||||
/** Supported texture formats */
|
||||
@@ -157,6 +176,8 @@ struct IGraphicsDataFactory
|
||||
const void* data, size_t sz)=0;
|
||||
virtual ITextureD*
|
||||
newDynamicTexture(size_t width, size_t height, TextureFormat fmt)=0;
|
||||
virtual ITextureR*
|
||||
newRenderTexture(size_t width, size_t height, size_t samples)=0;
|
||||
|
||||
virtual IVertexFormat*
|
||||
newVertexFormat(size_t elementCount, const VertexElementDescriptor* elements)=0;
|
||||
|
||||
Reference in New Issue
Block a user