Skip to content

Commit 3cf4554

Browse files
author
kevyuu
committed
Add const to hlsl::ShaderStage
1 parent 033c7cf commit 3cf4554

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

include/nbl/asset/ICPUComputePipeline.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ class ICPUComputePipeline final : public ICPUPipeline<IComputePipeline<ICPUPipel
2929
constexpr static inline auto AssetType = ET_COMPUTE_PIPELINE;
3030
inline E_TYPE getAssetType() const override { return AssetType; }
3131

32-
inline std::span<const SShaderSpecInfo> getSpecInfos(hlsl::ShaderStage stage) const override
32+
inline std::span<const SShaderSpecInfo> getSpecInfos(const hlsl::ShaderStage stage) const override
3333
{
3434
if (stage==hlsl::ShaderStage::ESS_COMPUTE)
3535
return {&m_specInfo,1};
3636
return {};
3737
}
3838

39-
inline std::span<SShaderSpecInfo> getSpecInfos(hlsl::ShaderStage stage)
39+
inline std::span<SShaderSpecInfo> getSpecInfos(const hlsl::ShaderStage stage)
4040
{
4141
return base_t::getSpecInfos(stage);
4242
}

include/nbl/asset/ICPUGraphicsPipeline.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,20 @@ class ICPUGraphicsPipeline final : public ICPUPipeline<IGraphicsPipeline<ICPUPip
4040
return m_params;
4141
}
4242

43-
inline std::span<const SShaderSpecInfo> getSpecInfos(hlsl::ShaderStage stage) const override final
43+
inline std::span<const SShaderSpecInfo> getSpecInfos(const hlsl::ShaderStage stage) const override final
4444
{
4545
const auto stageIndex = stageToIndex(stage);
4646
if (stageIndex != -1)
4747
return { &m_specInfos[stageIndex], 1 };
4848
return {};
4949
}
5050

51-
inline std::span<SShaderSpecInfo> getSpecInfos(hlsl::ShaderStage stage)
51+
inline std::span<SShaderSpecInfo> getSpecInfos(const hlsl::ShaderStage stage)
5252
{
5353
return base_t::getSpecInfos(stage);
5454
}
5555

56-
SShaderSpecInfo* getSpecInfo(hlsl::ShaderStage stage)
56+
SShaderSpecInfo* getSpecInfo(const hlsl::ShaderStage stage)
5757
{
5858
if (!isMutable()) return nullptr;
5959
const auto stageIndex = stageToIndex(stage);
@@ -62,7 +62,7 @@ class ICPUGraphicsPipeline final : public ICPUPipeline<IGraphicsPipeline<ICPUPip
6262
return nullptr;
6363
}
6464

65-
const SShaderSpecInfo* getSpecInfo(hlsl::ShaderStage stage) const
65+
const SShaderSpecInfo* getSpecInfo(const hlsl::ShaderStage stage) const
6666
{
6767
const auto stageIndex = stageToIndex(stage);
6868
if (stageIndex != -1)

include/nbl/asset/ICPUPipeline.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class ICPUPipelineBase
9393
}
9494
};
9595

96-
virtual std::span<const SShaderSpecInfo> getSpecInfos(hlsl::ShaderStage stage) const = 0;
96+
virtual std::span<const SShaderSpecInfo> getSpecInfos(const hlsl::ShaderStage stage) const = 0;
9797

9898
};
9999

@@ -132,7 +132,7 @@ class ICPUPipeline : public IAsset, public PipelineNonAssetBase, public ICPUPipe
132132
}
133133

134134
// Note(kevinyu): For some reason overload resolution cannot find this function when I name id getSpecInfos. It always use the const variant. Will check on it later.
135-
inline std::span<SShaderSpecInfo> getSpecInfos(hlsl::ShaderStage stage)
135+
inline std::span<SShaderSpecInfo> getSpecInfos(const hlsl::ShaderStage stage)
136136
{
137137
if (!isMutable()) return {};
138138
const this_t* constPipeline = const_cast<const this_t*>(this);

include/nbl/asset/ICPURayTracingPipeline.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class ICPURayTracingPipeline final : public ICPUPipeline<IRayTracingPipeline<ICP
3636
constexpr static inline auto AssetType = ET_RAYTRACING_PIPELINE;
3737
inline E_TYPE getAssetType() const override { return AssetType; }
3838

39-
inline std::span<const SShaderSpecInfo> getSpecInfos(hlsl::ShaderStage stage) const override final
39+
inline std::span<const SShaderSpecInfo> getSpecInfos(const hlsl::ShaderStage stage) const override final
4040
{
4141
switch (stage)
4242
{
@@ -57,12 +57,12 @@ class ICPURayTracingPipeline final : public ICPUPipeline<IRayTracingPipeline<ICP
5757
return {};
5858
}
5959

60-
inline std::span<SShaderSpecInfo> getSpecInfos(hlsl::ShaderStage stage)
60+
inline std::span<SShaderSpecInfo> getSpecInfos(const hlsl::ShaderStage stage)
6161
{
6262
return base_t::getSpecInfos(stage);
6363
}
6464

65-
inline core::vector<SShaderSpecInfo>* getSpecInfoVector(hlsl::ShaderStage stage)
65+
inline core::vector<SShaderSpecInfo>* getSpecInfoVector(const hlsl::ShaderStage stage)
6666
{
6767
if (!isMutable()) return nullptr;
6868
switch (stage)

0 commit comments

Comments
 (0)