Fixed D3D booting. Now for the VS/PS compilation errors
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2488 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
1577dc6893
commit
d5df9f638b
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="Windows-1252"?>
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
<VisualStudioProject
|
<VisualStudioProject
|
||||||
ProjectType="Visual C++"
|
ProjectType="Visual C++"
|
||||||
Version="9,00"
|
Version="9.00"
|
||||||
Name="Core"
|
Name="Core"
|
||||||
ProjectGUID="{F0B874CB-4476-4199-9315-8343D05AE684}"
|
ProjectGUID="{F0B874CB-4476-4199-9315-8343D05AE684}"
|
||||||
RootNamespace="Core"
|
RootNamespace="Core"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="Windows-1252"?>
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
<VisualStudioProject
|
<VisualStudioProject
|
||||||
ProjectType="Visual C++"
|
ProjectType="Visual C++"
|
||||||
Version="9,00"
|
Version="9.00"
|
||||||
Name="Dolphin"
|
Name="Dolphin"
|
||||||
ProjectGUID="{A72606EF-C5C1-4954-90AD-F0F93A8D97D9}"
|
ProjectGUID="{A72606EF-C5C1-4954-90AD-F0F93A8D97D9}"
|
||||||
RootNamespace="DolphinWX"
|
RootNamespace="DolphinWX"
|
||||||
|
|
|
@ -928,7 +928,7 @@ static bool WriteAlphaTest(char *&p)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Seems we need clip for Cg and discard for d3d. sigh.
|
// Seems we need discard for Cg and clip for d3d. sigh.
|
||||||
WRITE(p, "discard( ");
|
WRITE(p, "discard( ");
|
||||||
WriteAlphaCompare(p, 0, bpmem.alphaFunc.comp0);
|
WriteAlphaCompare(p, 0, bpmem.alphaFunc.comp0);
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="Windows-1252"?>
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
<VisualStudioProject
|
<VisualStudioProject
|
||||||
ProjectType="Visual C++"
|
ProjectType="Visual C++"
|
||||||
Version="9,00"
|
Version="9.00"
|
||||||
Name="VideoCommon"
|
Name="VideoCommon"
|
||||||
ProjectGUID="{E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}"
|
ProjectGUID="{E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}"
|
||||||
RootNamespace="VideoCommon"
|
RootNamespace="VideoCommon"
|
||||||
|
@ -655,6 +655,10 @@
|
||||||
RelativePath=".\Src\TextureDecoder.h"
|
RelativePath=".\Src\TextureDecoder.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\Src\VertexLoaderManager.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\Src\VertexLoaderManager.h"
|
RelativePath=".\Src\VertexLoaderManager.h"
|
||||||
>
|
>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="Windows-1252"?>
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
<VisualStudioProject
|
<VisualStudioProject
|
||||||
ProjectType="Visual C++"
|
ProjectType="Visual C++"
|
||||||
Version="9,00"
|
Version="9.00"
|
||||||
Name="Plugin_VideoDX9"
|
Name="Plugin_VideoDX9"
|
||||||
ProjectGUID="{636FAD5F-02D1-4E9A-BE67-FB8EA99B9A18}"
|
ProjectGUID="{636FAD5F-02D1-4E9A-BE67-FB8EA99B9A18}"
|
||||||
RootNamespace="Plugin_VideoDX9"
|
RootNamespace="Plugin_VideoDX9"
|
||||||
|
@ -619,6 +619,7 @@
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
GenerateManifest="false"
|
GenerateManifest="false"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb"
|
ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb"
|
||||||
RandomizedBaseAddress="1"
|
RandomizedBaseAddress="1"
|
||||||
DataExecutionPrevention="0"
|
DataExecutionPrevention="0"
|
||||||
|
@ -1221,10 +1222,6 @@
|
||||||
RelativePath=".\Src\TextureCache.h"
|
RelativePath=".\Src\TextureCache.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath=".\Src\VertexLoaderManager.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath=".\Src\VertexManager.cpp"
|
RelativePath=".\Src\VertexManager.cpp"
|
||||||
>
|
>
|
||||||
|
|
|
@ -1,156 +0,0 @@
|
||||||
// Copyright (C) 2003-2008 Dolphin Project.
|
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU General Public License as published by
|
|
||||||
// the Free Software Foundation, version 2.0.
|
|
||||||
|
|
||||||
// This program is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU General Public License 2.0 for more details.
|
|
||||||
|
|
||||||
// A copy of the GPL 2.0 should have been included with the program.
|
|
||||||
// If not, see http://www.gnu.org/licenses/
|
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
|
||||||
// http://code.google.com/p/dolphin-emu/
|
|
||||||
|
|
||||||
#include <map>
|
|
||||||
|
|
||||||
#include "Statistics.h"
|
|
||||||
|
|
||||||
#include "VertexShaderManager.h"
|
|
||||||
#include "VertexLoader.h"
|
|
||||||
#include "VertexLoaderManager.h"
|
|
||||||
|
|
||||||
static int s_attr_dirty; // bitfield
|
|
||||||
|
|
||||||
static VertexLoader *g_VertexLoaders[8];
|
|
||||||
|
|
||||||
namespace VertexLoaderManager
|
|
||||||
{
|
|
||||||
|
|
||||||
typedef std::map<VertexLoaderUID, VertexLoader *> VertexLoaderMap;
|
|
||||||
static VertexLoaderMap g_VertexLoaderMap;
|
|
||||||
// TODO - change into array of pointers. Keep a map of all seen so far.
|
|
||||||
|
|
||||||
void Init()
|
|
||||||
{
|
|
||||||
MarkAllDirty();
|
|
||||||
for (int i = 0; i < 8; i++)
|
|
||||||
g_VertexLoaders[i] = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Shutdown()
|
|
||||||
{
|
|
||||||
for (VertexLoaderMap::iterator iter = g_VertexLoaderMap.begin(); iter != g_VertexLoaderMap.end(); ++iter)
|
|
||||||
{
|
|
||||||
delete iter->second;
|
|
||||||
}
|
|
||||||
g_VertexLoaderMap.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
void AppendListToString(std::string *dest)
|
|
||||||
{
|
|
||||||
for (VertexLoaderMap::iterator iter = g_VertexLoaderMap.begin(); iter != g_VertexLoaderMap.end(); ++iter)
|
|
||||||
{
|
|
||||||
iter->second->AppendToString(dest);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MarkAllDirty()
|
|
||||||
{
|
|
||||||
s_attr_dirty = 0xff;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void RefreshLoader(int vtx_attr_group)
|
|
||||||
{
|
|
||||||
if ((s_attr_dirty >> vtx_attr_group) & 1)
|
|
||||||
{
|
|
||||||
VertexLoaderUID uid;
|
|
||||||
uid.InitFromCurrentState(vtx_attr_group);
|
|
||||||
VertexLoaderMap::iterator iter = g_VertexLoaderMap.find(uid);
|
|
||||||
if (iter != g_VertexLoaderMap.end())
|
|
||||||
{
|
|
||||||
g_VertexLoaders[vtx_attr_group] = iter->second;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
VertexLoader *loader = new VertexLoader(g_VtxDesc, g_VtxAttr[vtx_attr_group]);
|
|
||||||
g_VertexLoaderMap[uid] = loader;
|
|
||||||
g_VertexLoaders[vtx_attr_group] = loader;
|
|
||||||
INCSTAT(stats.numVertexLoaders);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
s_attr_dirty &= ~(1 << vtx_attr_group);
|
|
||||||
}
|
|
||||||
|
|
||||||
void RunVertices(int vtx_attr_group, int primitive, int count)
|
|
||||||
{
|
|
||||||
if (!count)
|
|
||||||
return;
|
|
||||||
RefreshLoader(vtx_attr_group);
|
|
||||||
g_VertexLoaders[vtx_attr_group]->RunVertices(vtx_attr_group, primitive, count);
|
|
||||||
}
|
|
||||||
|
|
||||||
int GetVertexSize(int vtx_attr_group)
|
|
||||||
{
|
|
||||||
RefreshLoader(vtx_attr_group);
|
|
||||||
return g_VertexLoaders[vtx_attr_group]->GetVertexSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
void LoadCPReg(u32 sub_cmd, u32 value)
|
|
||||||
{
|
|
||||||
switch (sub_cmd & 0xF0)
|
|
||||||
{
|
|
||||||
case 0x30:
|
|
||||||
VertexShaderManager::SetTexMatrixChangedA(value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 0x40:
|
|
||||||
VertexShaderManager::SetTexMatrixChangedB(value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 0x50:
|
|
||||||
g_VtxDesc.Hex &= ~0x1FFFF; // keep the Upper bits
|
|
||||||
g_VtxDesc.Hex |= value;
|
|
||||||
s_attr_dirty = 0xFF;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 0x60:
|
|
||||||
g_VtxDesc.Hex &= 0x1FFFF; // keep the lower 17Bits
|
|
||||||
g_VtxDesc.Hex |= (u64)value << 17;
|
|
||||||
s_attr_dirty = 0xFF;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 0x70:
|
|
||||||
_assert_((sub_cmd & 0x0F) < 8);
|
|
||||||
g_VtxAttr[sub_cmd & 7].g0.Hex = value;
|
|
||||||
s_attr_dirty |= 1 << (sub_cmd & 7);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 0x80:
|
|
||||||
_assert_((sub_cmd & 0x0F) < 8);
|
|
||||||
g_VtxAttr[sub_cmd & 7].g1.Hex = value;
|
|
||||||
s_attr_dirty |= 1 << (sub_cmd & 7);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 0x90:
|
|
||||||
_assert_((sub_cmd & 0x0F) < 8);
|
|
||||||
g_VtxAttr[sub_cmd & 7].g2.Hex = value;
|
|
||||||
s_attr_dirty |= 1 << (sub_cmd & 7);
|
|
||||||
break;
|
|
||||||
|
|
||||||
// Pointers to vertex arrays in GC RAM
|
|
||||||
case 0xA0:
|
|
||||||
arraybases[sub_cmd & 0xF] = value & 0xFFFFFFFF; // huh, why the mask?
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 0xB0:
|
|
||||||
arraystrides[sub_cmd & 0xF] = value & 0xFF;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="Windows-1252"?>
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
<VisualStudioProject
|
<VisualStudioProject
|
||||||
ProjectType="Visual C++"
|
ProjectType="Visual C++"
|
||||||
Version="9,00"
|
Version="9.00"
|
||||||
Name="Plugin_VideoOGL"
|
Name="Plugin_VideoOGL"
|
||||||
ProjectGUID="{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}"
|
ProjectGUID="{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}"
|
||||||
RootNamespace="Plugin_VideoOGL"
|
RootNamespace="Plugin_VideoOGL"
|
||||||
|
@ -734,10 +734,6 @@
|
||||||
RelativePath=".\Src\NativeVertexFormat.cpp"
|
RelativePath=".\Src\NativeVertexFormat.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath=".\Src\VertexLoaderManager.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath=".\Src\VertexManager.cpp"
|
RelativePath=".\Src\VertexManager.cpp"
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in New Issue