Skip to content

Commit 0a222f8

Browse files
committed
GetInlineConstantCount is trivial and is only used once. It would be clearer to compute the constant count directly where it is used.
1 parent 4f908f5 commit 0a222f8

2 files changed

Lines changed: 1 addition & 9 deletions

File tree

Graphics/GraphicsEngineOpenGL/include/ShaderResourcesGL.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,6 @@ class ShaderResourcesGL
164164

165165
const GLuint UBIndex;
166166
const Uint32 BufferSize; // Buffer size in bytes
167-
168-
/// Returns the number of 32-bit constants in the buffer.
169-
/// This is used for inline constants where ArraySize represents
170-
/// the number of constants, not the UBO array size.
171-
Uint32 GetInlineConstantCount() const
172-
{
173-
return BufferSize / sizeof(Uint32);
174-
}
175167
};
176168
static_assert((sizeof(UniformBufferInfo) % sizeof(void*)) == 0, "sizeof(UniformBufferInfo) must be multiple of sizeof(void*)");
177169

Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ PipelineResourceSignatureDescWrapper PipelineStateGLImpl::GetDefaultSignatureDes
144144
if (Flags & PIPELINE_RESOURCE_FLAG_INLINE_CONSTANTS)
145145
{
146146
VERIFY(Flags == PIPELINE_RESOURCE_FLAG_INLINE_CONSTANTS, "INLINE_CONSTANTS flag cannot be combined with other flags.");
147-
ArraySize = UB.GetInlineConstantCount();
147+
ArraySize = UB.BufferSize / sizeof(Uint32);
148148

149149
if (ArraySize > MAX_INLINE_CONSTANTS)
150150
{

0 commit comments

Comments
 (0)