mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 21:39:52 +00:00
D3D11: Similarly to the last vulkan commit, don't create lots of dupe vertex input layouts
This commit is contained in:
parent
43ae868562
commit
4a09289056
@ -188,7 +188,7 @@ static void VertexAttribSetup(D3D11_INPUT_ELEMENT_DESC * VertexElement, u8 fmt,
|
||||
ID3D11InputLayout *DrawEngineD3D11::SetupDecFmtForDraw(D3D11VertexShader *vshader, const DecVtxFormat &decFmt, u32 pspFmt) {
|
||||
// TODO: Instead of one for each vshader, we can reduce it to one for each type of shader
|
||||
// that reads TEXCOORD or not, etc. Not sure if worth it.
|
||||
InputLayoutKey key{ vshader, pspFmt };
|
||||
InputLayoutKey key{ vshader, decFmt.id };
|
||||
ID3D11InputLayout *inputLayout = inputLayoutMap_.Get(key);
|
||||
if (inputLayout) {
|
||||
return inputLayout;
|
||||
|
@ -170,11 +170,11 @@ private:
|
||||
|
||||
struct InputLayoutKey {
|
||||
D3D11VertexShader *vshader;
|
||||
u32 vertType;
|
||||
u32 decFmtId;
|
||||
bool operator <(const InputLayoutKey &other) const {
|
||||
if (vertType < other.vertType)
|
||||
if (decFmtId < other.decFmtId)
|
||||
return true;
|
||||
if (vertType > other.vertType)
|
||||
if (decFmtId > other.decFmtId)
|
||||
return false;
|
||||
return vshader < other.vshader;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user