Skip to content

Commit

Permalink
Removed "SamplerArray" and "TextureArray" interfaces (use "ResourceHe…
Browse files Browse the repository at this point in the history
…ap" instead).
  • Loading branch information
LukasBanana committed Jul 2, 2018
1 parent 6d31e31 commit 1d49e1f
Show file tree
Hide file tree
Showing 41 changed files with 23 additions and 931 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Progress
|----------|:--------:|---------|
| OpenGL | ~90% | |
| Direct3D 11 | ~85% | Depth-textures are incomplete |
| Direct3D 12 | ~15% | Experimental state; Tutorials working: 01, (02), (03), 06, 07, (10) |
| Direct3D 12 | ~15% | Experimental state; Tutorials working: 01, 02, (03), 06, 07, (10) |
| Vulkan | ~30% | Experimental state; Tutorials working: 01, 02, 03, 06, 07, 10 |

| Platform | Progress | Remarks |
Expand Down
2 changes: 1 addition & 1 deletion include/LLGL/BufferArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace LLGL
\brief Hardware buffer container interface.
\remarks This array can only contain buffers which are all from the same type,
like an array of vertex buffers for instance.
\todo Maybe rename this to "BufferHeap".
\todo Maybe rename this to "BufferHeap" or "VertexArray".
\see RenderSystem::CreateBufferArray
*/
class LLGL_EXPORT BufferArray : public RenderSystemChild
Expand Down
4 changes: 0 additions & 4 deletions include/LLGL/CommandBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@

#include "Buffer.h"
#include "BufferArray.h"
#include "Texture.h"
#include "TextureArray.h"
#include "Sampler.h"
#include "SamplerArray.h"
#include "ResourceHeap.h"
#include "PipelineLayoutFlags.h"

Expand Down
35 changes: 1 addition & 34 deletions include/LLGL/CommandBufferExt.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@


#include "CommandBuffer.h"
#include "Buffer.h"
#include "BufferArray.h"
#include "Texture.h"
#include "TextureArray.h"
#include "Sampler.h"
#include "SamplerArray.h"
#include "ForwardDecls.h"


namespace LLGL
Expand Down Expand Up @@ -46,14 +41,6 @@ class LLGL_EXPORT CommandBufferExt : public CommandBuffer
*/
virtual void SetConstantBuffer(Buffer& buffer, std::uint32_t slot, long stageFlags = StageFlags::AllStages) = 0;

/**
\brief Sets the active array of constant buffers at the specified start slot index.
\param[in] bufferArray Specifies the constant buffer array to set.
\see RenderSystem::CreateBufferArray
\see SetConstantBuffer
*/
virtual void SetConstantBufferArray(BufferArray& bufferArray, std::uint32_t startSlot, long stageFlags = StageFlags::AllStages) = 0;

/* ----- Storage Buffers ----- */

/**
Expand All @@ -68,14 +55,6 @@ class LLGL_EXPORT CommandBufferExt : public CommandBuffer
*/
virtual void SetStorageBuffer(Buffer& buffer, std::uint32_t slot, long stageFlags = StageFlags::AllStages) = 0;

/**
\brief Sets the active array of storage buffers at the specified start slot index.
\param[in] bufferArray Specifies the storage buffer array to set.
\see RenderSystem::CreateBufferArray
\see SetStorageBuffer
*/
virtual void SetStorageBufferArray(BufferArray& bufferArray, std::uint32_t startSlot, long stageFlags = StageFlags::AllStages) = 0;

/* ----- Textures ----- */

/**
Expand All @@ -85,12 +64,6 @@ class LLGL_EXPORT CommandBufferExt : public CommandBuffer
*/
virtual void SetTexture(Texture& texture, std::uint32_t slot, long stageFlags = StageFlags::AllStages) = 0;

/**
\brief Sets the active array of textures at the specified start slot index.
\see SetTexture
*/
virtual void SetTextureArray(TextureArray& textureArray, std::uint32_t startSlot, long stageFlags = StageFlags::AllStages) = 0;

/* ----- Samplers ----- */

/**
Expand All @@ -101,12 +74,6 @@ class LLGL_EXPORT CommandBufferExt : public CommandBuffer
*/
virtual void SetSampler(Sampler& sampler, std::uint32_t slot, long stageFlags = StageFlags::AllStages) = 0;

/**
\brief Sets the active array of samplers at the specified start slot index.
\see SetSampler
*/
virtual void SetSamplerArray(SamplerArray& samplerArray, std::uint32_t startSlot, long stageFlags = StageFlags::AllStages) = 0;

protected:

CommandBufferExt() = default;
Expand Down
4 changes: 2 additions & 2 deletions include/LLGL/ForwardDecls.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@ class RenderTarget;
class Resource;
class ResourceHeap;
class Sampler;
class SamplerArray;
class Shader;
class ShaderProgram;
class ShaderUniform;
class Surface;
class Texture;
class TextureArray;
class Timer;
class Window;

Expand Down Expand Up @@ -73,6 +71,8 @@ struct ResourceHeapDescriptor;
struct ResourceViewDescriptor;
struct SamplerDescriptor;
struct Scissor;
struct ShaderDescriptor;
struct ShaderProgramDescriptor;
struct ShaderReflectionDescriptor;
struct SrcImageDescriptor;
struct StencilDescriptor;
Expand Down
2 changes: 1 addition & 1 deletion include/LLGL/GraphicsPipelineFlags.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ enum class CullMode
\brief Logical pixel operation enumeration.
\remarks These logical pixel operations are bitwise operations.
In the following documentation, 'src' denotes the source color and 'dst' denotes the destination color.
\note Only supported with: OpenGL, Vulkan.
\note Only supported with: OpenGL, Vulkan, Direct3D 11.1+, Direct3D 12.0.
*/
enum class LogicOp
{
Expand Down
1 change: 0 additions & 1 deletion include/LLGL/RenderContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "BufferArray.h"
#include "ShaderProgram.h"
#include "Texture.h"
#include "TextureArray.h"
#include "RenderTarget.h"
#include "GraphicsPipeline.h"
#include "ComputePipeline.h"
Expand Down
43 changes: 1 addition & 42 deletions include/LLGL/RenderSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
#include "Buffer.h"
#include "BufferArray.h"
#include "Texture.h"
#include "TextureArray.h"
#include "Sampler.h"
#include "SamplerArray.h"
#include "ResourceHeap.h"

#include "RenderTarget.h"
Expand Down Expand Up @@ -225,6 +223,7 @@ class LLGL_EXPORT RenderSystem : public NonCopyable
\throws std::invalid_argument If 'numBuffers' is 0, if 'bufferArray' is null,
if any of the pointers in the array are null, if not all buffers have the same type, or if the buffer array type is
not one of these: BufferType::Vertex, BufferType::Constant, BufferType::Storage, or BufferType::StreamOutput.
\todo Rename to "CreateVertexArray".
*/
virtual BufferArray* CreateBufferArray(std::uint32_t numBuffers, Buffer* const * bufferArray) = 0;

Expand Down Expand Up @@ -275,27 +274,9 @@ class LLGL_EXPORT RenderSystem : public NonCopyable
*/
virtual Texture* CreateTexture(const TextureDescriptor& textureDesc, const SrcImageDescriptor* imageDesc = nullptr) = 0;

/**
\brief Creates a new texture array.
\param[in] numTextures Specifies the number of textures in the array. This must be greater than 0.
\param[in] textureArray Pointer to an array of Texture object pointers. This must not be null.
\remarks This texture array is not an "array texture" (like TextureType::Texture2DArray for instance).
It is just a container of multiple texture objects, which can be used to bind several hardware textures at once, to improve performance.
\throws std::invalid_argument If 'numTextures' is 0, if 'textureArray' is null,
or if any of the pointers in the array are null.
\deprecated TextureArray interface will be removed soon, use ResourceHeap interface instead.
*/
virtual TextureArray* CreateTextureArray(std::uint32_t numTextures, Texture* const * textureArray) = 0;

//! Releases the specified texture object. After this call, the specified object must no longer be used.
virtual void Release(Texture& texture) = 0;

/**
\brief Releases the specified texture array object. After this call, the specified object must no longer be used.
\deprecated TextureArray interface will be removed soon, use ResourceHeap interface instead.
*/
virtual void Release(TextureArray& textureArray) = 0;

/**
\brief Updates the image data of the specified texture.
\param[in] texture Specifies the texture whose data is to be updated.
Expand Down Expand Up @@ -374,25 +355,9 @@ class LLGL_EXPORT RenderSystem : public NonCopyable
*/
virtual Sampler* CreateSampler(const SamplerDescriptor& desc) = 0;

/**
\brief Creates a new sampler array.
\param[in] numSamplers Specifies the number of samplers in the array. This must be greater than 0.
\param[in] samplerArray Pointer to an array of Sampler object pointers. This must not be null.
\throws std::invalid_argument If 'numSamplers' is 0, if 'samplerArray' is null,
or if any of the pointers in the array are null.
\deprecated SamplerArray interface will be removed soon, use ResourceHeap interface instead.
*/
virtual SamplerArray* CreateSamplerArray(std::uint32_t numSamplers, Sampler* const * samplerArray) = 0;

//! Releases the specified Sampler object. After this call, the specified object must no longer be used.
virtual void Release(Sampler& sampler) = 0;

/**
\brief Releases the specified sampler array object. After this call, the specified object must no longer be used.
\deprecated SamplerArray interface will be removed soon, use ResourceHeap interface instead.
*/
virtual void Release(SamplerArray& samplerArray) = 0;

/* ----- Resource Heaps ----- */

/**
Expand Down Expand Up @@ -526,12 +491,6 @@ class LLGL_EXPORT RenderSystem : public NonCopyable
//! Validates the specified arguments to be used for buffer array creation.
void AssertCreateBufferArray(std::uint32_t numBuffers, Buffer* const * bufferArray);

//! Validates the specified arguments to be used for texture array creation.
void AssertCreateTextureArray(std::uint32_t numTextures, Texture* const * textureArray);

//! Validates the specified arguments to be used for sampler array creation.
void AssertCreateSamplerArray(std::uint32_t numSamplers, Sampler* const * samplerArray);

//! Validates the specified shader descriptor.
void AssertCreateShader(const ShaderDescriptor& desc);

Expand Down
34 changes: 0 additions & 34 deletions include/LLGL/SamplerArray.h

This file was deleted.

34 changes: 0 additions & 34 deletions include/LLGL/TextureArray.h

This file was deleted.

64 changes: 2 additions & 62 deletions sources/Renderer/DebugLayer/DbgCommandBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,22 +232,6 @@ void DbgCommandBuffer::SetConstantBuffer(Buffer& buffer, std::uint32_t slot, lon
LLGL_DBG_PROFILER_DO(setConstantBuffer.Inc());
}

void DbgCommandBuffer::SetConstantBufferArray(BufferArray& bufferArray, std::uint32_t startSlot, long stageFlags)
{
AssertCommandBufferExt(__func__);

if (debugger_)
{
LLGL_DBG_SOURCE;
ValidateBufferType(bufferArray.GetType(), BufferType::Constant);
ValidateStageFlags(stageFlags, StageFlags::AllStages);
}

instanceExt->SetConstantBufferArray(bufferArray, startSlot, stageFlags);

LLGL_DBG_PROFILER_DO(setConstantBuffer.Inc());
}

/* ----- Storage Buffers ------ */

void DbgCommandBuffer::SetStorageBuffer(Buffer& buffer, std::uint32_t slot, long stageFlags)
Expand All @@ -268,22 +252,6 @@ void DbgCommandBuffer::SetStorageBuffer(Buffer& buffer, std::uint32_t slot, long
LLGL_DBG_PROFILER_DO(setStorageBuffer.Inc());
}

void DbgCommandBuffer::SetStorageBufferArray(BufferArray& bufferArray, std::uint32_t startSlot, long stageFlags)
{
AssertCommandBufferExt(__func__);

if (debugger_)
{
LLGL_DBG_SOURCE;
ValidateBufferType(bufferArray.GetType(), BufferType::Storage);
ValidateStageFlags(stageFlags, StageFlags::AllStages);
}

instanceExt->SetStorageBufferArray(bufferArray, startSlot, stageFlags);

LLGL_DBG_PROFILER_DO(setStorageBuffer.Inc());
}

/* ----- Stream Output Buffers ------ */

void DbgCommandBuffer::SetStreamOutputBuffer(Buffer& buffer)
Expand Down Expand Up @@ -362,21 +330,6 @@ void DbgCommandBuffer::SetTexture(Texture& texture, std::uint32_t slot, long sta
LLGL_DBG_PROFILER_DO(setTexture.Inc());
}

void DbgCommandBuffer::SetTextureArray(TextureArray& textureArray, std::uint32_t startSlot, long stageFlags)
{
AssertCommandBufferExt(__func__);

if (debugger_)
{
LLGL_DBG_SOURCE;
ValidateStageFlags(stageFlags, StageFlags::AllStages);
}

instanceExt->SetTextureArray(textureArray, startSlot, stageFlags);

LLGL_DBG_PROFILER_DO(setTexture.Inc());
}

/* ----- Sampler States ----- */

void DbgCommandBuffer::SetSampler(Sampler& sampler, std::uint32_t slot, long stageFlags)
Expand All @@ -394,28 +347,15 @@ void DbgCommandBuffer::SetSampler(Sampler& sampler, std::uint32_t slot, long sta
LLGL_DBG_PROFILER_DO(setSampler.Inc());
}

void DbgCommandBuffer::SetSamplerArray(SamplerArray& samplerArray, std::uint32_t startSlot, long stageFlags)
{
AssertCommandBufferExt(__func__);

if (debugger_)
{
LLGL_DBG_SOURCE;
ValidateStageFlags(stageFlags, StageFlags::AllStages);
}

instanceExt->SetSamplerArray(samplerArray, startSlot, stageFlags);

LLGL_DBG_PROFILER_DO(setSampler.Inc());
}

/* ----- Resource View Heaps ----- */

//TODO: record bindings
void DbgCommandBuffer::SetGraphicsResourceHeap(ResourceHeap& resourceHeap, std::uint32_t firstSet)
{
instance.SetGraphicsResourceHeap(resourceHeap, firstSet);
}

//TODO: record bindings
void DbgCommandBuffer::SetComputeResourceHeap(ResourceHeap& resourceHeap, std::uint32_t firstSet)
{
instance.SetComputeResourceHeap(resourceHeap, firstSet);
Expand Down

0 comments on commit 1d49e1f

Please sign in to comment.