Skip to content

Commit 9bef955

Browse files
committed
Remove useless and misleading E_SHADER_STAGE_IX
1 parent 67d9ec4 commit 9bef955

13 files changed

+51
-65
lines changed

include/nbl/asset/ICPURenderpassIndependentPipeline.h

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class NBL_API ICPURenderpassIndependentPipeline : public IRenderpassIndependentP
4646
//intentionally parent is not converted
4747
--referenceLevelsBelowToConvert;
4848
m_layout->convertToDummyObject(referenceLevelsBelowToConvert);
49-
for (auto i=0u; i<SHADER_STAGE_COUNT; i++)
49+
for (auto i=0u; i<GRAPHICS_SHADER_STAGE_COUNT; i++)
5050
if (m_shaders[i])
5151
m_shaders[i]->convertToDummyObject(referenceLevelsBelowToConvert);
5252
}
@@ -56,10 +56,10 @@ class NBL_API ICPURenderpassIndependentPipeline : public IRenderpassIndependentP
5656
{
5757
core::smart_refctd_ptr<ICPUPipelineLayout> layout = (_depth > 0u && m_layout) ? core::smart_refctd_ptr_static_cast<ICPUPipelineLayout>(m_layout->clone(_depth-1u)) : m_layout;
5858

59-
std::array<core::smart_refctd_ptr<ICPUSpecializedShader>, SHADER_STAGE_COUNT> shaders;
59+
std::array<core::smart_refctd_ptr<ICPUSpecializedShader>, GRAPHICS_SHADER_STAGE_COUNT> shaders;
6060
for (uint32_t i = 0u; i < shaders.size(); ++i)
6161
shaders[i] = (_depth > 0u && m_shaders[i]) ? core::smart_refctd_ptr_static_cast<ICPUSpecializedShader>(m_shaders[i]->clone(_depth-1u)) : m_shaders[i];
62-
std::array<ICPUSpecializedShader*, SHADER_STAGE_COUNT> shaders_raw;
62+
std::array<ICPUSpecializedShader*, GRAPHICS_SHADER_STAGE_COUNT> shaders_raw;
6363
for (uint32_t i = 0u; i < shaders.size(); ++i)
6464
shaders_raw[i] = shaders[i].get();
6565
std::sort(shaders_raw.begin(), shaders_raw.end(), [](ICPUSpecializedShader* a, ICPUSpecializedShader* b) { return (a && !b); });
@@ -125,11 +125,6 @@ class NBL_API ICPURenderpassIndependentPipeline : public IRenderpassIndependentP
125125
assert(!isImmutable_debug());
126126
m_shaders[core::findLSB<uint32_t>(_stage)] = core::smart_refctd_ptr<ICPUSpecializedShader>(_shdr);
127127
}
128-
inline void setShaderAtIndex(uint32_t _ix, ICPUSpecializedShader* _shdr)
129-
{
130-
assert(!isImmutable_debug());
131-
m_shaders[_ix] = core::smart_refctd_ptr<ICPUSpecializedShader>(_shdr);
132-
}
133128

