Fix a few typos in the comments/logging in VideoDX9, VideoCommon, and VideoSoftware projects.

See Render.cpp, PixelShaderGen.cpp, and PixelShaderManager.cpp for most of the changes.

See VertexShaderManager.cpp for a logging typo fix.

See SWRenderer.cpp for a small typo fix for a message that gets swprintf'd in DrawDebugText.

See SWVertexLoader.cpp for a typo fix of an assert message.

Should slightly improve the readability of some of those files.
This commit is contained in:
Lioncash 2013-04-07 17:11:29 -04:00
parent 42e97e462c
commit 195336021f
7 changed files with 21 additions and 21 deletions

View File

@ -390,7 +390,7 @@ static const char *tevCInputTable[] = // CC
"float3(0.5f, 0.5f, 0.5f)", // HALF "float3(0.5f, 0.5f, 0.5f)", // HALF
"(konsttemp.rgb)", //"konsttemp.rgb", // KONST "(konsttemp.rgb)", //"konsttemp.rgb", // KONST
"float3(0.0f, 0.0f, 0.0f)", // ZERO "float3(0.0f, 0.0f, 0.0f)", // ZERO
///aded extra values to map clamped values ///added extra values to map clamped values
"(cprev.rgb)", // CPREV, "(cprev.rgb)", // CPREV,
"(cprev.aaa)", // APREV, "(cprev.aaa)", // APREV,
"(cc0.rgb)", // C0, "(cc0.rgb)", // C0,
@ -1336,7 +1336,7 @@ static void WriteFog(char *&p)
// x_adjust = sqrt((x-center)^2 + k^2)/k // x_adjust = sqrt((x-center)^2 + k^2)/k
// ze *= x_adjust // ze *= x_adjust
//this is complitly teorical as the real hard seems to use a table intead of calculate the values. //this is completely theoretical as the real hardware seems to use a table instead of calculating the values.
if (bpmem.fogRange.Base.Enabled) if (bpmem.fogRange.Base.Enabled)
{ {
WRITE (p, "\tfloat x_adjust = (2.0f * (clipPos.x / " I_FOG"[2].y)) - 1.0f - " I_FOG"[2].x;\n"); WRITE (p, "\tfloat x_adjust = (2.0f * (clipPos.x / " I_FOG"[2].y)) - 1.0f - " I_FOG"[2].x;\n");

View File

@ -245,14 +245,14 @@ void PixelShaderManager::SetConstants()
{ {
//bpmem.fogRange.Base.Center : center of the viewport in x axis. observation: bpmem.fogRange.Base.Center = realcenter + 342; //bpmem.fogRange.Base.Center : center of the viewport in x axis. observation: bpmem.fogRange.Base.Center = realcenter + 342;
int center = ((u32)bpmem.fogRange.Base.Center) - 342; int center = ((u32)bpmem.fogRange.Base.Center) - 342;
// normalice center to make calculations easy // normalize center to make calculations easy
float ScreenSpaceCenter = center / (2.0f * xfregs.viewport.wd); float ScreenSpaceCenter = center / (2.0f * xfregs.viewport.wd);
ScreenSpaceCenter = (ScreenSpaceCenter * 2.0f) - 1.0f; ScreenSpaceCenter = (ScreenSpaceCenter * 2.0f) - 1.0f;
//bpmem.fogRange.K seems to be a table of precalculated coeficients for the adjust factor //bpmem.fogRange.K seems to be a table of precalculated coefficients for the adjust factor
//observations: bpmem.fogRange.K[0].LO apears to be the lowest value and bpmem.fogRange.K[4].HI the largest //observations: bpmem.fogRange.K[0].LO appears to be the lowest value and bpmem.fogRange.K[4].HI the largest
// they always seems to be larger than 256 so my teory is : // they always seems to be larger than 256 so my theory is :
// they are the coeficients from the center to th e border of the screen // they are the coefficients from the center to the border of the screen
// so to simplify i use the hi coeficient as K in the shader taking 256 as the scale // so to simplify I use the hi coefficient as K in the shader taking 256 as the scale
SetPSConstant4f(C_FOG + 2, ScreenSpaceCenter, (float)Renderer::EFBToScaledX((int)(2.0f * xfregs.viewport.wd)), bpmem.fogRange.K[4].HI / 256.0f,0.0f); SetPSConstant4f(C_FOG + 2, ScreenSpaceCenter, (float)Renderer::EFBToScaledX((int)(2.0f * xfregs.viewport.wd)), bpmem.fogRange.K[4].HI / 256.0f,0.0f);
} }
else else

View File

@ -122,7 +122,7 @@ void UpdateProjectionHack(int iPhackvalue[], std::string sPhackvalue[])
if (iPhackvalue[0] == 1) if (iPhackvalue[0] == 1)
{ {
NOTICE_LOG(VIDEO, "\t\t--- Ortographic Projection Hack ON ---"); NOTICE_LOG(VIDEO, "\t\t--- Orthographic Projection Hack ON ---");
fhacksign1 *= (iPhackvalue[1] == 1) ? -1.0f : fhacksign1; fhacksign1 *= (iPhackvalue[1] == 1) ? -1.0f : fhacksign1;
sTemp[0] = (iPhackvalue[1] == 1) ? " * (-1)" : ""; sTemp[0] = (iPhackvalue[1] == 1) ? " * (-1)" : "";
@ -191,7 +191,7 @@ void VertexShaderManager::Dirty()
} }
// Syncs the shader constant buffers with xfmem // Syncs the shader constant buffers with xfmem
// TODO: A cleaner way to control the matricies without making a mess in the parameters field // TODO: A cleaner way to control the matrices without making a mess in the parameters field
void VertexShaderManager::SetConstants() void VertexShaderManager::SetConstants()
{ {
if (g_ActiveConfig.backend_info.APIType == API_OPENGL && !g_ActiveConfig.backend_info.bSupportsGLSLUBO) if (g_ActiveConfig.backend_info.APIType == API_OPENGL && !g_ActiveConfig.backend_info.bSupportsGLSLUBO)

View File

@ -114,9 +114,9 @@ private:
color_surface_Format(D3DFMT_UNKNOWN), depth_surface_Format(D3DFMT_UNKNOWN), color_surface_Format(D3DFMT_UNKNOWN), depth_surface_Format(D3DFMT_UNKNOWN),
depth_ReadBuffer_Format(D3DFMT_UNKNOWN) {} depth_ReadBuffer_Format(D3DFMT_UNKNOWN) {}
LPDIRECT3DTEXTURE9 color_texture;//Texture thats contains the color data of the render target LPDIRECT3DTEXTURE9 color_texture;//Texture that contains the color data of the render target
LPDIRECT3DTEXTURE9 colorRead_texture;//1 pixel texture for temporal data store LPDIRECT3DTEXTURE9 colorRead_texture;//1 pixel texture for temporal data store
LPDIRECT3DTEXTURE9 depth_texture;//Texture thats contains the depth data of the render target LPDIRECT3DTEXTURE9 depth_texture;//Texture that contains the depth data of the render target
LPDIRECT3DTEXTURE9 depthRead_texture;//4 pixel texture for temporal data store LPDIRECT3DTEXTURE9 depthRead_texture;//4 pixel texture for temporal data store
LPDIRECT3DTEXTURE9 color_reinterpret_texture;//buffer used for ReinterpretPixelData LPDIRECT3DTEXTURE9 color_reinterpret_texture;//buffer used for ReinterpretPixelData
@ -126,8 +126,8 @@ private:
LPDIRECT3DSURFACE9 color_surface;//Color Surface LPDIRECT3DSURFACE9 color_surface;//Color Surface
LPDIRECT3DSURFACE9 color_ReadBuffer;//Surface 0 of colorRead_texture LPDIRECT3DSURFACE9 color_ReadBuffer;//Surface 0 of colorRead_texture
LPDIRECT3DSURFACE9 depth_ReadBuffer;//Surface 0 of depthRead_texture LPDIRECT3DSURFACE9 depth_ReadBuffer;//Surface 0 of depthRead_texture
LPDIRECT3DSURFACE9 color_OffScreenReadBuffer;//System memory Surface that can be locked to retriebe the data LPDIRECT3DSURFACE9 color_OffScreenReadBuffer;//System memory Surface that can be locked to retrieve the data
LPDIRECT3DSURFACE9 depth_OffScreenReadBuffer;//System memory Surface that can be locked to retriebe the data LPDIRECT3DSURFACE9 depth_OffScreenReadBuffer;//System memory Surface that can be locked to retrieve the data
D3DFORMAT color_surface_Format;//Format of the color Surface D3DFORMAT color_surface_Format;//Format of the color Surface
D3DFORMAT depth_surface_Format;//Format of the Depth Surface D3DFORMAT depth_surface_Format;//Format of the Depth Surface

View File

@ -455,7 +455,7 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data)
} }
else if(type == PEEK_COLOR) else if(type == PEEK_COLOR)
{ {
// We can't directly StretchRect to System buf because is not suported by all implementations // We can't directly StretchRect to System buf because is not supported by all implementations
// this is the only safe path that works in most cases // this is the only safe path that works in most cases
hr = D3D::dev->StretchRect(pEFBSurf, &RectToLock, pBufferRT, NULL, D3DTEXF_NONE); hr = D3D::dev->StretchRect(pEFBSurf, &RectToLock, pBufferRT, NULL, D3DTEXF_NONE);
D3D::dev->GetRenderTargetData(pBufferRT, pSystemBuf); D3D::dev->GetRenderTargetData(pBufferRT, pSystemBuf);
@ -665,8 +665,8 @@ void Renderer::SetBlendMode(bool forceUpdate)
// Our render target always uses an alpha channel, so we need to override the blend functions to assume a destination alpha of 1 if the render target isn't supposed to have an alpha channel // Our render target always uses an alpha channel, so we need to override the blend functions to assume a destination alpha of 1 if the render target isn't supposed to have an alpha channel
// Example: D3DBLEND_DESTALPHA needs to be D3DBLEND_ONE since the result without an alpha channel is assumed to always be 1. // Example: D3DBLEND_DESTALPHA needs to be D3DBLEND_ONE since the result without an alpha channel is assumed to always be 1.
bool target_has_alpha = bpmem.zcontrol.pixel_format == PIXELFMT_RGBA6_Z24; bool target_has_alpha = bpmem.zcontrol.pixel_format == PIXELFMT_RGBA6_Z24;
//bDstAlphaPass is taked in account because the ability of disabling alpha composition is //bDstAlphaPass is taken into account because the ability to disable alpha composition is
//really usefull for debuging shader and blending errors //really useful for debugging shader and blending errors
bool use_DstAlpha = !g_ActiveConfig.bDstAlphaPass && bpmem.dstalpha.enable && bpmem.blendmode.alphaupdate && target_has_alpha; bool use_DstAlpha = !g_ActiveConfig.bDstAlphaPass && bpmem.dstalpha.enable && bpmem.blendmode.alphaupdate && target_has_alpha;
bool use_DualSource = use_DstAlpha && g_ActiveConfig.backend_info.bSupportsDualSourceBlend; bool use_DualSource = use_DstAlpha && g_ActiveConfig.backend_info.bSupportsDualSourceBlend;
const D3DBLEND d3dSrcFactors[8] = const D3DBLEND d3dSrcFactors[8] =
@ -1133,7 +1133,7 @@ void Renderer::ApplyState(bool bUseDstAlpha)
if(bpmem.zmode.testenable && bpmem.zmode.updateenable) if(bpmem.zmode.testenable && bpmem.zmode.updateenable)
{ {
// This is needed to draw to the correct pixels in multi-pass algorithms // This is needed to draw to the correct pixels in multi-pass algorithms
// to avoid z-figthing and grants that you write to the same pixels // to avoid z-fighting and grants that you write to the same pixels
// affected by the last pass // affected by the last pass
D3D::ChangeRenderState(D3DRS_ZWRITEENABLE, false); D3D::ChangeRenderState(D3DRS_ZWRITEENABLE, false);
D3D::ChangeRenderState(D3DRS_ZFUNC, D3DCMP_EQUAL); D3D::ChangeRenderState(D3DRS_ZFUNC, D3DCMP_EQUAL);
@ -1327,7 +1327,7 @@ void Renderer::SetLineWidth()
// We can't change line width in D3D unless we use ID3DXLine // We can't change line width in D3D unless we use ID3DXLine
float fratio = xfregs.viewport.wd != 0 ? Renderer::EFBToScaledXf(1.f) : 1.0f; float fratio = xfregs.viewport.wd != 0 ? Renderer::EFBToScaledXf(1.f) : 1.0f;
float psize = bpmem.lineptwidth.linesize * fratio / 6.0f; float psize = bpmem.lineptwidth.linesize * fratio / 6.0f;
//little hack to compensate scalling problems in dx9 must be taken out when scalling is fixed. //little hack to compensate scaling problems in dx9 must be taken out when scaling is fixed.
psize *= 2.0f; psize *= 2.0f;
if (psize > m_fMaxPointSize) if (psize > m_fMaxPointSize)
{ {

View File

@ -117,7 +117,7 @@ void SWRenderer::DrawDebugText()
if (g_SWVideoConfig.bShowStats) if (g_SWVideoConfig.bShowStats)
{ {
p+=sprintf(p,"Objects: %i\n",swstats.thisFrame.numDrawnObjects); p+=sprintf(p,"Objects: %i\n",swstats.thisFrame.numDrawnObjects);
p+=sprintf(p,"Primatives: %i\n",swstats.thisFrame.numPrimatives); p+=sprintf(p,"Primitives: %i\n",swstats.thisFrame.numPrimatives);
p+=sprintf(p,"Vertices Loaded: %i\n",swstats.thisFrame.numVerticesLoaded); p+=sprintf(p,"Vertices Loaded: %i\n",swstats.thisFrame.numVerticesLoaded);
p+=sprintf(p,"Triangles Input: %i\n",swstats.thisFrame.numTrianglesIn); p+=sprintf(p,"Triangles Input: %i\n",swstats.thisFrame.numTrianglesIn);

View File

@ -238,7 +238,7 @@ void SWVertexLoader::SetFormat(u8 attributeIndex, u8 primitiveType)
const int elements = tcElements[i]; const int elements = tcElements[i];
_assert_msg_(VIDEO, NOT_PRESENT <= desc && desc <= INDEX16, "Invalid texture coordinates description!\n(desc = %d)", desc); _assert_msg_(VIDEO, NOT_PRESENT <= desc && desc <= INDEX16, "Invalid texture coordinates description!\n(desc = %d)", desc);
_assert_msg_(VIDEO, FORMAT_UBYTE <= format && format <= FORMAT_FLOAT, "Invalid texture coordinates format!\n(format = %d)", format); _assert_msg_(VIDEO, FORMAT_UBYTE <= format && format <= FORMAT_FLOAT, "Invalid texture coordinates format!\n(format = %d)", format);
_assert_msg_(VIDEO, 0 <= elements && elements <= 1, "Invalid number of texture coordinates elemnts!\n(elements = %d)", elements); _assert_msg_(VIDEO, 0 <= elements && elements <= 1, "Invalid number of texture coordinates elements!\n(elements = %d)", elements);
m_texCoordLoader[i] = VertexLoader_TextCoord::GetFunction(desc, format, elements); m_texCoordLoader[i] = VertexLoader_TextCoord::GetFunction(desc, format, elements);
m_VertexSize += VertexLoader_TextCoord::GetSize(desc, format, elements); m_VertexSize += VertexLoader_TextCoord::GetSize(desc, format, elements);