On linux use the current desktop resolution for the default fullscreen resolution, instead of the hard coded 640x480 resolution.

Also if the OpenGL backend throw a panic alert if the RGB to/from YUYV shaders fail to compile instead of an error log.  If these shaders fail to compile it should be reported.  I am not sure that a panic alert should be thrown in general when any shader fails to compile (as was discussed on IRC).

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7677 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice 2011-07-15 02:17:14 +00:00
parent 2eb1565aaa
commit a154df1e7c
2 changed files with 39 additions and 35 deletions

View File

@ -219,8 +219,10 @@ void XRRConfiguration::Update()
char *output_name = NULL;
if (SConfig::GetInstance().m_LocalCoreStartupParameter.strFullscreenResolution.find(':') ==
std::string::npos)
sscanf(SConfig::GetInstance().m_LocalCoreStartupParameter.strFullscreenResolution.c_str(),
"%ux%u", &fullWidth, &fullHeight);
{
fullWidth = fb_width;
fullHeight = fb_height;
}
else
sscanf(SConfig::GetInstance().m_LocalCoreStartupParameter.strFullscreenResolution.c_str(),
"%a[^:]: %ux%u", &output_name, &fullWidth, &fullHeight);

View File

@ -77,9 +77,8 @@ void CreateRgbToYuyvProgram()
" ocol0 = float4(dot(c1,y_const),dot(c01,u_const),dot(c0,y_const),dot(c01, v_const)) + const3;\n"
"}\n";
if (!PixelShaderCache::CompilePixelShader(s_rgbToYuyvProgram, FProgram)) {
ERROR_LOG(VIDEO, "Failed to create RGB to YUYV fragment program");
}
if (!PixelShaderCache::CompilePixelShader(s_rgbToYuyvProgram, FProgram))
PanicAlertT("Failed to create RGB to YUYV fragment program\nReport this issue.");
}
void CreateYuyvToRgbProgram()
@ -104,9 +103,8 @@ void CreateYuyvToRgbProgram()
" 1.0f);\n"
"}\n";
if (!PixelShaderCache::CompilePixelShader(s_yuyvToRgbProgram, FProgram)) {
ERROR_LOG(VIDEO, "Failed to create YUYV to RGB fragment program");
}
if (!PixelShaderCache::CompilePixelShader(s_yuyvToRgbProgram, FProgram))
PanicAlertT("Failed to create YUYV to RGB fragment program\nReport this issue.");
}
FRAGMENTSHADER &GetOrCreateEncodingShader(u32 format)
@ -122,7 +120,8 @@ FRAGMENTSHADER &GetOrCreateEncodingShader(u32 format)
const char* shader = TextureConversionShader::GenerateEncodingShader(format,API_OPENGL);
#if defined(_DEBUG) || defined(DEBUGFAST)
if (g_ActiveConfig.iLog & CONF_SAVESHADERS && shader) {
if (g_ActiveConfig.iLog & CONF_SAVESHADERS && shader)
{
static int counter = 0;
char szTemp[MAX_PATH];
sprintf(szTemp, "%senc_%04i.txt", File::GetUserPath(D_DUMP_IDX).c_str(), counter++);
@ -176,7 +175,8 @@ void Shutdown()
}
void EncodeToRamUsingShader(FRAGMENTSHADER& shader, GLuint srcTexture, const TargetRectangle& sourceRc,
u8* destAddr, int dstWidth, int dstHeight, int readStride, bool toTexture, bool linearFilter)
u8* destAddr, int dstWidth, int dstHeight, int readStride,
bool toTexture, bool linearFilter)
{
@ -441,11 +441,13 @@ void DecodeToTexture(u32 xfbAddr, int srcWidth, int srcHeight, GLuint destTextur
// TODO: make this less slow. (How?)
if((GLsizei)s_srcTextureWidth == (GLsizei)srcFmtWidth && (GLsizei)s_srcTextureHeight == (GLsizei)srcHeight)
{
glTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, 0,0,0,s_srcTextureWidth, s_srcTextureHeight, GL_BGRA, GL_UNSIGNED_BYTE, srcAddr);
glTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, 0,0,0,s_srcTextureWidth, s_srcTextureHeight,
GL_BGRA, GL_UNSIGNED_BYTE, srcAddr);
}
else
{
glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA8, (GLsizei)srcFmtWidth, (GLsizei)srcHeight, 0, GL_BGRA, GL_UNSIGNED_BYTE, srcAddr);
glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA8, (GLsizei)srcFmtWidth, (GLsizei)srcHeight,
0, GL_BGRA, GL_UNSIGNED_BYTE, srcAddr);
s_srcTextureWidth = (GLsizei)srcFmtWidth;
s_srcTextureHeight = (GLsizei)srcHeight;
}