134129
inline void setLayout(core::smart_refctd_ptr<ICPUPipelineLayout>&& _layout)
135130
{
@@ -151,7 +146,7 @@ class NBL_API ICPURenderpassIndependentPipeline : public IRenderpassIndependentP
151146
if (m_disableOptimizations != other->m_disableOptimizations)
152147
return false;
153148

154-
for (uint32_t i = 0u; i < SHADER_STAGE_COUNT; ++i)
149+
for (uint32_t i = 0u; i < GRAPHICS_SHADER_STAGE_COUNT; ++i)
155150
{
156151
if ((!m_shaders[i]) != (!other->m_shaders[i]))
157152
return false;
@@ -174,7 +169,7 @@ class NBL_API ICPURenderpassIndependentPipeline : public IRenderpassIndependentP
174169
--_levelsBelow;
175170

176171
restoreFromDummy_impl_call(m_layout.get(), other->m_layout.get(), _levelsBelow);
177-
for (uint32_t i = 0u; i < SHADER_STAGE_COUNT; ++i)
172+
for (uint32_t i = 0u; i < GRAPHICS_SHADER_STAGE_COUNT; ++i)
178173
if (m_shaders[i])
179174
restoreFromDummy_impl_call(m_shaders[i].get(), other->m_shaders[i].get(), _levelsBelow);
180175
}

include/nbl/asset/IRenderpassIndependentPipeline.h

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -508,16 +508,7 @@ template<typename SpecShaderType, typename LayoutType>
508508
class NBL_API IRenderpassIndependentPipeline : public IPipeline<LayoutType>
509509
{
510510
public:
511-
_NBL_STATIC_INLINE_CONSTEXPR size_t SHADER_STAGE_COUNT = 5u;
512-
513-
enum E_SHADER_STAGE_IX : uint32_t
514-
{
515-
ESSI_VERTEX_SHADER_IX = 0,
516-
ESSI_TESS_CTRL_SHADER_IX = 1,
517-
ESSI_TESS_EVAL_SHADER_IX = 2,
518-
ESSI_GEOMETRY_SHADER_IX = 3,
519-
ESSI_FRAGMENT_SHADER_IX = 4
520-
};
511+
_NBL_STATIC_INLINE_CONSTEXPR size_t GRAPHICS_SHADER_STAGE_COUNT = 5u;
521512

522513
IRenderpassIndependentPipeline(
523514
core::smart_refctd_ptr<LayoutType>&& _layout,
@@ -536,7 +527,7 @@ class NBL_API IRenderpassIndependentPipeline : public IPipeline<LayoutType>
536527
for (auto shdr : shaders)
537528
{
538529
const int32_t ix = core::findLSB<uint32_t>(shdr->getStage());
539-
assert(ix < static_cast<int32_t>(SHADER_STAGE_COUNT));
530+
assert(ix < static_cast<int32_t>(GRAPHICS_SHADER_STAGE_COUNT));
540531
assert(!m_shaders[ix]);//must be maximum of 1 for each stage
541532
m_shaders[ix] = core::smart_refctd_ptr<SpecShaderType>(shdr);
542533
}
@@ -547,15 +538,15 @@ class NBL_API IRenderpassIndependentPipeline : public IPipeline<LayoutType>
547538
inline const LayoutType* getLayout() const { return IPipeline<LayoutType>::m_layout.get(); }
548539

549540
inline const SpecShaderType* getShaderAtStage(IShader::E_SHADER_STAGE _stage) const { return m_shaders[core::findLSB<uint32_t>(_stage)].get(); }
550-
inline const SpecShaderType* getShaderAtIndex(uint32_t _ix) const { return m_shaders[_ix].get(); }
541+
inline const SpecShaderType* getShaderAtIndex(uint32_t _ix) const { return m_shaders[_ix].get(); }
551542

552543
inline const SBlendParams& getBlendParams() const { return m_blendParams; }
553544
inline const SPrimitiveAssemblyParams& getPrimitiveAssemblyParams() const { return m_primAsmParams; }
554545
inline const SRasterizationParams& getRasterizationParams() const { return m_rasterParams; }
555546
inline const SVertexInputParams& getVertexInputParams() const { return m_vertexInputParams; }
556547

557548
protected:
558-
core::smart_refctd_ptr<SpecShaderType> m_shaders[SHADER_STAGE_COUNT];
549+
core::smart_refctd_ptr<SpecShaderType> m_shaders[GRAPHICS_SHADER_STAGE_COUNT];
559550

560551
SBlendParams m_blendParams;
561552
SPrimitiveAssemblyParams m_primAsmParams;

include/nbl/video/IGPURenderpassIndependentPipeline.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class NBL_API IGPURenderpassIndependentPipeline : public asset::IRenderpassIndep
4040
struct SCreationParams
4141
{
4242
core::smart_refctd_ptr<IGPUPipelineLayout> layout;
43-
core::smart_refctd_ptr<const IGPUSpecializedShader> shaders[SHADER_STAGE_COUNT];
43+
core::smart_refctd_ptr<const IGPUSpecializedShader> shaders[GRAPHICS_SHADER_STAGE_COUNT];
4444
asset::SVertexInputParams vertexInput;
4545
asset::SBlendParams blend;
4646
asset::SPrimitiveAssemblyParams primitiveAssembly;

include/nbl/video/utilities/IGPUObjectFromAssetConverter.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ struct NBL_API IGPUObjectFromAssetConverter::Hash<const asset::ICPURenderpassInd
405405
asset::SBlendParams::serializedSize()+
406406
asset::SRasterizationParams::serializedSize()+
407407
asset::SPrimitiveAssemblyParams::serializedSize()+
408-
sizeof(void*)*asset::ICPURenderpassIndependentPipeline::SHADER_STAGE_COUNT+//shaders
408+
sizeof(void*)*asset::ICPURenderpassIndependentPipeline::GRAPHICS_SHADER_STAGE_COUNT+//shaders
409409
sizeof(void*);//layout
410410
uint8_t mem[bytesToHash]{};
411411
uint32_t offset = 0u;
@@ -418,9 +418,9 @@ struct NBL_API IGPUObjectFromAssetConverter::Hash<const asset::ICPURenderpassInd
418418
_ppln->getPrimitiveAssemblyParams().serialize(mem+offset);
419419
offset += sizeof(asset::SPrimitiveAssemblyParams);
420420
const asset::ICPUSpecializedShader** shaders = reinterpret_cast<const asset::ICPUSpecializedShader**>(mem+offset);
421-
for (uint32_t i = 0u; i < asset::ICPURenderpassIndependentPipeline::SHADER_STAGE_COUNT; ++i)
421+
for (uint32_t i = 0u; i < asset::ICPURenderpassIndependentPipeline::GRAPHICS_SHADER_STAGE_COUNT; ++i)
422422
shaders[i] = _ppln->getShaderAtIndex(i);
423-
offset += asset::ICPURenderpassIndependentPipeline::SHADER_STAGE_COUNT*sizeof(void*);
423+
offset += asset::ICPURenderpassIndependentPipeline::GRAPHICS_SHADER_STAGE_COUNT*sizeof(void*);
424424
reinterpret_cast<const asset::ICPUPipelineLayout**>(mem+offset)[0] = _ppln->getLayout();
425425

426426
const std::size_t hs = std::hash<std::string_view>{}(std::string_view(reinterpret_cast<const char*>(mem), bytesToHash));
@@ -1272,23 +1272,23 @@ inline created_gpu_object_array<asset::ICPUPipelineLayout> IGPUObjectFromAssetCo
12721272

12731273
inline created_gpu_object_array<asset::ICPURenderpassIndependentPipeline> IGPUObjectFromAssetConverter::create(const asset::ICPURenderpassIndependentPipeline** const _begin, const asset::ICPURenderpassIndependentPipeline** const _end, SParams& _params)
12741274
{
1275-
constexpr size_t SHADER_STAGE_COUNT = asset::ICPURenderpassIndependentPipeline::SHADER_STAGE_COUNT;
1275+
constexpr size_t GRAPHICS_SHADER_STAGE_COUNT = asset::ICPURenderpassIndependentPipeline::GRAPHICS_SHADER_STAGE_COUNT;
12761276

12771277
const auto assetCount = std::distance(_begin, _end);
12781278
auto res = core::make_refctd_dynamic_array<created_gpu_object_array<asset::ICPURenderpassIndependentPipeline> >(assetCount);
12791279

12801280
core::vector<const asset::ICPUPipelineLayout*> cpuLayouts;
12811281
cpuLayouts.reserve(assetCount);
12821282
core::vector<const asset::ICPUSpecializedShader*> cpuShaders;
1283-
cpuShaders.reserve(assetCount * SHADER_STAGE_COUNT);
1283+
cpuShaders.reserve(assetCount * GRAPHICS_SHADER_STAGE_COUNT);
12841284

12851285
for (ptrdiff_t i = 0u; i < assetCount; ++i)
12861286
{
12871287
const asset::ICPURenderpassIndependentPipeline* cpuppln = _begin[i];
12881288
cpuLayouts.push_back(cpuppln->getLayout());
12891289

1290-
for (size_t s = 0ull; s < SHADER_STAGE_COUNT; ++s)
1291-
if (const asset::ICPUSpecializedShader* shdr = cpuppln->getShaderAtIndex(static_cast<asset::ICPURenderpassIndependentPipeline::E_SHADER_STAGE_IX>(s)))
1290+
for (size_t s = 0ull; s < GRAPHICS_SHADER_STAGE_COUNT; ++s)
1291+
if (const asset::ICPUSpecializedShader* shdr = cpuppln->getShaderAtIndex(s))
12921292
cpuShaders.push_back(shdr);
12931293
}
12941294

@@ -1305,10 +1305,10 @@ inline created_gpu_object_array<asset::ICPURenderpassIndependentPipeline> IGPUOb
13051305

13061306
IGPUPipelineLayout* layout = (*gpuLayouts)[layoutRedirs[i]].get();
13071307

1308-
IGPUSpecializedShader* shaders[SHADER_STAGE_COUNT]{};
1308+
IGPUSpecializedShader* shaders[GRAPHICS_SHADER_STAGE_COUNT]{};
13091309
size_t local_shdr_count = 0ull;
1310-
for (size_t s = 0ull; s < SHADER_STAGE_COUNT; ++s)
1311-
if (cpuppln->getShaderAtIndex(static_cast<asset::ICPURenderpassIndependentPipeline::E_SHADER_STAGE_IX>(s)))
1310+
for (size_t s = 0ull; s < GRAPHICS_SHADER_STAGE_COUNT; ++s)
1311+
if (cpuppln->getShaderAtIndex(s))
13121312
shaders[local_shdr_count++] = (*gpuShaders)[shdrRedirs[shdrIter++]].get();
13131313

13141314
(*res)[i] = _params.device->createRenderpassIndependentPipeline(

source/Nabla/COpenGLDriver.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,8 +1323,8 @@ void COpenGLDriver::SAuxContext::flushStateCompute(uint32_t stateBits)
13231323

13241324
GLuint COpenGLDriver::SAuxContext::createGraphicsPipeline(const SOpenGLState::SGraphicsPipelineHash& _hash)
13251325
{
1326-
constexpr size_t STAGE_CNT = COpenGLRenderpassIndependentPipeline::SHADER_STAGE_COUNT;
1327-
static_assert(STAGE_CNT == 5u, "SHADER_STAGE_COUNT is expected to be 5");
1326+
constexpr size_t STAGE_CNT = COpenGLRenderpassIndependentPipeline::GRAPHICS_SHADER_STAGE_COUNT;
1327+
static_assert(STAGE_CNT == 5u, "GRAPHICS_SHADER_STAGE_COUNT is expected to be 5");
13281328
const GLenum stages[5]{ GL_VERTEX_SHADER, GL_TESS_CONTROL_SHADER, GL_TESS_EVALUATION_SHADER, GL_GEOMETRY_SHADER, GL_FRAGMENT_SHADER };
13291329
const GLenum stageFlags[5]{ GL_VERTEX_SHADER_BIT, GL_TESS_CONTROL_SHADER_BIT, GL_TESS_EVALUATION_SHADER_BIT, GL_GEOMETRY_SHADER_BIT, GL_FRAGMENT_SHADER_BIT };
13301330

@@ -1354,7 +1354,7 @@ void COpenGLDriver::SAuxContext::updateNextState_pipelineAndRaster(const IGPURen
13541354
return;
13551355
}
13561356
SOpenGLState::SGraphicsPipelineHash hash;
1357-
for (uint32_t i = 0u; i < COpenGLRenderpassIndependentPipeline::SHADER_STAGE_COUNT; ++i)
1357+
for (uint32_t i = 0u; i < COpenGLRenderpassIndependentPipeline::GRAPHICS_SHADER_STAGE_COUNT; ++i)
13581358
{
13591359
hash[i] = nextState.pipeline.graphics.pipeline->getShaderAtIndex(i) ?
13601360
nextState.pipeline.graphics.pipeline->getShaderGLnameForCtx(i, this->ID) :

src/nbl/asset/interchange/CPLYMeshFileLoader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ void CPLYMeshFileLoader::initialize()
145145

146146
auto mbPipeline = core::make_smart_refctd_ptr<ICPURenderpassIndependentPipeline>(std::move(mbPipelineLayout), nullptr, nullptr, inputParams, blendParams, primitiveAssemblyParams, rastarizationParmas);
147147
{
148-
mbPipeline->setShaderAtIndex(ICPURenderpassIndependentPipeline::ESSI_VERTEX_SHADER_IX, mbVertexShader.get());
149-
mbPipeline->setShaderAtIndex(ICPURenderpassIndependentPipeline::ESSI_FRAGMENT_SHADER_IX, mbFragmentShader.get());
148+
mbPipeline->setShaderAtStage(asset::IShader::ESS_VERTEX, mbVertexShader.get());
149+
mbPipeline->setShaderAtStage(asset::IShader::ESS_FRAGMENT, mbFragmentShader.get());
150150

151151
asset::SAssetBundle newPipelineBundle(nullptr, { core::smart_refctd_ptr<asset::ICPURenderpassIndependentPipeline>(mbPipeline) });
152152
defaultOverride.insertAssetIntoCache(newPipelineBundle, pipelineCacheHash, fakeContext, _hierarchyLevel + ICPURenderpassIndependentPipeline::DESC_SET_HIERARCHYLEVELS_BELOW);

src/nbl/asset/interchange/CSTLMeshFileLoader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ void CSTLMeshFileLoader::initialize()
104104

105105
auto mbPipeline = core::make_smart_refctd_ptr<ICPURenderpassIndependentPipeline>(std::move(mbPipelineLayout), nullptr, nullptr, mbInputParams, blendParams, primitiveAssemblyParams, rastarizationParmas);
106106
{
107-
mbPipeline->setShaderAtIndex(ICPURenderpassIndependentPipeline::ESSI_VERTEX_SHADER_IX, mbVertexShader.get());
108-
mbPipeline->setShaderAtIndex(ICPURenderpassIndependentPipeline::ESSI_FRAGMENT_SHADER_IX, mbFragmentShader.get());
107+
mbPipeline->setShaderAtStage(asset::IShader::ESS_VERTEX, mbVertexShader.get());
108+
mbPipeline->setShaderAtStage(asset::IShader::ESS_FRAGMENT, mbFragmentShader.get());
109109
}
110110

111111
asset::SAssetBundle newPipelineBundle(nullptr, {core::smart_refctd_ptr<asset::ICPURenderpassIndependentPipeline>(mbPipeline)});

src/nbl/video/COpenGLRenderpassIndependentPipeline.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
namespace nbl::video
2323
{
2424

25-
class COpenGLRenderpassIndependentPipeline final : public IGPURenderpassIndependentPipeline, public IOpenGLPipeline<IGPURenderpassIndependentPipeline::SHADER_STAGE_COUNT>
25+
class COpenGLRenderpassIndependentPipeline final : public IGPURenderpassIndependentPipeline, public IOpenGLPipeline<IGPURenderpassIndependentPipeline::GRAPHICS_SHADER_STAGE_COUNT>
2626
{
2727
public:
2828
//! _binaries' elements are getting move()'d!
@@ -34,7 +34,7 @@ class COpenGLRenderpassIndependentPipeline final : public IGPURenderpassIndepend
3434
const asset::SBlendParams& _blendParams,
3535
const asset::SPrimitiveAssemblyParams& _primAsmParams,
3636
const asset::SRasterizationParams& _rasterParams,
37-
uint32_t _ctxCount, uint32_t _ctxID, const GLuint _GLnames[SHADER_STAGE_COUNT], const COpenGLSpecializedShader::SProgramBinary _binaries[SHADER_STAGE_COUNT]
37+
uint32_t _ctxCount, uint32_t _ctxID, const GLuint _GLnames[GRAPHICS_SHADER_STAGE_COUNT], const COpenGLSpecializedShader::SProgramBinary _binaries[GRAPHICS_SHADER_STAGE_COUNT]
3838
) : IGPURenderpassIndependentPipeline(
3939
core::smart_refctd_ptr<ILogicalDevice>(_dev), std::move(_layout),
4040
const_cast<IGPUSpecializedShader*const *>(_shadersBegin), const_cast<IGPUSpecializedShader*const *>(_shadersEnd),
@@ -61,7 +61,7 @@ class COpenGLRenderpassIndependentPipeline final : public IGPURenderpassIndepend
6161
m_vaoHashval.setStrideForBinding(bnd, m_vertexInputParams.bindings[bnd].stride);
6262
m_vaoHashval.divisors |= ((m_vertexInputParams.bindings[bnd].inputRate==asset::EVIR_PER_VERTEX ? 0u : 1u) << bnd);
6363
}
64-
for (uint32_t i = 0u; i < SHADER_STAGE_COUNT; ++i)
64+
for (uint32_t i = 0u; i < GRAPHICS_SHADER_STAGE_COUNT; ++i)
6565
{
6666
const bool present = static_cast<bool>(m_shaders[i]);
6767
m_stagePresenceMask |= (static_cast<uint32_t>(present) << i);
@@ -79,7 +79,7 @@ class COpenGLRenderpassIndependentPipeline final : public IGPURenderpassIndepend
7979
if (value == _baseInstance)
8080
return;
8181

82-
const GLuint programID = getShaderGLnameForCtx(ESSI_VERTEX_SHADER_IX, _ctxID);
82+
const GLuint programID = getShaderGLnameForCtx(0u, _ctxID);
8383
GLint& uid = getBaseInstanceState(_ctxID)->id;
8484
if (uid == -1)
8585
{
@@ -100,31 +100,31 @@ class COpenGLRenderpassIndependentPipeline final : public IGPURenderpassIndepend
100100
if (!m_shaders[_stageIx])
101101
return 0u;
102102

103-
return IOpenGLPipeline<SHADER_STAGE_COUNT>::getShaderGLnameForCtx(_stageIx, _ctxID);
103+
return IOpenGLPipeline<GRAPHICS_SHADER_STAGE_COUNT>::getShaderGLnameForCtx(_stageIx, _ctxID);
104104
}
105105

106106
struct alignas(128) PushConstantsState
107107
{
108108
alignas(128) uint8_t data[IGPUMeshBuffer::MAX_PUSH_CONSTANT_BYTESIZE];
109109
core::smart_refctd_ptr<const COpenGLPipelineLayout> layout;
110-
std::atomic_uint32_t stageUpdateStamps[IGPURenderpassIndependentPipeline::SHADER_STAGE_COUNT] = { 0u };
110+
std::atomic_uint32_t stageUpdateStamps[IGPURenderpassIndependentPipeline::GRAPHICS_SHADER_STAGE_COUNT] = { 0u };
111111

112112
inline uint32_t getStamp(IGPUShader::E_SHADER_STAGE _stage) const
113113
{
114114
const uint32_t ix = core::findLSB<std::underlying_type_t<IGPUShader::E_SHADER_STAGE>>(_stage);
115-
assert(ix < IGPURenderpassIndependentPipeline::SHADER_STAGE_COUNT);
115+
assert(ix < IGPURenderpassIndependentPipeline::GRAPHICS_SHADER_STAGE_COUNT);
116116
return stageUpdateStamps[ix];
117117
}
118118
inline void incrementStamps(uint32_t _stages)
119119
{
120-
for (uint32_t i = 0u; i < IGPURenderpassIndependentPipeline::SHADER_STAGE_COUNT; ++i)
120+
for (uint32_t i = 0u; i < IGPURenderpassIndependentPipeline::GRAPHICS_SHADER_STAGE_COUNT; ++i)
121121
if ((_stages >> i) & 1u)
122122
++stageUpdateStamps[i];
123123
}
124124
};
125125
inline void setUniformsImitatingPushConstants(IOpenGL_FunctionTable* gl, uint32_t _ctxID, const PushConstantsState& _pcState) const
126126
{
127-
for (uint32_t i=0u; i<SHADER_STAGE_COUNT; ++i)
127+
for (uint32_t i=0u; i<GRAPHICS_SHADER_STAGE_COUNT; ++i)
128128
{
129129
auto stage = static_cast<IGPUShader::E_SHADER_STAGE>(1u<<i);
130130
if ((m_stagePresenceMask&stage)==0u)
@@ -136,13 +136,13 @@ class COpenGLRenderpassIndependentPipeline final : public IGPURenderpassIndepend
136136
auto uniforms = IBackendObject::compatibility_cast<COpenGLSpecializedShader*>(m_shaders[i].get(), this)->getUniforms();
137137
auto locations = IBackendObject::compatibility_cast<COpenGLSpecializedShader*>(m_shaders[i].get(), this)->getLocations();
138138
if (uniforms.size())
139-
IOpenGLPipeline<SHADER_STAGE_COUNT>::setUniformsImitatingPushConstants(gl, i, _ctxID, _pcState.data, uniforms, locations);
139+
IOpenGLPipeline<GRAPHICS_SHADER_STAGE_COUNT>::setUniformsImitatingPushConstants(gl, i, _ctxID, _pcState.data, uniforms, locations);
140140
m_lastUpdateStamp[i] = stampValue;
141141
}
142142
}
143143
}
144144

145-
using SPipelineHash = std::array<GLuint, SHADER_STAGE_COUNT>;
145+
using SPipelineHash = std::array<GLuint, GRAPHICS_SHADER_STAGE_COUNT>;
146146

147147
inline SPipelineHash getPipelineHash(uint32_t ctxid) const
148148
{
@@ -283,7 +283,7 @@ class COpenGLRenderpassIndependentPipeline final : public IGPURenderpassIndepend
283283
private:
284284
SVAOHash m_vaoHashval;
285285
uint32_t m_stagePresenceMask;
286-
mutable uint32_t m_lastUpdateStamp[SHADER_STAGE_COUNT];
286+
mutable uint32_t m_lastUpdateStamp[GRAPHICS_SHADER_STAGE_COUNT];
287287
};
288288

289289
}

src/nbl/video/COpenGL_LogicalDevice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ class COpenGL_LogicalDevice : public IOpenGL_LogicalDevice
621621
}
622622
void destroySpecializedShaders(core::smart_refctd_dynamic_array<IOpenGLPipelineBase::SShaderProgram>&& programs) override final
623623
{
624-
constexpr auto MaxCount = COpenGLRenderpassIndependentPipeline::SHADER_STAGE_COUNT*MaxGlNamesForSingleObject;
624+
constexpr auto MaxCount = COpenGLRenderpassIndependentPipeline::GRAPHICS_SHADER_STAGE_COUNT*MaxGlNamesForSingleObject;
625625

626626
const auto count = programs->size();
627627
assert(count<=MaxCount);

0 commit comments

Comments
 (0)