Fix Windows build, try 3.

This commit is contained in:
NeoBrainX 2013-03-27 00:13:23 +01:00
parent 98362e5934
commit f8d2936840
2 changed files with 13 additions and 11 deletions

View File

@ -182,10 +182,11 @@ bool LineGeometryShader::SetShader(u32 components, float lineWidth,
if (shaderIt == m_shaders.end())
{
// Generate new shader. Warning: not thread-safe.
static char code[16384];
char* p = code;
p = GenerateVSOutputStruct(p, components, API_D3D11);
p += sprintf(p, "\n%s", LINE_GS_COMMON);
static char buffer[16384];
ShaderCode<u32> code;
code.SetBuffer(buffer);
GenerateVSOutputStruct(code, components, API_D3D11);
code.Write("\n%s", LINE_GS_COMMON);
std::stringstream numTexCoordsStream;
numTexCoordsStream << xfregs.numTexGen.numTexGens;
@ -198,7 +199,7 @@ bool LineGeometryShader::SetShader(u32 components, float lineWidth,
{ "NUM_TEXCOORDS", numTexCoordsStr.c_str() },
{ NULL, NULL }
};
ID3D11GeometryShader* newShader = D3D::CompileAndCreateGeometryShader(code, unsigned int(strlen(code)), macros);
ID3D11GeometryShader* newShader = D3D::CompileAndCreateGeometryShader(code.GetBuffer(), unsigned int(strlen(code.GetBuffer())), macros);
if (!newShader)
{
WARN_LOG(VIDEO, "Line geometry shader for components 0x%.08X failed to compile", components);

View File

@ -176,10 +176,11 @@ bool PointGeometryShader::SetShader(u32 components, float pointSize,
if (shaderIt == m_shaders.end())
{
// Generate new shader. Warning: not thread-safe.
static char code[16384];
char* p = code;
p = GenerateVSOutputStruct(p, components, API_D3D11);
p += sprintf(p, "\n%s", POINT_GS_COMMON);
static char buffer[16384];
ShaderCode<u32> code;
code.SetBuffer(buffer);
GenerateVSOutputStruct(code, components, API_D3D11);
code.Write("\n%s", POINT_GS_COMMON);
std::stringstream numTexCoordsStream;
numTexCoordsStream << xfregs.numTexGen.numTexGens;
@ -192,7 +193,7 @@ bool PointGeometryShader::SetShader(u32 components, float pointSize,
{ "NUM_TEXCOORDS", numTexCoordsStr.c_str() },
{ NULL, NULL }
};
ID3D11GeometryShader* newShader = D3D::CompileAndCreateGeometryShader(code, unsigned int(strlen(code)), macros);
ID3D11GeometryShader* newShader = D3D::CompileAndCreateGeometryShader(code.GetBuffer(), unsigned int(strlen(code.GetBuffer())), macros);
if (!newShader)
{
WARN_LOG(VIDEO, "Point geometry shader for components 0x%.08X failed to compile", components);