-
Notifications
You must be signed in to change notification settings - Fork 65
Rt pipeline asset conversion #911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d92b274
6d2df49
9eb0227
73ac23f
97977af
5de6b84
f097903
4ef7a2b
ed7bd50
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,6 +87,10 @@ class IGPUGraphicsPipeline : public IGPUPipeline<asset::IGraphicsPipeline<const | |
return stages; | ||
} | ||
|
||
inline core::bitflag<FLAGS>& getFlags() { return flags; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I only just figured out this is a member of the creation struct, just asking what's wrong with using |
||
|
||
inline core::bitflag<FLAGS> getFlags() const { return flags; } | ||
|
||
const IGPUPipelineLayout* layout = nullptr; | ||
SShaderSpecInfo vertexShader; | ||
SShaderSpecInfo tesselationControlShader; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ class IGPURayTracingPipeline : public IGPUPipeline<asset::IRayTracingPipeline<c | |
|
||
struct SCreationParams : public SPipelineCreationParams<const IGPURayTracingPipeline> | ||
{ | ||
using FLAGS = pipeline_t::FLAGS; | ||
using FLAGS = IRayTracingPipelineBase::CreationFlags; | ||
|
||
struct SShaderGroupsParams | ||
{ | ||
|
@@ -45,8 +45,6 @@ class IGPURayTracingPipeline : public IGPUPipeline<asset::IRayTracingPipeline<c | |
SShaderGroupsParams shaderGroups; | ||
|
||
SCachedCreationParams cached = {}; | ||
// TODO: Could guess the required flags from SPIR-V introspection of declared caps | ||
core::bitflag<FLAGS> flags = FLAGS::NONE; | ||
|
||
inline SSpecializationValidationResult valid() const | ||
{ | ||
|
@@ -76,7 +74,7 @@ class IGPURayTracingPipeline : public IGPUPipeline<asset::IRayTracingPipeline<c | |
} | ||
|
||
// https://docs.vulkan.org/spec/latest/chapters/pipelines.html#VUID-VkRayTracingPipelineCreateInfoKHR-flags-03470 | ||
if (flags.hasFlags(FLAGS::NO_NULL_ANY_HIT_SHADERS) && !shaderGroup.anyHit.shader) | ||
if (cached.flags.hasFlags(FLAGS::NO_NULL_ANY_HIT_SHADERS) && !shaderGroup.anyHit.shader) | ||
return {}; | ||
|
||
if (shaderGroup.anyHit.shader) | ||
|
@@ -86,7 +84,7 @@ class IGPURayTracingPipeline : public IGPUPipeline<asset::IRayTracingPipeline<c | |
} | ||
|
||
// https://docs.vulkan.org/spec/latest/chapters/pipelines.html#VUID-VkRayTracingPipelineCreateInfoKHR-flags-03471 | ||
if (flags.hasFlags(FLAGS::NO_NULL_CLOSEST_HIT_SHADERS) && !shaderGroup.intersection.shader) | ||
if (cached.flags.hasFlags(FLAGS::NO_NULL_CLOSEST_HIT_SHADERS) && !shaderGroup.intersection.shader) | ||
return {}; | ||
} | ||
|
||
|
@@ -137,6 +135,10 @@ class IGPURayTracingPipeline : public IGPUPipeline<asset::IRayTracingPipeline<c | |
return stages; | ||
} | ||
|
||
inline core::bitflag<FLAGS>& getFlags() { return cached.flags; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmmm okay I see what you did, you added to btw why add a getter when the Was this just to avoid writing |
||
|
||
inline core::bitflag<FLAGS> getFlags() const { return cached.flags; } | ||
|
||
}; | ||
|
||
struct SShaderGroupHandle | ||
|
@@ -153,7 +155,7 @@ class IGPURayTracingPipeline : public IGPUPipeline<asset::IRayTracingPipeline<c | |
uint16_t intersection; | ||
}; | ||
|
||
inline core::bitflag<SCreationParams::FLAGS> getCreationFlags() const { return m_flags; } | ||
inline core::bitflag<SCreationParams::FLAGS> getCreationFlags() const { return getCachedCreationParams().flags; } | ||
|
||
// Vulkan: const VkPipeline* | ||
virtual const void* getNativeHandle() const = 0; | ||
|
@@ -170,13 +172,11 @@ class IGPURayTracingPipeline : public IGPUPipeline<asset::IRayTracingPipeline<c | |
virtual uint16_t getDefaultStackSize() const = 0; | ||
|
||
protected: | ||
IGPURayTracingPipeline(const SCreationParams& params) : IGPUPipeline(core::smart_refctd_ptr<const ILogicalDevice>(params.layout->getOriginDevice()), params.layout, params.cached), | ||
m_flags(params.flags) | ||
IGPURayTracingPipeline(const SCreationParams& params) : IGPUPipeline(core::smart_refctd_ptr<const ILogicalDevice>(params.layout->getOriginDevice()), params.layout, params.cached) | ||
{} | ||
|
||
virtual ~IGPURayTracingPipeline() = default; | ||
|
||
const core::bitflag<SCreationParams::FLAGS> m_flags; | ||
}; | ||
|
||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we returning the flags as mutable on an IGPU object?I only just figured out this is a member of the creation struct, just asking what's wrong with using
.cached.flags
throughout the codebase ?