mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 15:19:42 -06:00
Run code through the advanced tool 'sed' to remove trailing whitespace.
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
#include "Common.h"
|
||||
#include <vector>
|
||||
|
||||
namespace DX11
|
||||
namespace DX11
|
||||
{
|
||||
|
||||
#define SAFE_RELEASE(x) { if (x) (x)->Release(); (x) = NULL; }
|
||||
|
@ -39,7 +39,6 @@ bool CompileVertexShader(const char* code, unsigned int len, D3DBlob** blob)
|
||||
#endif
|
||||
HRESULT hr = PD3DCompile(code, len, NULL, NULL, NULL, "main", D3D::VertexShaderVersionString(),
|
||||
flags, 0, &shaderBuffer, &errorBuffer);
|
||||
|
||||
if (errorBuffer)
|
||||
{
|
||||
INFO_LOG(VIDEO, "Vertex shader compiler messages:\n%s\n",
|
||||
@ -233,4 +232,4 @@ ID3D11PixelShader* CompileAndCreatePixelShader(const char* code,
|
||||
|
||||
} // namespace
|
||||
|
||||
} // namespace DX11
|
||||
} // namespace DX11
|
||||
|
@ -196,7 +196,7 @@ void XFBSource::DecodeToTexture(u32 xfbAddr, u32 fbWidth, u32 fbHeight)
|
||||
void XFBSource::CopyEFB(float Gamma)
|
||||
{
|
||||
g_renderer->ResetAPIState(); // reset any game specific settings
|
||||
|
||||
|
||||
// Copy EFB data to XFB and restore render target again
|
||||
const D3D11_VIEWPORT vp = CD3D11_VIEWPORT(0.f, 0.f, (float)texWidth, (float)texHeight);
|
||||
|
||||
@ -211,7 +211,7 @@ void XFBSource::CopyEFB(float Gamma)
|
||||
|
||||
D3D::context->OMSetRenderTargets(1, &FramebufferManager::GetEFBColorTexture()->GetRTV(),
|
||||
FramebufferManager::GetEFBDepthTexture()->GetDSV());
|
||||
|
||||
|
||||
g_renderer->RestoreAPIState();
|
||||
}
|
||||
|
||||
|
@ -177,7 +177,7 @@ bool LineGeometryShader::SetShader(u32 components, float lineWidth,
|
||||
|
||||
std::stringstream numTexCoordsStream;
|
||||
numTexCoordsStream << xfregs.numTexGen.numTexGens;
|
||||
|
||||
|
||||
INFO_LOG(VIDEO, "Compiling line geometry shader for components 0x%.08X (num texcoords %d)",
|
||||
components, xfregs.numTexGen.numTexGens);
|
||||
|
||||
|
@ -76,7 +76,7 @@ void D3DVertexFormat::Initialize(const PortableVertexDeclaration &_vtx_decl)
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
if (_vtx_decl.normal_offset[i] > 0)
|
||||
if (_vtx_decl.normal_offset[i] > 0)
|
||||
{
|
||||
m_elems[m_num_elems].SemanticName = "NORMAL";
|
||||
m_elems[m_num_elems].SemanticIndex = i;
|
||||
@ -89,7 +89,7 @@ void D3DVertexFormat::Initialize(const PortableVertexDeclaration &_vtx_decl)
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
if (_vtx_decl.color_offset[i] > 0)
|
||||
if (_vtx_decl.color_offset[i] > 0)
|
||||
{
|
||||
m_elems[m_num_elems].SemanticName = "COLOR";
|
||||
m_elems[m_num_elems].SemanticIndex = i;
|
||||
|
@ -31,7 +31,7 @@
|
||||
|
||||
namespace DX11
|
||||
{
|
||||
|
||||
|
||||
union EFBEncodeParams
|
||||
{
|
||||
struct
|
||||
@ -384,7 +384,7 @@ static const char EFB_ENCODE_PS[] =
|
||||
"sample[y*8+x] = SampleEFB(subBlockUL+float2(x,y));\n"
|
||||
"}\n"
|
||||
"}\n"
|
||||
|
||||
|
||||
"uint dw[4];\n"
|
||||
"for (uint i = 0; i < 4; ++i) {\n"
|
||||
"dw[i] = UINT_44444444_BE(\n"
|
||||
@ -433,7 +433,7 @@ static const char EFB_ENCODE_PS[] =
|
||||
"255*float4(sample2.r, sample6.r, sampleA.r, sampleE.r),\n"
|
||||
"255*float4(sample3.r, sample7.r, sampleB.r, sampleF.r)\n"
|
||||
");\n"
|
||||
|
||||
|
||||
"return dw4;\n"
|
||||
"}\n"
|
||||
|
||||
@ -444,7 +444,7 @@ static const char EFB_ENCODE_PS[] =
|
||||
|
||||
"float2 blockUL = blockCoord * float2(8,4);\n"
|
||||
"float2 subBlockUL = blockUL + float2(0, 2*(cacheCoord.x%2));\n"
|
||||
|
||||
|
||||
"float4 sample0 = SampleEFB(subBlockUL+float2(0,0));\n"
|
||||
"float4 sample1 = SampleEFB(subBlockUL+float2(1,0));\n"
|
||||
"float4 sample2 = SampleEFB(subBlockUL+float2(2,0));\n"
|
||||
@ -486,7 +486,7 @@ static const char EFB_ENCODE_PS[] =
|
||||
"Float8ToUint4(sampleE.a), Float8ToUint4(sampleE.r),\n"
|
||||
"Float8ToUint4(sampleF.a), Float8ToUint4(sampleF.r)\n"
|
||||
");\n"
|
||||
|
||||
|
||||
"return uint4(dw0, dw1, dw2, dw3);\n"
|
||||
"}\n"
|
||||
|
||||
@ -513,7 +513,7 @@ static const char EFB_ENCODE_PS[] =
|
||||
"255*float4(sample1.a, sample3.a, sample5.a, sample7.a),\n"
|
||||
"255*float4(sample1.r, sample3.r, sample5.r, sample7.r)\n"
|
||||
");\n"
|
||||
|
||||
|
||||
"return dw4;\n"
|
||||
"}\n"
|
||||
|
||||
@ -532,7 +532,7 @@ static const char EFB_ENCODE_PS[] =
|
||||
"float4 sample5 = SampleEFB(subBlockUL+float2(1,1));\n"
|
||||
"float4 sample6 = SampleEFB(subBlockUL+float2(2,1));\n"
|
||||
"float4 sample7 = SampleEFB(subBlockUL+float2(3,1));\n"
|
||||
|
||||
|
||||
"uint dw0 = UINT_1616(EncodeRGB565(sample0), EncodeRGB565(sample1));\n"
|
||||
"uint dw1 = UINT_1616(EncodeRGB565(sample2), EncodeRGB565(sample3));\n"
|
||||
"uint dw2 = UINT_1616(EncodeRGB565(sample4), EncodeRGB565(sample5));\n"
|
||||
@ -556,12 +556,12 @@ static const char EFB_ENCODE_PS[] =
|
||||
"float4 sample5 = SampleEFB(subBlockUL+float2(1,1));\n"
|
||||
"float4 sample6 = SampleEFB(subBlockUL+float2(2,1));\n"
|
||||
"float4 sample7 = SampleEFB(subBlockUL+float2(3,1));\n"
|
||||
|
||||
|
||||
"uint dw0 = UINT_1616(EncodeRGB5A3(sample0), EncodeRGB5A3(sample1));\n"
|
||||
"uint dw1 = UINT_1616(EncodeRGB5A3(sample2), EncodeRGB5A3(sample3));\n"
|
||||
"uint dw2 = UINT_1616(EncodeRGB5A3(sample4), EncodeRGB5A3(sample5));\n"
|
||||
"uint dw3 = UINT_1616(EncodeRGB5A3(sample6), EncodeRGB5A3(sample7));\n"
|
||||
|
||||
|
||||
"return Swap4_32(uint4(dw0, dw1, dw2, dw3));\n"
|
||||
"}\n"
|
||||
|
||||
@ -602,7 +602,7 @@ static const char EFB_ENCODE_PS[] =
|
||||
"255*float4(sample1.b, sample3.b, sample5.b, sample7.b)\n"
|
||||
");\n"
|
||||
"}\n"
|
||||
|
||||
|
||||
"return dw4;\n"
|
||||
"}\n"
|
||||
|
||||
@ -612,7 +612,7 @@ static const char EFB_ENCODE_PS[] =
|
||||
|
||||
"float2 blockUL = blockCoord * float2(8,4);\n"
|
||||
"float2 subBlockUL = blockUL + float2(0, 2*(cacheCoord.x%2));\n"
|
||||
|
||||
|
||||
"float4 sample0 = SampleEFB(subBlockUL+float2(0,0));\n"
|
||||
"float4 sample1 = SampleEFB(subBlockUL+float2(1,0));\n"
|
||||
"float4 sample2 = SampleEFB(subBlockUL+float2(2,0));\n"
|
||||
@ -636,7 +636,7 @@ static const char EFB_ENCODE_PS[] =
|
||||
"255*float4(sample2.a, sample6.a, sampleA.a, sampleE.a),\n"
|
||||
"255*float4(sample3.a, sample7.a, sampleB.a, sampleF.a)\n"
|
||||
");\n"
|
||||
|
||||
|
||||
"return dw4;\n"
|
||||
"}\n"
|
||||
|
||||
@ -670,7 +670,7 @@ static const char EFB_ENCODE_PS[] =
|
||||
"255*float4(sample2.r, sample6.r, sampleA.r, sampleE.r),\n"
|
||||
"255*float4(sample3.r, sample7.r, sampleB.r, sampleF.r)\n"
|
||||
");\n"
|
||||
|
||||
|
||||
"return dw4;\n"
|
||||
"}\n"
|
||||
|
||||
@ -705,7 +705,7 @@ static const char EFB_ENCODE_PS[] =
|
||||
"255*float4(sample2.g, sample6.g, sampleA.g, sampleE.g),\n"
|
||||
"255*float4(sample3.g, sample7.g, sampleB.g, sampleF.g)\n"
|
||||
");\n"
|
||||
|
||||
|
||||
"return dw4;\n"
|
||||
"}\n"
|
||||
|
||||
@ -715,7 +715,7 @@ static const char EFB_ENCODE_PS[] =
|
||||
|
||||
"float2 blockUL = blockCoord * float2(8,4);\n"
|
||||
"float2 subBlockUL = blockUL + float2(0, 2*(cacheCoord.x%2));\n"
|
||||
|
||||
|
||||
"float4 sample0 = SampleEFB(subBlockUL+float2(0,0));\n"
|
||||
"float4 sample1 = SampleEFB(subBlockUL+float2(1,0));\n"
|
||||
"float4 sample2 = SampleEFB(subBlockUL+float2(2,0));\n"
|
||||
@ -739,7 +739,7 @@ static const char EFB_ENCODE_PS[] =
|
||||
"255*float4(sample2.b, sample6.b, sampleA.b, sampleE.b),\n"
|
||||
"255*float4(sample3.b, sample7.b, sampleB.b, sampleF.b)\n"
|
||||
");\n"
|
||||
|
||||
|
||||
"return dw4;\n"
|
||||
"}\n"
|
||||
|
||||
@ -765,7 +765,7 @@ static const char EFB_ENCODE_PS[] =
|
||||
"255*float4(sample1.g, sample3.g, sample5.g, sample7.g),\n"
|
||||
"255*float4(sample1.r, sample3.r, sample5.r, sample7.r)\n"
|
||||
");\n"
|
||||
|
||||
|
||||
"return dw4;\n"
|
||||
"}\n"
|
||||
|
||||
@ -792,7 +792,7 @@ static const char EFB_ENCODE_PS[] =
|
||||
"255*float4(sample1.b, sample3.b, sample5.b, sample7.b),\n"
|
||||
"255*float4(sample1.g, sample3.g, sample5.g, sample7.g)\n"
|
||||
");\n"
|
||||
|
||||
|
||||
"return dw4;\n"
|
||||
"}\n"
|
||||
|
||||
@ -902,7 +902,7 @@ void PSTextureEncoder::Init()
|
||||
D3D::SetDebugObjectName(m_outRTV, "efb encoder output rtv");
|
||||
|
||||
// Create output staging buffer
|
||||
|
||||
|
||||
t2dd.Usage = D3D11_USAGE_STAGING;
|
||||
t2dd.BindFlags = 0;
|
||||
t2dd.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
|
||||
@ -998,7 +998,7 @@ void PSTextureEncoder::Init()
|
||||
void PSTextureEncoder::Shutdown()
|
||||
{
|
||||
m_ready = false;
|
||||
|
||||
|
||||
for (size_t i = 0; i < 4; ++i)
|
||||
SAFE_RELEASE(m_fetchClass[i]);
|
||||
for (size_t i = 0; i < 2; ++i)
|
||||
@ -1008,7 +1008,7 @@ void PSTextureEncoder::Shutdown()
|
||||
for (size_t i = 0; i < 16; ++i)
|
||||
SAFE_RELEASE(m_generatorClass[i]);
|
||||
m_linkageArray.clear();
|
||||
|
||||
|
||||
SAFE_RELEASE(m_classLinkage);
|
||||
SAFE_RELEASE(m_dynamicShader);
|
||||
|
||||
@ -1073,13 +1073,13 @@ size_t PSTextureEncoder::Encode(u8* dst, unsigned int dstFormat,
|
||||
_assert_msg_(VIDEO, totalCacheLines*32 <= MAX_BYTES_PER_ENCODE, "total encode size sanity check");
|
||||
|
||||
size_t encodeSize = 0;
|
||||
|
||||
|
||||
// Reset API
|
||||
|
||||
g_renderer->ResetAPIState();
|
||||
|
||||
// Set up all the state for EFB encoding
|
||||
|
||||
|
||||
#ifdef USE_DYNAMIC_MODE
|
||||
if (SetDynamicShader(dstFormat, srcFormat, isIntensity, scaleByHalf))
|
||||
#else
|
||||
@ -1092,7 +1092,7 @@ size_t PSTextureEncoder::Encode(u8* dst, unsigned int dstFormat,
|
||||
D3D::stateman->PushDepthState(m_efbEncodeDepthState);
|
||||
D3D::stateman->PushRasterizerState(m_efbEncodeRastState);
|
||||
D3D::stateman->Apply();
|
||||
|
||||
|
||||
D3D11_VIEWPORT vp = CD3D11_VIEWPORT(0.f, 0.f, FLOAT(cacheLinesPerRow*2), FLOAT(numBlocksY));
|
||||
D3D::context->RSSetViewports(1, &vp);
|
||||
|
||||
@ -1101,14 +1101,14 @@ size_t PSTextureEncoder::Encode(u8* dst, unsigned int dstFormat,
|
||||
UINT stride = sizeof(QuadVertex);
|
||||
UINT offset = 0;
|
||||
D3D::context->IASetVertexBuffers(0, 1, &m_quad, &stride, &offset);
|
||||
|
||||
|
||||
EFBRectangle fullSrcRect;
|
||||
fullSrcRect.left = 0;
|
||||
fullSrcRect.top = 0;
|
||||
fullSrcRect.right = EFB_WIDTH;
|
||||
fullSrcRect.bottom = EFB_HEIGHT;
|
||||
TargetRectangle targetRect = g_renderer->ConvertEFBRectangle(fullSrcRect);
|
||||
|
||||
|
||||
EFBEncodeParams params = { 0 };
|
||||
params.NumHalfCacheLinesX = FLOAT(cacheLinesPerRow*2);
|
||||
params.NumBlocksY = FLOAT(numBlocksY);
|
||||
@ -1121,7 +1121,7 @@ size_t PSTextureEncoder::Encode(u8* dst, unsigned int dstFormat,
|
||||
D3D::context->UpdateSubresource(m_encodeParams, 0, NULL, ¶ms, 0, 0);
|
||||
|
||||
D3D::context->VSSetConstantBuffers(0, 1, &m_encodeParams);
|
||||
|
||||
|
||||
D3D::context->OMSetRenderTargets(1, &m_outRTV, NULL);
|
||||
|
||||
ID3D11ShaderResourceView* pEFB = (srcFormat == PIXELFMT_Z24) ?
|
||||
@ -1145,17 +1145,17 @@ size_t PSTextureEncoder::Encode(u8* dst, unsigned int dstFormat,
|
||||
D3D::context->CopySubresourceRegion(m_outStage, 0, 0, 0, 0, m_out, 0, &srcBox);
|
||||
|
||||
// Clean up state
|
||||
|
||||
|
||||
IUnknown* nullDummy = NULL;
|
||||
|
||||
D3D::context->PSSetSamplers(0, 1, (ID3D11SamplerState**)&nullDummy);
|
||||
D3D::context->PSSetShaderResources(0, 1, (ID3D11ShaderResourceView**)&nullDummy);
|
||||
D3D::context->PSSetConstantBuffers(0, 1, (ID3D11Buffer**)&nullDummy);
|
||||
|
||||
|
||||
D3D::context->OMSetRenderTargets(0, NULL, NULL);
|
||||
|
||||
D3D::context->VSSetConstantBuffers(0, 1, (ID3D11Buffer**)&nullDummy);
|
||||
|
||||
|
||||
D3D::stateman->PopRasterizerState();
|
||||
D3D::stateman->PopDepthState();
|
||||
D3D::stateman->PopBlendState();
|
||||
@ -1312,7 +1312,7 @@ bool PSTextureEncoder::InitDynamicMode()
|
||||
hr = D3D::device->CreatePixelShader(bytecode->Data(), bytecode->Size(), m_classLinkage, &m_dynamicShader);
|
||||
CHECK(SUCCEEDED(hr), "create efb encode pixel shader");
|
||||
D3D::SetDebugObjectName(m_dynamicShader, "efb encoder pixel shader");
|
||||
|
||||
|
||||
// Use D3DReflect
|
||||
|
||||
ID3D11ShaderReflection* reflect = NULL;
|
||||
@ -1438,7 +1438,7 @@ bool PSTextureEncoder::SetDynamicShader(unsigned int dstFormat,
|
||||
m_linkageArray[m_intensitySlot] = m_intensityClass[intensityNum];
|
||||
if (m_generatorSlot != UINT(-1))
|
||||
m_linkageArray[m_generatorSlot] = m_generatorClass[generatorNum];
|
||||
|
||||
|
||||
D3D::context->PSSetShader(m_dynamicShader,
|
||||
m_linkageArray.empty() ? NULL : &m_linkageArray[0],
|
||||
(UINT)m_linkageArray.size());
|
||||
|
@ -37,7 +37,7 @@ public:
|
||||
bool scaleByHalf);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
bool m_ready;
|
||||
|
||||
ID3D11Texture2D* m_out;
|
||||
@ -73,7 +73,7 @@ private:
|
||||
|
||||
// Stuff only used for dynamic-linking mode (SM5.0+, available as soon as
|
||||
// Microsoft fixes their bloody HLSL compiler)
|
||||
|
||||
|
||||
bool InitDynamicMode();
|
||||
bool SetDynamicShader(unsigned int dstFormat, unsigned int srcFormat,
|
||||
bool isIntensity, bool scaleByHalf);
|
||||
|
@ -80,7 +80,7 @@ const char color_matrix_program_code[] = {
|
||||
"sampler samp0 : register(s0);\n"
|
||||
"Texture2D Tex0 : register(t0);\n"
|
||||
"uniform float4 cColMatrix[7] : register(c0);\n"
|
||||
"void main(\n"
|
||||
"void main(\n"
|
||||
"out float4 ocol0 : SV_Target,\n"
|
||||
"in float4 pos : SV_Position,\n"
|
||||
" in float2 uv0 : TEXCOORD0){\n"
|
||||
@ -94,7 +94,7 @@ const char color_matrix_program_code_msaa[] = {
|
||||
"sampler samp0 : register(s0);\n"
|
||||
"Texture2DMS<float4, %d> Tex0 : register(t0);\n"
|
||||
"uniform float4 cColMatrix[7] : register(c0);\n"
|
||||
"void main(\n"
|
||||
"void main(\n"
|
||||
"out float4 ocol0 : SV_Target,\n"
|
||||
"in float4 pos : SV_Position,\n"
|
||||
" in float2 uv0 : TEXCOORD0){\n"
|
||||
@ -343,7 +343,7 @@ ID3D11Buffer* &PixelShaderCache::GetConstantBuffer()
|
||||
memcpy(map.pData, &PixelShaderManager::constants, sizeof(PixelShaderConstants));
|
||||
D3D::context->Unmap(pscbuf, 0);
|
||||
PixelShaderManager::dirty = false;
|
||||
|
||||
|
||||
ADDSTAT(stats.thisFrame.bytesUniformStreamed, sizeof(PixelShaderConstants));
|
||||
}
|
||||
return pscbuf;
|
||||
@ -368,7 +368,7 @@ void PixelShaderCache::Init()
|
||||
D3D::SetDebugObjectName((ID3D11DeviceChild*)pscbuf, "pixel shader constant buffer used to emulate the GX pipeline");
|
||||
|
||||
// used when drawing clear quads
|
||||
s_ClearProgram = D3D::CompileAndCreatePixelShader(clear_program_code, sizeof(clear_program_code));
|
||||
s_ClearProgram = D3D::CompileAndCreatePixelShader(clear_program_code, sizeof(clear_program_code));
|
||||
CHECK(s_ClearProgram!=NULL, "Create clear pixel shader");
|
||||
D3D::SetDebugObjectName((ID3D11DeviceChild*)s_ClearProgram, "clear pixel shader");
|
||||
|
||||
@ -441,7 +441,7 @@ void PixelShaderCache::Shutdown()
|
||||
SAFE_RELEASE(s_rgba6_to_rgb8[i]);
|
||||
SAFE_RELEASE(s_rgb8_to_rgba6[i]);
|
||||
}
|
||||
|
||||
|
||||
Clear();
|
||||
g_ps_disk_cache.Sync();
|
||||
g_ps_disk_cache.Close();
|
||||
@ -477,7 +477,7 @@ bool PixelShaderCache::SetShader(DSTALPHA_MODE dstAlphaMode, u32 components)
|
||||
{
|
||||
const PSCacheEntry &entry = iter->second;
|
||||
last_entry = &entry;
|
||||
|
||||
|
||||
GFX_DEBUGGER_PAUSE_AT(NEXT_PIXEL_SHADER_CHANGE,true);
|
||||
return (entry.shader != NULL);
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ bool PointGeometryShader::SetShader(u32 components, float pointSize,
|
||||
code.SetBuffer(buffer);
|
||||
GenerateVSOutputStructForGS(code, components, API_D3D);
|
||||
code.Write("\n%s", POINT_GS_COMMON);
|
||||
|
||||
|
||||
std::stringstream numTexCoordsStream;
|
||||
numTexCoordsStream << xfregs.numTexGen.numTexGens;
|
||||
|
||||
|
@ -293,7 +293,7 @@ bool Renderer::CheckForResize()
|
||||
|
||||
// Sanity check
|
||||
if ((client_width != Renderer::GetBackbufferWidth() ||
|
||||
client_height != Renderer::GetBackbufferHeight()) &&
|
||||
client_height != Renderer::GetBackbufferHeight()) &&
|
||||
client_width >= 4 && client_height >= 4)
|
||||
{
|
||||
return true;
|
||||
@ -449,7 +449,7 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data)
|
||||
else if (bpmem.zcontrol.pixel_format == PIXELFMT_RGB565_Z16)
|
||||
{
|
||||
ret = RGBA8ToRGB565ToRGBA8(ret);
|
||||
}
|
||||
}
|
||||
if(bpmem.zcontrol.pixel_format != PIXELFMT_RGBA6_Z24)
|
||||
{
|
||||
ret |= 0xFF000000;
|
||||
@ -537,7 +537,7 @@ void Renderer::ClearScreen(const EFBRectangle& rc, bool colorEnable, bool alphaE
|
||||
|
||||
// Update the view port for clearing the picture
|
||||
TargetRectangle targetRc = Renderer::ConvertEFBRectangle(rc);
|
||||
D3D11_VIEWPORT vp = CD3D11_VIEWPORT((float)targetRc.left, (float)targetRc.top, (float)targetRc.GetWidth(), (float)targetRc.GetHeight(), 0.f, 1.f);
|
||||
D3D11_VIEWPORT vp = CD3D11_VIEWPORT((float)targetRc.left, (float)targetRc.top, (float)targetRc.GetWidth(), (float)targetRc.GetHeight(), 0.f, 1.f);
|
||||
D3D::context->RSSetViewports(1, &vp);
|
||||
|
||||
// Color is passed in bgra mode so we need to convert it to rgba
|
||||
@ -794,7 +794,7 @@ void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbHeight,const EFBRectangle& r
|
||||
{
|
||||
xfbSource = xfbSourceList[i];
|
||||
MathUtil::Rectangle<float> sourceRc;
|
||||
|
||||
|
||||
sourceRc.left = 0;
|
||||
sourceRc.top = 0;
|
||||
sourceRc.right = (float)xfbSource->texWidth;
|
||||
@ -1252,7 +1252,7 @@ void Renderer::SetLogicOpMode()
|
||||
D3D11_BLEND_INV_DEST_COLOR,//10
|
||||
D3D11_BLEND_ONE,//11
|
||||
D3D11_BLEND_INV_SRC_COLOR,//12
|
||||
D3D11_BLEND_INV_SRC_COLOR,//13
|
||||
D3D11_BLEND_INV_SRC_COLOR,//13
|
||||
D3D11_BLEND_INV_DEST_COLOR,//14
|
||||
D3D11_BLEND_ONE//15
|
||||
};
|
||||
@ -1271,7 +1271,7 @@ void Renderer::SetLogicOpMode()
|
||||
D3D11_BLEND_INV_DEST_COLOR,//10
|
||||
D3D11_BLEND_INV_DEST_COLOR,//11
|
||||
D3D11_BLEND_INV_SRC_COLOR,//12
|
||||
D3D11_BLEND_ONE,//13
|
||||
D3D11_BLEND_ONE,//13
|
||||
D3D11_BLEND_INV_SRC_COLOR,//14
|
||||
D3D11_BLEND_ONE//15
|
||||
};
|
||||
@ -1322,7 +1322,7 @@ void Renderer::SetSamplerState(int stage, int texindex)
|
||||
const FourTexUnits &tex = bpmem.tex[texindex];
|
||||
const TexMode0 &tm0 = tex.texMode0[stage];
|
||||
const TexMode1 &tm1 = tex.texMode1[stage];
|
||||
|
||||
|
||||
unsigned int mip = d3dMipFilters[tm0.min_filter & 3];
|
||||
|
||||
if (texindex) stage += 4;
|
||||
|
@ -103,7 +103,7 @@ void Television::Init()
|
||||
D3D::SetDebugObjectName(m_pShader, "yuyv decoder pixel shader");
|
||||
|
||||
// Create sampler state and set border color
|
||||
//
|
||||
//
|
||||
// The default sampler border color of { 0.f, 0.f, 0.f, 0.f }
|
||||
// creates a green border around the image - see issue 6483
|
||||
// (remember, the XFB is being interpreted as YUYV, and 0,0,0,0
|
||||
|
@ -83,10 +83,10 @@ TextureCache::TCacheEntryBase* TextureCache::CreateTexture(unsigned int width,
|
||||
|
||||
// TODO: better debug names
|
||||
D3D::SetDebugObjectName((ID3D11DeviceChild*)entry->texture->GetTex(), "a texture of the TextureCache");
|
||||
D3D::SetDebugObjectName((ID3D11DeviceChild*)entry->texture->GetSRV(), "shader resource view of a texture of the TextureCache");
|
||||
D3D::SetDebugObjectName((ID3D11DeviceChild*)entry->texture->GetSRV(), "shader resource view of a texture of the TextureCache");
|
||||
|
||||
SAFE_RELEASE(pTexture);
|
||||
|
||||
|
||||
if (tex_levels != 1)
|
||||
entry->Load(width, height, expanded_width, 0);
|
||||
|
||||
@ -138,7 +138,7 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo
|
||||
VertexShaderCache::GetSimpleVertexShader(), VertexShaderCache::GetSimpleInputLayout());
|
||||
|
||||
D3D::context->OMSetRenderTargets(1, &FramebufferManager::GetEFBColorTexture()->GetRTV(), FramebufferManager::GetEFBDepthTexture()->GetDSV());
|
||||
|
||||
|
||||
g_renderer->RestoreAPIState();
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ void VertexManager::CreateDeviceObjects()
|
||||
m_line_draw_index = 0;
|
||||
m_point_draw_index = 0;
|
||||
m_index_buffers = new PID3D11Buffer[MAX_VBUFFER_COUNT];
|
||||
m_vertex_buffers = new PID3D11Buffer[MAX_VBUFFER_COUNT];
|
||||
m_vertex_buffers = new PID3D11Buffer[MAX_VBUFFER_COUNT];
|
||||
for (m_current_index_buffer = 0; m_current_index_buffer < MAX_VBUFFER_COUNT; m_current_index_buffer++)
|
||||
{
|
||||
m_index_buffers[m_current_index_buffer] = NULL;
|
||||
@ -74,7 +74,7 @@ void VertexManager::DestroyDeviceObjects()
|
||||
SAFE_RELEASE(m_vertex_buffers[m_current_vertex_buffer]);
|
||||
SAFE_RELEASE(m_index_buffers[m_current_vertex_buffer]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
VertexManager::VertexManager()
|
||||
@ -96,7 +96,7 @@ void VertexManager::PrepareDrawBuffers()
|
||||
if (m_vertex_buffer_cursor + vSize >= VBUFFER_SIZE)
|
||||
{
|
||||
// Wrap around
|
||||
m_current_vertex_buffer = (m_current_vertex_buffer + 1) % MAX_VBUFFER_COUNT;
|
||||
m_current_vertex_buffer = (m_current_vertex_buffer + 1) % MAX_VBUFFER_COUNT;
|
||||
m_vertex_buffer_cursor = 0;
|
||||
MapType = D3D11_MAP_WRITE_DISCARD;
|
||||
}
|
||||
@ -114,7 +114,7 @@ void VertexManager::PrepareDrawBuffers()
|
||||
if (m_index_buffer_cursor + iCount >= (IBUFFER_SIZE / sizeof(u16)))
|
||||
{
|
||||
// Wrap around
|
||||
m_current_index_buffer = (m_current_index_buffer + 1) % MAX_VBUFFER_COUNT;
|
||||
m_current_index_buffer = (m_current_index_buffer + 1) % MAX_VBUFFER_COUNT;
|
||||
m_index_buffer_cursor = 0;
|
||||
MapType = D3D11_MAP_WRITE_DISCARD;
|
||||
}
|
||||
@ -128,7 +128,7 @@ void VertexManager::PrepareDrawBuffers()
|
||||
memcpy((u16*)map.pData + m_point_draw_index, GetPointIndexBuffer(), sizeof(u16) * IndexGenerator::GetPointindexLen());
|
||||
D3D::context->Unmap(m_index_buffers[m_current_index_buffer], 0);
|
||||
m_index_buffer_cursor += iCount;
|
||||
|
||||
|
||||
ADDSTAT(stats.thisFrame.bytesVertexStreamed, vSize);
|
||||
ADDSTAT(stats.thisFrame.bytesIndexStreamed, iCount*sizeof(u16));
|
||||
}
|
||||
@ -141,7 +141,7 @@ void VertexManager::Draw(UINT stride)
|
||||
{
|
||||
D3D::context->IASetVertexBuffers(0, 1, &m_vertex_buffers[m_current_vertex_buffer], &stride, &m_vertex_draw_offset);
|
||||
D3D::context->IASetIndexBuffer(m_index_buffers[m_current_index_buffer], DXGI_FORMAT_R16_UINT, 0);
|
||||
|
||||
|
||||
if (IndexGenerator::GetNumTriangles() > 0)
|
||||
{
|
||||
D3D::context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
|
||||
@ -217,10 +217,10 @@ void VertexManager::vFlush()
|
||||
{
|
||||
g_renderer->SetSamplerState(i & 3, i >> 2);
|
||||
const FourTexUnits &tex = bpmem.tex[i >> 2];
|
||||
const TextureCache::TCacheEntryBase* tentry = TextureCache::Load(i,
|
||||
const TextureCache::TCacheEntryBase* tentry = TextureCache::Load(i,
|
||||
(tex.texImage3[i&3].image_base/* & 0x1FFFFF*/) << 5,
|
||||
tex.texImage0[i&3].width + 1, tex.texImage0[i&3].height + 1,
|
||||
tex.texImage0[i&3].format, tex.texTlut[i&3].tmem_offset<<9,
|
||||
tex.texImage0[i&3].format, tex.texTlut[i&3].tmem_offset<<9,
|
||||
tex.texTlut[i&3].tlut_format,
|
||||
(tex.texMode0[i&3].min_filter & 3),
|
||||
(tex.texMode1[i&3].max_lod + 0xf) / 0x10,
|
||||
|
@ -23,7 +23,7 @@ public:
|
||||
void DestroyDeviceObjects();
|
||||
|
||||
private:
|
||||
|
||||
|
||||
void PrepareDrawBuffers();
|
||||
void Draw(u32 stride);
|
||||
// temp
|
||||
|
@ -47,7 +47,7 @@ ID3D11Buffer* &VertexShaderCache::GetConstantBuffer()
|
||||
memcpy(map.pData, &VertexShaderManager::constants, sizeof(VertexShaderConstants));
|
||||
D3D::context->Unmap(vscbuf, 0);
|
||||
VertexShaderManager::dirty = false;
|
||||
|
||||
|
||||
ADDSTAT(stats.thisFrame.bytesUniformStreamed, sizeof(VertexShaderConstants));
|
||||
}
|
||||
return vscbuf;
|
||||
@ -87,7 +87,7 @@ const char clear_shader_code[] = {
|
||||
"struct VSOUTPUT\n"
|
||||
"{\n"
|
||||
"float4 vPosition : POSITION;\n"
|
||||
"float4 vColor0 : COLOR0;\n"
|
||||
"float4 vColor0 : COLOR0;\n"
|
||||
"};\n"
|
||||
"VSOUTPUT main(float4 inPosition : POSITION,float4 inColor0: COLOR0)\n"
|
||||
"{\n"
|
||||
@ -104,7 +104,7 @@ void VertexShaderCache::Init()
|
||||
{
|
||||
{ "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
|
||||
{ "TEXCOORD", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 },
|
||||
|
||||
|
||||
};
|
||||
const D3D11_INPUT_ELEMENT_DESC clearelems[2] =
|
||||
{
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
|
||||
private:
|
||||
struct VSCacheEntry
|
||||
{
|
||||
{
|
||||
ID3D11VertexShader* shader;
|
||||
D3DBlob* bytecode; // needed to initialize the input layout
|
||||
|
||||
@ -55,7 +55,7 @@ private:
|
||||
}
|
||||
};
|
||||
typedef std::map<VertexShaderUid, VSCacheEntry> VSCache;
|
||||
|
||||
|
||||
static VSCache vshaders;
|
||||
static const VSCacheEntry* last_entry;
|
||||
static VertexShaderUid last_uid;
|
||||
|
@ -9,4 +9,4 @@
|
||||
#endif
|
||||
|
||||
#include <tchar.h>
|
||||
#include <windows.h>
|
||||
#include <windows.h>
|
||||
|
Reference in New Issue
Block a user