diff --git a/rendering/PCDX11StreamDeclCache.cpp b/rendering/PCDX11StreamDeclCache.cpp index 4469d98..ee70671 100644 --- a/rendering/PCDX11StreamDeclCache.cpp +++ b/rendering/PCDX11StreamDeclCache.cpp @@ -9,7 +9,7 @@ namespace cdc { -DXGI_FORMAT decodeFormat(uint16_t format); +DXGI_FORMAT MakeElementFormat(uint16_t format); PCDX11StreamDecl *PCDX11StreamDeclCache::buildStreamDecl( VertexDecl *layout, @@ -22,7 +22,7 @@ PCDX11StreamDecl *PCDX11StreamDeclCache::buildStreamDecl( if (it.second) { D3D11_INPUT_ELEMENT_DESC *inputElementDesc = new D3D11_INPUT_ELEMENT_DESC[layout->numAttr]; memset(inputElementDesc, 0, sizeof(D3D11_INPUT_ELEMENT_DESC) * layout->numAttr); - decodeVertexAttribA(inputElementDesc, layout->attrib, layout->numAttr, shaderSub->wineWorkaround); + MakeD3DVertexElements(inputElementDesc, layout->attrib, layout->numAttr, shaderSub->wineWorkaround); streamDecl = new PCDX11StreamDecl(renderDevice, inputElementDesc, layout->numAttr, shaderSub); // HACK @@ -95,7 +95,7 @@ PCDX11StreamDecl *PCDX11StreamDeclCache::buildStreamDecl( inputElementDesc[numElements].InputSlot = 0; inputElementDesc[numElements].AlignedByteOffset = layoutA->attrib[indexA].offset; - inputElementDesc[numElements].Format = decodeFormat(layoutA->attrib[indexA].format); + inputElementDesc[numElements].Format = MakeElementFormat(layoutA->attrib[indexA].format); if (attribB->attribKindB >= 10 && attribB->attribKindB < 14) { if (layoutA->attrib[indexA].format < 19 || diff --git a/rendering/VertexDeclaration.cpp b/rendering/VertexDeclaration.cpp index 817aa23..31b10a0 100644 --- a/rendering/VertexDeclaration.cpp +++ b/rendering/VertexDeclaration.cpp @@ -14,7 +14,7 @@ uint16_t getLayoutAIndexFromHash( return 0xffff; } -DXGI_FORMAT decodeFormat(uint16_t format) { +DXGI_FORMAT MakeElementFormat(uint16_t format) { switch (format) { case 0: return DXGI_FORMAT_R32_FLOAT; // 41 case 1: return DXGI_FORMAT_R32G32_FLOAT; // 16 @@ -50,18 +50,18 @@ DXGI_FORMAT decodeFormat(uint16_t format) { } // very confusingly, the mesh will sometimes have two inputs called -// Texcoord1 and Texcoord2, which when decoded using decodeVertexAttribA +// Texcoord1 and Texcoord2, which when decoded using MakeD3DVertexElements // will turn into the same semantics in d3d. // But when using semanticFromEnum they will be mapped to Texcoord0 and // Texcoord1, which is what the pixel shader expects. -void decodeVertexAttribA(D3D11_INPUT_ELEMENT_DESC *dst, VertexAttributeA *src, uint32_t count, bool wineWorkaround) { +void MakeD3DVertexElements(D3D11_INPUT_ELEMENT_DESC *dst, VertexAttributeA *src, uint32_t count, bool wineWorkaround) { uint32_t customSlots = 0; for (uint32_t i=0; i 0xffffffff - dst[i].Format = decodeFormat(src[i].format); + dst[i].Format = MakeElementFormat(src[i].format); auto& elem = dst[i]; auto kind = src[i].attribKind; if (kind == VertexAttributeA::kPosition) { diff --git a/rendering/VertexDeclaration.h b/rendering/VertexDeclaration.h index 6084299..71d1238 100644 --- a/rendering/VertexDeclaration.h +++ b/rendering/VertexDeclaration.h @@ -82,7 +82,7 @@ uint16_t getLayoutAIndexFromHash( VertexDecl *layoutA, uint32_t hash); -void decodeVertexAttribA( +void MakeD3DVertexElements( D3D11_INPUT_ELEMENT_DESC *dst, VertexAttributeA *src, uint32_t count, diff --git a/spinnycube.cpp b/spinnycube.cpp index 8b314da..b549d00 100644 --- a/spinnycube.cpp +++ b/spinnycube.cpp @@ -1439,7 +1439,7 @@ int spinnyCube(HWND window, ImGui::TableSetColumnIndex(0); if (auto *vertexDecl = uiact.selectedVertexDecl) { D3D11_INPUT_ELEMENT_DESC elems[vertexDecl->numAttr]; - decodeVertexAttribA(elems, vertexDecl->attrib, vertexDecl->numAttr, false); + MakeD3DVertexElements(elems, vertexDecl->attrib, vertexDecl->numAttr, false); for (uint32_t i = 0; i < vertexDecl->numAttr; i++) ImGui::Text("%08x %s %d", vertexDecl->attrib[i].attribKind,