Fixes for GPU resources C# object types
This commit is contained in:
@@ -137,6 +137,7 @@ GPUBuffer* GPUBuffer::New()
|
||||
}
|
||||
|
||||
GPUBuffer::GPUBuffer()
|
||||
: GPUResource(SpawnParams(Guid::New(), TypeInitializer))
|
||||
{
|
||||
// Buffer with size 0 is considered to be invalid
|
||||
_desc.Size = 0;
|
||||
|
||||
@@ -35,6 +35,11 @@ GPUPipelineState* GPUPipelineState::New()
|
||||
return GPUDevice::Instance->CreatePipelineState();
|
||||
}
|
||||
|
||||
GPUPipelineState::GPUPipelineState()
|
||||
: GPUResource(SpawnParams(Guid::New(), TypeInitializer))
|
||||
{
|
||||
}
|
||||
|
||||
bool GPUPipelineState::Init(const Description& desc)
|
||||
{
|
||||
// Cache description in debug builds
|
||||
@@ -177,7 +182,7 @@ GPUPipelineState::Description GPUPipelineState::Description::DefaultFullscreenTr
|
||||
};
|
||||
|
||||
GPUResource::GPUResource()
|
||||
: ScriptingObject(SpawnParams(Guid::New(), GPUResource::TypeInitializer))
|
||||
: ScriptingObject(SpawnParams(Guid::New(), TypeInitializer))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -109,6 +109,8 @@ public:
|
||||
protected:
|
||||
ShaderBindings _meta;
|
||||
|
||||
GPUPipelineState();
|
||||
|
||||
public:
|
||||
#if BUILD_DEBUG
|
||||
/// <summary>
|
||||
|
||||
@@ -144,7 +144,8 @@ public:
|
||||
/// <param name="device">The graphics device.</param>
|
||||
/// <param name="name">The resource name.</param>
|
||||
GPUResourceBase(DeviceType* device, const StringView& name) noexcept
|
||||
: _device(device)
|
||||
: BaseType()
|
||||
, _device(device)
|
||||
{
|
||||
#if GPU_ENABLE_RESOURCE_NAMING
|
||||
if (name.HasChars())
|
||||
|
||||
@@ -59,6 +59,7 @@ uint32 GPUShaderProgramsContainer::CalculateHash(const StringAnsiView& name, int
|
||||
}
|
||||
|
||||
GPUShader::GPUShader()
|
||||
: GPUResource(SpawnParams(Guid::New(), TypeInitializer))
|
||||
{
|
||||
Platform::MemoryClear(_constantBuffers, sizeof(_constantBuffers));
|
||||
}
|
||||
|
||||
@@ -74,9 +74,6 @@ protected:
|
||||
GPUShaderProgramsContainer _shaders;
|
||||
GPUConstantBuffer* _constantBuffers[MAX_CONSTANT_BUFFER_SLOTS];
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GPUShader"/> class.
|
||||
/// </summary>
|
||||
GPUShader();
|
||||
|
||||
public:
|
||||
|
||||
@@ -76,6 +76,7 @@ GPUSampler* GPUSampler::New()
|
||||
}
|
||||
|
||||
GPUSampler::GPUSampler()
|
||||
: GPUResource(SpawnParams(Guid::New(), TypeInitializer))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ GPUTexture* GPUTexture::New()
|
||||
}
|
||||
|
||||
GPUTexture::GPUTexture()
|
||||
: GPUResource(SpawnParams(Guid::New(), GPUTexture::TypeInitializer))
|
||||
: GPUResource(SpawnParams(Guid::New(), TypeInitializer))
|
||||
, _residentMipLevels(0)
|
||||
, _sRGB(false)
|
||||
, _isBlockCompressed(false)
|
||||
@@ -423,7 +423,6 @@ bool GPUTexture::Init(const GPUTextureDescription& desc)
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case TextureDimensions::VolumeTexture:
|
||||
{
|
||||
if (desc.IsDepthStencil())
|
||||
@@ -461,7 +460,6 @@ bool GPUTexture::Init(const GPUTextureDescription& desc)
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case TextureDimensions::CubeTexture:
|
||||
{
|
||||
if (desc.HasPerSliceViews())
|
||||
|
||||
@@ -79,9 +79,6 @@ protected:
|
||||
bool _sRGB, _isBlockCompressed;
|
||||
GPUTextureDescription _desc;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GPUTexture"/> class.
|
||||
/// </summary>
|
||||
GPUTexture();
|
||||
|
||||
public:
|
||||
|
||||
@@ -128,7 +128,7 @@ public:
|
||||
/// <param name="device">The graphics device.</param>
|
||||
/// <param name="name">The resource name.</param>
|
||||
GPUResourceDX11(GPUDeviceDX11* device, const StringView& name) noexcept
|
||||
: GPUResourceBase(device, name)
|
||||
: GPUResourceBase<GPUDeviceDX11, BaseType>(device, name)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user