Skip to content

Commit

Permalink
[CI] Fixed compile warnings of deprecated fields.
Browse files Browse the repository at this point in the history
LLGL_DEPRECATED_IGNORE_PUSH()/POP() must be declared around the structs with deprecated fields,
not just around the explicitly declared constructors.
  • Loading branch information
LukasBanana committed Sep 22, 2024
1 parent 591426e commit 738a0ec
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 52 deletions.
13 changes: 4 additions & 9 deletions include/LLGL/RenderSystemFlags.h
Original file line number Diff line number Diff line change
Expand Up @@ -454,21 +454,14 @@ struct RenderSystemDescriptor
#endif // /LLGL_OS_ANDROID
};

LLGL_DEPRECATED_IGNORE_PUSH()

/**
\brief Contains the attributes for all supported rendering features.
\see RenderingCapabilities::features
*/
struct RenderingFeatures
{
LLGL_DEPRECATED_IGNORE_PUSH()

// Declared to ignore initialization warning of deprecated members
RenderingFeatures() = default;
RenderingFeatures(const RenderingFeatures&) = default;
RenderingFeatures& operator = (const RenderingFeatures&) = default;

LLGL_DEPRECATED_IGNORE_POP()

/**
\brief Specifies whether render targets (also "framebuffer objects") are supported.
\todo Deprecate this field: All backends should support render targets.
Expand Down Expand Up @@ -671,6 +664,8 @@ struct RenderingFeatures
bool hasRenderCondition = false;
};

LLGL_DEPRECATED_IGNORE_POP()

/**
\brief Contains all rendering limitations such as maximum buffer size, maximum texture resolution etc.
\see RenderingCapabilities::limits
Expand Down
8 changes: 4 additions & 4 deletions include/LLGL/ResourceHeapFlags.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ struct ResourceViewDescriptor
std::uint32_t initialCount = 0;
};

LLGL_DEPRECATED_IGNORE_PUSH()

/**
\brief Resource heap descriptor structure.
\remarks For the render systems of modern graphics APIs (i.e. Vulkan and Direct3D 12), a resource heap is the only way to bind hardware resources to a shader pipeline.
Expand All @@ -109,8 +111,6 @@ struct ResourceHeapDescriptor
{
ResourceHeapDescriptor() = default;

LLGL_DEPRECATED_IGNORE_PUSH()

//! Initializes the resource heap descriptor with the specified pipeline layout and optional secondary parameters.
inline ResourceHeapDescriptor(PipelineLayout* pipelineLayout, std::uint32_t numResourceViews = 0) :
pipelineLayout { pipelineLayout },
Expand All @@ -127,8 +127,6 @@ struct ResourceHeapDescriptor
{
}

LLGL_DEPRECATED_IGNORE_POP()

/**
\brief Optional name for debugging purposes. By default null.
\remarks The final name of the native hardware resource is implementation defined.
Expand All @@ -154,6 +152,8 @@ struct ResourceHeapDescriptor
long barrierFlags = 0;
};

LLGL_DEPRECATED_IGNORE_POP()


} // /namespace LLGL

Expand Down
44 changes: 5 additions & 39 deletions include/LLGL/ShaderFlags.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,52 +280,18 @@ struct ComputeShaderAttributes
Extent3D workGroupSize = { 1, 1, 1 };
};

LLGL_DEPRECATED_IGNORE_PUSH()

/**
\brief Shader source and binary code descriptor structure.
\see RenderSystem::CreateShader
*/
struct ShaderDescriptor
{
LLGL_DEPRECATED_IGNORE_PUSH()

ShaderDescriptor() = default;

#if 1 //TODO: remove as soon as 'name' field is removed
inline ShaderDescriptor(const ShaderDescriptor& other) :
debugName { other.debugName },
type { other.type },
source { other.source },
sourceSize { other.sourceSize },
sourceType { other.sourceType },
entryPoint { other.entryPoint },
profile { other.profile },
defines { other.defines },
flags { other.flags },
vertex { other.vertex },
fragment { other.fragment },
compute { other.compute }
{
}
inline ShaderDescriptor& operator = (const ShaderDescriptor& other)
{
this->debugName = other.debugName;
this->type = other.type;
this->source = other.source;
this->sourceSize = other.sourceSize;
this->sourceType = other.sourceType;
this->entryPoint = other.entryPoint;
this->profile = other.profile;
this->defines = other.defines;
this->flags = other.flags;
this->vertex = other.vertex;
this->fragment = other.fragment;
this->compute = other.compute;
return *this;
}
#else
ShaderDescriptor(const ShaderDescriptor&) = default;
ShaderDescriptor& operator = (const ShaderDescriptor&) = default;
#endif

//! Constructor to initialize the shader descriptor with a source filename.
inline ShaderDescriptor(const ShaderType type, const char* source) :
Expand All @@ -350,8 +316,6 @@ struct ShaderDescriptor
{
}

LLGL_DEPRECATED_IGNORE_POP()

/**
\brief Optional name for debugging purposes. By default null.
\remarks The final name of the native hardware resource is implementation defined.
Expand Down Expand Up @@ -433,7 +397,7 @@ struct ShaderDescriptor

//! \deprecated Since 0.04b; Use ShaderDescriptor::debugName instead.
LLGL_DEPRECATED("ShaderDescriptor::name is deprecated since 0.04b; Use ShaderDescriptor::debugName instead!", "debugName")
const char* name;
const char* name = nullptr;

//! Vertex (or geometry) shader specific attributes.
VertexShaderAttributes vertex;
Expand All @@ -449,6 +413,8 @@ struct ShaderDescriptor
ComputeShaderAttributes compute;
};

LLGL_DEPRECATED_IGNORE_POP()


/* ----- Functions ----- */

Expand Down

0 comments on commit 738a0ec

Please sign in to comment.