Skip to content

Commit 1835d8c

Browse files
committed
Remove unnecessary VertexLayout::getVertexStepMode
1 parent cb92596 commit 1835d8c

File tree

3 files changed

+1
-23
lines changed

3 files changed

+1
-23
lines changed

axmol/rhi/RHITypes.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,6 @@ enum class IndexFormat : uint32_t
182182
U_INT = 2,
183183
};
184184

185-
enum class VertexStepMode : uint32_t
186-
{
187-
VERTEX,
188-
INSTANCE
189-
};
190-
191185
enum class PrimitiveType : uint32_t
192186
{
193187
POINT,

axmol/rhi/VertexLayout.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,6 @@ class AX_DLL VertexLayout : public Object
164164

165165
uint32_t getHash() const { return _desc.getHash(); }
166166

167-
/**
168-
* Get vertex step function. Default value is VERTEX.
169-
* @return Vertex step function.
170-
* @note Used in metal.
171-
*/
172-
VertexStepMode getVertexStepMode() const { return _stepMode; }
173-
174167
/**
175168
* Get built-in vertex layout id, -1 means not built-in
176169
*/
@@ -179,7 +172,6 @@ class AX_DLL VertexLayout : public Object
179172
protected:
180173
VertexLayoutDesc _desc{};
181174
int _builtinId{-1};
182-
VertexStepMode _stepMode = VertexStepMode::VERTEX;
183175
};
184176

185177
// end of _rhi group

axmol/rhi/metal/RenderPipelineMTL.mm

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,6 @@ of this software and associated documentation files (the "Software"), to deal
3737

3838
namespace
3939
{
40-
static MTLVertexStepFunction toMTLVertexStepFunc(VertexStepMode vertexStepMode)
41-
{
42-
if (VertexStepMode::VERTEX == vertexStepMode)
43-
return MTLVertexStepFunctionPerVertex;
44-
else
45-
return MTLVertexStepFunctionPerInstance;
46-
}
47-
4840
static MTLVertexFormat toMTLVertexFormat(VertexFormat vertexFormat, bool needNormalize)
4941
{
5042
MTLVertexFormat ret = MTLVertexFormatFloat4;
@@ -206,7 +198,7 @@ static MTLBlendOperation toMTLBlendOp(BlendOp operation)
206198
stepFunction:1 stride:15 offest:10 format:5 needNormalized:1
207199
bit31 bit30 ~ bit16 bit15 ~ bit6 bit5 ~ bit1 bit0
208200
*/
209-
hashMe.vertexLayoutInfo[index++] = ((unsigned int)vertexLayout->getVertexStepMode() & 0x1) << 31 |
201+
hashMe.vertexLayoutInfo[index++] = ((unsigned int)bindingDesc.instanceStepRate & 0x1) << 31 |
210202
((unsigned int)(vertexLayout->getStride() & 0x7FFF)) << 16 |
211203
((unsigned int)bindingDesc.offset & 0x3FF) << 6 |
212204
((unsigned int)bindingDesc.format & 0x1F) << 1 |

0 commit comments

Comments
 (0)