rename some files
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1695 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
2a552421a5
commit
8bf3d83107
|
@ -337,12 +337,12 @@ static const char *alphaRef[2] =
|
|||
|
||||
static const char *tevCOutputTable[] = { "prev.rgb", "c0.rgb", "c1.rgb", "c2.rgb" };
|
||||
static const char *tevAOutputTable[] = { "prev.a", "c0.a", "c1.a", "c2.a" };
|
||||
static const char* tevIndAlphaSel[] = {"", "x", "y", "z"};
|
||||
static const char* tevIndAlphaScale[] = {"", "*32","*16","*8"};
|
||||
static const char* tevIndBiasField[] = {"", "x", "y", "xy", "z", "xz", "yz", "xyz"}; // indexed by bias
|
||||
static const char* tevIndBiasAdd[] = {"-128.0f", "1.0f", "1.0f", "1.0f" }; // indexed by fmt
|
||||
static const char* tevIndWrapStart[] = {"0", "256", "128", "64", "32", "16", "0.001" };
|
||||
static const char* tevIndFmtScale[] = {"255.0f", "31.0f", "15.0f", "8.0f" };
|
||||
static const char *tevIndAlphaSel[] = {"", "x", "y", "z"};
|
||||
static const char *tevIndAlphaScale[] = {"", "*32","*16","*8"};
|
||||
static const char *tevIndBiasField[] = {"", "x", "y", "xy", "z", "xz", "yz", "xyz"}; // indexed by bias
|
||||
static const char *tevIndBiasAdd[] = {"-128.0f", "1.0f", "1.0f", "1.0f" }; // indexed by fmt
|
||||
static const char *tevIndWrapStart[] = {"0", "256", "128", "64", "32", "16", "0.001" };
|
||||
static const char *tevIndFmtScale[] = {"255.0f", "31.0f", "15.0f", "8.0f" };
|
||||
|
||||
#define WRITE p+=sprintf
|
||||
|
||||
|
@ -364,7 +364,7 @@ static void BuildSwapModeTable()
|
|||
}
|
||||
}
|
||||
|
||||
char *GeneratePixelShader(u32 texture_mask, bool has_zbuffer_target, bool bRenderZToCol0)
|
||||
const char *GeneratePixelShader(u32 texture_mask, bool has_zbuffer_target, bool bRenderZToCol0)
|
||||
{
|
||||
text[sizeof(text) - 1] = 0x7C; // canary
|
||||
DVSTARTPROFILE();
|
||||
|
|
|
@ -89,7 +89,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
char *GeneratePixelShader(u32 texture_mask, bool has_zbuffer_target, bool bRenderZToCol0);
|
||||
const char *GeneratePixelShader(u32 texture_mask, bool has_zbuffer_target, bool bRenderZToCol0);
|
||||
void GetPixelShaderId(PIXELSHADERUID &, u32 s_texturemask, u32 zbufrender, u32 zBufRenderToCol0);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -77,7 +77,7 @@ static char text[16384];
|
|||
|
||||
char *GenerateLightShader(char* p, int index, const LitChannel& chan, const char* dest, int coloralpha);
|
||||
|
||||
char *GenerateVertexShader(u32 components, bool has_zbuffer_target)
|
||||
const char *GenerateVertexShader(u32 components, bool has_zbuffer_target)
|
||||
{
|
||||
text[sizeof(text) - 1] = 0x7C; // canary
|
||||
DVSTARTPROFILE();
|
||||
|
|
|
@ -94,7 +94,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
char *GenerateVertexShader(u32 components, bool has_zbuffer_target);
|
||||
const char *GenerateVertexShader(u32 components, bool has_zbuffer_target);
|
||||
void GetVertexShaderId(VERTEXSHADERUID& vid, u32 components, u32 zbufrender);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1205,6 +1205,14 @@
|
|||
RelativePath=".\Src\NativeVertexFormat.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\TransformEngine.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\TransformEngine.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\VertexLoader.cpp"
|
||||
>
|
||||
|
@ -1270,11 +1278,11 @@
|
|||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\PixelShaderManager.cpp"
|
||||
RelativePath=".\Src\PixelShaderCache.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\PixelShaderManager.h"
|
||||
RelativePath=".\Src\PixelShaderCache.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
|
@ -1293,18 +1301,6 @@
|
|||
RelativePath=".\Src\TextureCache.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\TransformEngine.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\TransformEngine.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Transformer.hlsl"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\VertexShader.cpp"
|
||||
>
|
||||
|
@ -1314,11 +1310,11 @@
|
|||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\VertexShaderManager.cpp"
|
||||
RelativePath=".\Src\VertexShaderCache.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\VertexShaderManager.h"
|
||||
RelativePath=".\Src\VertexShaderCache.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
|
|
|
@ -251,13 +251,18 @@ namespace D3D
|
|||
}
|
||||
}
|
||||
dev->GetDeviceCaps(&caps);
|
||||
dev->GetRenderTarget(0,&backBuffer);
|
||||
dev->GetRenderTarget(0, &backBuffer);
|
||||
|
||||
Ps.Major = (D3D::caps.PixelShaderVersion >> 8) & 0xFF;
|
||||
Ps.Minor = (D3D::caps.PixelShaderVersion) & 0xFF;
|
||||
Vs.Major = (D3D::caps.VertexShaderVersion >>8) & 0xFF;
|
||||
Vs.Minor = (D3D::caps.VertexShaderVersion) & 0xFF;
|
||||
|
||||
if (caps.NumSimultaneousRTs < 2)
|
||||
{
|
||||
MessageBox(0, "Warning - your graphics card does not support multiple render targets.", 0, 0);
|
||||
}
|
||||
|
||||
// Device state would normally be set here
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "Statistics.h"
|
||||
#include "Utils.h"
|
||||
#include "Profiler.h"
|
||||
#include "PixelShaderManager.h"
|
||||
#include "PixelShaderCache.h"
|
||||
#include "VertexLoader.h"
|
||||
#include "BPMemory.h"
|
||||
#include "XFMemory.h"
|
|
@ -15,12 +15,13 @@
|
|||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _PIXELSHADERMANAGER_H
|
||||
#define _PIXELSHADERMANAGER_H
|
||||
#ifndef _PIXELSHADERCACHE_H
|
||||
#define _PIXELSHADERCACHE_H
|
||||
|
||||
#include "D3DBase.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "PixelShader.h"
|
||||
#include "VertexShader.h"
|
||||
|
||||
|
@ -33,7 +34,6 @@ class PShaderCache
|
|||
struct PSCacheEntry
|
||||
{
|
||||
LPDIRECT3DPIXELSHADER9 shader;
|
||||
//CGPShader shader;
|
||||
|
||||
int frameCount;
|
||||
PSCacheEntry()
|
||||
|
@ -48,7 +48,6 @@ class PShaderCache
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
typedef std::map<tevhash, PSCacheEntry> PSCache;
|
||||
|
||||
static PSCache pshaders;
|
||||
|
@ -61,4 +60,4 @@ public:
|
|||
};
|
||||
|
||||
|
||||
#endif // _PIXELSHADERMANAGER_H
|
||||
#endif // _PIXELSHADERCACHE_H
|
|
@ -21,7 +21,7 @@
|
|||
#include "Statistics.h"
|
||||
#include "Utils.h"
|
||||
#include "Profiler.h"
|
||||
#include "VertexShaderManager.h"
|
||||
#include "VertexShaderCache.h"
|
||||
#include "VertexLoader.h"
|
||||
#include "BPMemory.h"
|
||||
#include "XFMemory.h"
|
||||
|
@ -93,7 +93,7 @@ void VShaderCache::SetShader()
|
|||
|
||||
void VShaderCache::Cleanup()
|
||||
{
|
||||
for (VSCache::iterator iter=vshaders.begin(); iter!=vshaders.end();)
|
||||
for (VSCache::iterator iter = vshaders.begin(); iter != vshaders.end();)
|
||||
{
|
||||
VSCacheEntry &entry = iter->second;
|
||||
if (entry.frameCount < frameCount - 30)
|
|
@ -15,8 +15,8 @@
|
|||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _VERTEXSHADERMANAGER_H
|
||||
#define _VERTEXSHADERMANAGER_H
|
||||
#ifndef _VERTEXSHADERCACHE_H
|
||||
#define _VERTEXSHADERCACHE_H
|
||||
|
||||
#include "D3DBase.h"
|
||||
|
||||
|
@ -54,4 +54,4 @@ public:
|
|||
static void SetShader();
|
||||
};
|
||||
|
||||
#endif // _VERTEXSHADERMANAGER_H
|
||||
#endif // _VERTEXSHADERCACHE_H
|
|
@ -123,9 +123,9 @@ FRAGMENTSHADER* PixelShaderCache::GetShader()
|
|||
}
|
||||
|
||||
PSCacheEntry& newentry = pshaders[uid];
|
||||
char *code = GeneratePixelShader(PixelShaderManager::GetTextureMask(),
|
||||
Renderer::GetZBufferTarget() != 0,
|
||||
Renderer::GetRenderMode() != Renderer::RM_Normal);
|
||||
const char *code = GeneratePixelShader(PixelShaderManager::GetTextureMask(),
|
||||
Renderer::GetZBufferTarget() != 0,
|
||||
Renderer::GetRenderMode() != Renderer::RM_Normal);
|
||||
|
||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||
if (g_Config.iLog & CONF_SAVESHADERS && code) {
|
||||
|
|
|
@ -227,7 +227,7 @@ TextureMngr::TCacheEntry* TextureMngr::Load(int texstage, u32 address, int width
|
|||
u8 *ptr = g_VideoInitialize.pGetMemoryPointer(address);
|
||||
|
||||
// Needed for texture format using tlut.
|
||||
// TODO: Slower == Safer. Recalculate tlut lenght for each cases just to be sure.
|
||||
// TODO: Slower == Safer. Recalculate tlut length for each cases just to be sure.
|
||||
u32 hashseed = 0;
|
||||
switch (format) {
|
||||
case GX_TF_C4:
|
||||
|
@ -237,7 +237,7 @@ TextureMngr::TCacheEntry* TextureMngr::Load(int texstage, u32 address, int width
|
|||
hashseed = TexDecoder_GetTlutHash((u16*)(texMem + tlutaddr), 256);
|
||||
break;
|
||||
case GX_TF_C14X2:
|
||||
hashseed = TexDecoder_GetTlutHash((u16*)(texMem + tlutaddr), 384);
|
||||
hashseed = TexDecoder_GetTlutHash((u16*)(texMem + tlutaddr), 512);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -386,7 +386,7 @@ void TextureMngr::CopyRenderTargetToTexture(u32 address, bool bFromZBuffer, bool
|
|||
// Z16,GB8,RG8,Z16L,IA8,RA8 - IA8
|
||||
bool bIsInit = textures.find(address) != textures.end();
|
||||
|
||||
PRIM_LOG("copytarg: addr=0x%x, fromz=%d, intfmt=%d, copyfmt=%d\n", address, (int)bFromZBuffer,(int)bIsIntensityFmt,copyfmt);
|
||||
PRIM_LOG("copytarg: addr=0x%x, fromz=%d, intfmt=%d, copyfmt=%d\n", address, (int)bFromZBuffer, (int)bIsIntensityFmt,copyfmt);
|
||||
|
||||
TCacheEntry& entry = textures[address];
|
||||
entry.isNonPow2 = true;
|
||||
|
@ -415,7 +415,7 @@ void TextureMngr::CopyRenderTargetToTexture(u32 address, bool bFromZBuffer, bool
|
|||
// for some reason mario sunshine errors here...
|
||||
GLenum err = GL_NO_ERROR;
|
||||
GL_REPORT_ERROR();
|
||||
if (err == GL_NO_ERROR )
|
||||
if (err == GL_NO_ERROR)
|
||||
bReInit = false;
|
||||
}
|
||||
|
||||
|
@ -551,7 +551,7 @@ void TextureMngr::CopyRenderTargetToTexture(u32 address, bool bFromZBuffer, bool
|
|||
}
|
||||
|
||||
// if (bCopyToTarget) {
|
||||
// _assert_( glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) == GL_FRAMEBUFFER_COMPLETE_EXT );
|
||||
// _assert_(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) == GL_FRAMEBUFFER_COMPLETE_EXT);
|
||||
// glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
|
||||
// GL_REPORT_ERRORD();
|
||||
// glCopyTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, source->left, source->top, source->right-source->left, source->bottom-source->top);
|
||||
|
@ -567,8 +567,8 @@ void TextureMngr::CopyRenderTargetToTexture(u32 address, bool bFromZBuffer, bool
|
|||
|
||||
Renderer::ResetGLState(); // reset any game specific settings
|
||||
|
||||
if (s_TempFramebuffer == 0 )
|
||||
glGenFramebuffersEXT( 1, (GLuint *)&s_TempFramebuffer);
|
||||
if (s_TempFramebuffer == 0)
|
||||
glGenFramebuffersEXT(1, (GLuint *)&s_TempFramebuffer);
|
||||
|
||||
Renderer::SetFramebuffer(s_TempFramebuffer);
|
||||
Renderer::SetRenderTarget(entry.texture);
|
||||
|
@ -622,7 +622,7 @@ void TextureMngr::CopyRenderTargetToTexture(u32 address, bool bFromZBuffer, bool
|
|||
|
||||
TextureMngr::DisableStage(0);
|
||||
|
||||
if (bFromZBuffer )
|
||||
if (bFromZBuffer)
|
||||
Renderer::SetZBufferRender(); // notify for future settings
|
||||
|
||||
GL_REPORT_ERRORD();
|
||||
|
|
Loading…
Reference in New Issue