Permalink
Browse files

Kill off more unused duplicate code

  • Loading branch information...
hrydgard committed Nov 13, 2017
1 parent 230f72a commit 35437e6b627ae6bb794f6972c0270f979b0f4873
Showing with 2 additions and 42 deletions.
  1. +1 −17 GPU/D3D11/DrawEngineD3D11.cpp
  2. +0 −3 GPU/D3D11/DrawEngineD3D11.h
  3. +1 −19 GPU/Vulkan/DrawEngineVulkan.cpp
  4. +0 −3 GPU/Vulkan/DrawEngineVulkan.h
@@ -249,22 +249,6 @@ ID3D11InputLayout *DrawEngineD3D11::SetupDecFmtForDraw(D3D11VertexShader *vshade
}
}
void DrawEngineD3D11::SetupVertexDecoder(u32 vertType) {
SetupVertexDecoderInternal(vertType);
}
inline void DrawEngineD3D11::SetupVertexDecoderInternal(u32 vertType) {
// As the decoder depends on the UVGenMode when we use UV prescale, we simply mash it
// into the top of the verttype where there are unused bits.
const u32 vertTypeID = (vertType & 0xFFFFFF) | (gstate.getUVGenMode() << 24);
// If vtype has changed, setup the vertex decoder.
if (vertTypeID != lastVType_) {
dec_ = GetVertexDecoder(vertTypeID);
lastVType_ = vertTypeID;
}
}
void DrawEngineD3D11::SubmitPrim(void *verts, void *inds, GEPrimitiveType prim, int vertexCount, u32 vertType, int *bytesRead) {
if (!indexGen.PrimCompatible(prevPrim_, prim) || numDrawCalls >= MAX_DEFERRED_DRAW_CALLS || vertexCountInDrawCalls_ + vertexCount > VERTEX_BUFFER_MAX)
Flush();
@@ -276,7 +260,7 @@ void DrawEngineD3D11::SubmitPrim(void *verts, void *inds, GEPrimitiveType prim,
prevPrim_ = prim;
}
SetupVertexDecoderInternal(vertType);
SetupVertexDecoder(vertType);
*bytesRead = vertexCount * dec_->VertexSize();
@@ -121,9 +121,6 @@ class DrawEngineD3D11 : public DrawEngineCommon {
void BeginFrame();
void SetupVertexDecoder(u32 vertType);
void SetupVertexDecoderInternal(u32 vertType);
// So that this can be inlined
void Flush() {
if (!numDrawCalls)
@@ -361,24 +361,6 @@ void DrawEngineVulkan::EndFrame() {
vertexCache_->End();
}
void DrawEngineVulkan::SetupVertexDecoder(u32 vertType) {
SetupVertexDecoderInternal(vertType);
}
inline void DrawEngineVulkan::SetupVertexDecoderInternal(u32 vertType) {
// As the decoder depends on the UVGenMode when we use UV prescale, we simply mash it
// into the top of the verttype where there are unused bits.
const u32 vertTypeID = (vertType & 0xFFFFFF) | (gstate.getUVGenMode() << 24);
// If vtype has changed, setup the vertex decoder.
if (vertTypeID != lastVType_) {
dec_ = GetVertexDecoder(vertTypeID);
lastVType_ = vertTypeID;
}
if (!dec_)
Crash();
}
void DrawEngineVulkan::SubmitPrim(void *verts, void *inds, GEPrimitiveType prim, int vertexCount, u32 vertType, int *bytesRead) {
if (!indexGen.PrimCompatible(prevPrim_, prim) || numDrawCalls >= MAX_DEFERRED_DRAW_CALLS || vertexCountInDrawCalls_ + vertexCount > VERTEX_BUFFER_MAX)
Flush();
@@ -390,7 +372,7 @@ void DrawEngineVulkan::SubmitPrim(void *verts, void *inds, GEPrimitiveType prim,
prevPrim_ = prim;
}
SetupVertexDecoderInternal(vertType);
SetupVertexDecoder(vertType);
*bytesRead = vertexCount * dec_->VertexSize();
if ((vertexCount < 2 && prim > 0) || (vertexCount < 3 && prim > 2 && prim != GE_PRIM_RECTANGLES))
@@ -140,9 +140,6 @@ class DrawEngineVulkan : public DrawEngineCommon {
void DeviceLost();
void DeviceRestore(VulkanContext *vulkan, Draw::DrawContext *draw);
void SetupVertexDecoder(u32 vertType);
void SetupVertexDecoderInternal(u32 vertType);
// So that this can be inlined
void Flush() {
if (!numDrawCalls)

0 comments on commit 35437e6

Please sign in to comment.