Remove _ suffix and hide the GPU mode on GLES2

This commit is contained in:
raven02 2013-07-22 04:15:18 +08:00
parent 0216f52359
commit 100d336fb2
6 changed files with 32 additions and 29 deletions

View File

@ -241,8 +241,8 @@ void GLES_GPU::DeviceLost() {
}
void GLES_GPU::InitClear() {
bool useBufferedRendering_ = g_Config.iRenderingMode != 0 ? 1 : 0;
if (!useBufferedRendering_) {
bool useBufferedRendering = g_Config.iRenderingMode != 0 ? 1 : 0;
if (!useBufferedRendering) {
glstate.depthWrite.set(GL_TRUE);
glstate.colorMask.set(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glClearColor(0,0,0,1);

View File

@ -172,7 +172,7 @@ FramebufferManager::FramebufferManager() :
glClearColor(0,0,0,1);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
bool useBufferedRendering_ = g_Config.iRenderingMode != 0 ? 1 : 0;
useBufferedRendering_ = g_Config.iRenderingMode != 0 ? 1 : 0;
// Check vendor string to try and guess GPU
const char *cvendor = (char *)glGetString(GL_VENDOR);
@ -893,7 +893,7 @@ void ConvertFromRGBA8888(u8 *dst, u8 *src, u32 stride, u32 height, int format) {
void FramebufferManager::PackFramebufferGL_(VirtualFramebuffer *vfb) {
GLubyte *packed = 0;
bool unbind = false;
bool useCPU_ = g_Config.iRenderingMode == FB_READFBOMEMORY_CPU ? 1 : 0;
bool useCPU = g_Config.iRenderingMode == FB_READFBOMEMORY_CPU ? 1 : 0;
// We'll prepare two PBOs to switch between readying and reading
if(!pixelBufObj_) {
GLuint pbos[2];
@ -966,7 +966,7 @@ void FramebufferManager::PackFramebufferGL_(VirtualFramebuffer *vfb) {
if(pixelBufObj_[currentPBO_].maxSize < bufSize) {
// We reserve a buffer big enough to fit all those pixels
if(useCPU_ && pixelType != GL_UNSIGNED_BYTE) {
if(useCPU && pixelType != GL_UNSIGNED_BYTE) {
// Wnd result may be 16-bit but we are reading 32-bit, so we need double the space on the buffer
glBufferData(GL_PIXEL_PACK_BUFFER, bufSize*2, NULL, GL_DYNAMIC_READ);
} else {
@ -982,7 +982,7 @@ void FramebufferManager::PackFramebufferGL_(VirtualFramebuffer *vfb) {
pixelBufObj_[currentPBO_].format = vfb->format;
pixelBufObj_[currentPBO_].reading = true;
if(useCPU_) {
if(useCPU) {
// If converting pixel formats on the CPU we'll always request RGBA8888
glPixelStorei(GL_PACK_ALIGNMENT, 4);
glReadPixels(0, 0, vfb->fb_stride, vfb->height, GL_RGBA, GL_UNSIGNED_BYTE, 0);
@ -1010,7 +1010,7 @@ void FramebufferManager::PackFramebufferGL_(VirtualFramebuffer *vfb) {
DEBUG_LOG(HLE, "Reading pbo to mem, bufSize = %u, packed = %08x, fb_address = %08x, pbo = %u",
pixelBufObj_[nextPBO].size, packed, pixelBufObj_[nextPBO].fb_address, nextPBO);
if(useCPU_) {
if(useCPU) {
ConvertFromRGBA8888(Memory::GetPointer(pixelBufObj_[nextPBO].fb_address), packed,
pixelBufObj_[nextPBO].stride, pixelBufObj_[nextPBO].height,
pixelBufObj_[nextPBO].format);
@ -1165,13 +1165,13 @@ void FramebufferManager::DecimateFBOs() {
fbo_unbind();
currentRenderVfb_ = 0;
bool thirdFrame = (gpuStats.numFrames % 3 == 0);
bool useFramebufferToMem_ = g_Config.iRenderingMode > 1 ? 1 : 0;
bool useFramebufferToMem = g_Config.iRenderingMode > 1 ? 1 : 0;
for (size_t i = 0; i < vfbs_.size(); ++i) {
VirtualFramebuffer *vfb = vfbs_[i];
int age = frameLastFramebufUsed - vfb->last_frame_used;
if(useFramebufferToMem_) {
if(useFramebufferToMem) {
// Every third frame we'll commit framebuffers to memory
if(thirdFrame && age <= FBO_OLD_AGE) {
ReadFramebufferToMemory(vfb);

View File

@ -281,8 +281,8 @@ void TransformDrawEngine::ApplyDrawState(int prim) {
float renderWidthFactor, renderHeightFactor;
float renderWidth, renderHeight;
float renderX, renderY;
bool useBufferedRendering_ = g_Config.iRenderingMode != 0 ? 1 : 0;
if (useBufferedRendering_) {
bool useBufferedRendering = g_Config.iRenderingMode != 0 ? 1 : 0;
if (useBufferedRendering) {
renderX = 0;
renderY = 0;
renderWidth = framebufferManager_->GetRenderWidth();

View File

@ -974,7 +974,7 @@ void TextureCache::SetTexture() {
TexCacheEntry *entry = NULL;
gstate_c.flipTexture = false;
gstate_c.skipDrawReason &= ~SKIPDRAW_BAD_FB_TEXTURE;
bool useBufferedRendering_ = g_Config.iRenderingMode != 0 ? 1 : 0;
bool useBufferedRendering = g_Config.iRenderingMode != 0 ? 1 : 0;
bool replaceImages = false;
if (iter != cache.end()) {
@ -982,7 +982,7 @@ void TextureCache::SetTexture() {
// Check for FBO - slow!
if (entry->framebuffer) {
entry->framebuffer->usageFlags |= FB_USAGE_TEXTURE;
if (useBufferedRendering_) {
if (useBufferedRendering) {
if (entry->framebuffer->fbo) {
fbo_bind_color_as_texture(entry->framebuffer->fbo, 0);
} else {

View File

@ -480,8 +480,8 @@ void EmuScreen::render() {
if (invalid_)
return;
bool useBufferedRendering_ = g_Config.iRenderingMode != 0 ? 1 : 0;
if (useBufferedRendering_)
bool useBufferedRendering = g_Config.iRenderingMode != 0 ? 1 : 0;
if (useBufferedRendering)
fbo_unbind();
UIShader_Prepare();

View File

@ -189,36 +189,37 @@ void GameSettingsScreen::CreateViews() {
ViewGroup *graphicsSettings = new LinearLayout(ORIENT_VERTICAL);
graphicsSettingsScroll->Add(graphicsSettings);
tabHolder->AddTab("Graphics", graphicsSettingsScroll);
graphicsSettings->Add(new ItemHeader(gs->T("Rendering Mode")));
static const char *renderingMode[] = { "Non-Buffered Rendering", "Buffered Rendering",
#ifndef USING_GLES2
"Read FBO To Mem(GPU)",
#endif
"Read FBO To Mem(CPU)"
};
graphicsSettings->Add(new PopupMultiChoice(&g_Config.iRenderingMode, gs->T("Rendering Mode"), renderingMode, 0, 4, gs, screenManager()));
graphicsSettings->Add(new ItemHeader(gs->T("Features")));
graphicsSettings->Add(new CheckBox(&g_Config.bHardwareTransform, gs->T("Hardware Transform")));
graphicsSettings->Add(new CheckBox(&g_Config.bVertexCache, gs->T("Vertex Cache")));
graphicsSettings->Add(new CheckBox(&g_Config.bUseVBO, gs->T("Stream VBO")));
graphicsSettings->Add(new CheckBox(&g_Config.bStretchToDisplay, gs->T("Stretch to Display")));
static const char *renderingMode[] = { "Non-Buffered Rendering", "Buffered Rendering", "Read FBO To Mem(GPU)", "Read FBO To Mem(CPU)"};
graphicsSettings->Add(new PopupMultiChoice(&g_Config.iRenderingMode, gs->T("Rendering Mode"), renderingMode, 0, 4, gs, screenManager()));
graphicsSettings->Add(new CheckBox(&g_Config.bDisplayFramebuffer, gs->T("Display Raw Framebuffer")));
graphicsSettings->Add(new CheckBox(&g_Config.bMipMap, gs->T("Mipmapping")));
graphicsSettings->Add(new CheckBox(&g_Config.bUseVBO, gs->T("Stream VBO")));
graphicsSettings->Add(new CheckBox(&g_Config.bTrueColor, gs->T("True Color")));
graphicsSettings->Add(new CheckBox(&g_Config.bDisplayFramebuffer, gs->T("Display Raw Framebuffer")));
#ifdef _WIN32
graphicsSettings->Add(new CheckBox(&g_Config.bVSync, gs->T("VSync")));
graphicsSettings->Add(new CheckBox(&g_Config.bFullScreen, gs->T("FullScreen")));
#endif
// TODO: Does frame rate belong among the graphics settings?
graphicsSettings->Add(new ItemHeader(gs->T("Frame Rate Control")));
static const char *fpsChoices[] = {"None", "Speed", "FPS", "Both"};
graphicsSettings->Add(new PopupMultiChoice(&g_Config.iShowFPSCounter, gs->T("Show FPS Counter"), fpsChoices, 0, 4, gs, screenManager()));
graphicsSettings->Add(new CheckBox(&g_Config.bShowDebugStats, gs->T("Show Debug Statistics")));
graphicsSettings->Add(new PopupSliderChoice(&g_Config.iFrameSkip, 1, 9, gs->T("Frame Skipping"), screenManager()));
graphicsSettings->Add(new ItemHeader(gs->T("Anisotropic Filtering")));
static const char *anisoLevels[] = { "Off", "2x", "4x", "8x", "16x" };
graphicsSettings->Add(new PopupMultiChoice(&g_Config.iAnisotropyLevel, gs->T("Anisotropic Filtering"), anisoLevels, 0, 5, gs, screenManager()));
graphicsSettings->Add(new ItemHeader(gs->T("Texture Scaling")));
static const char *texScaleLevels[] = {
"Off (1x)", "2x", "3x",
@ -229,15 +230,10 @@ void GameSettingsScreen::CreateViews() {
graphicsSettings->Add(new PopupMultiChoice(&g_Config.iTexScalingLevel, gs->T("Upscale Level"), texScaleLevels, 1, 5, gs, screenManager()));
static const char *texScaleAlgos[] = { "xBRZ", "Hybrid", "Bicubic", "Hybrid + Bicubic", };
graphicsSettings->Add(new PopupMultiChoice(&g_Config.iTexScalingType, gs->T("Upscale Type"), texScaleAlgos, 0, 4, gs, screenManager()));
graphicsSettings->Add(new ItemHeader(gs->T("Texture Filtering")));
static const char *texFilters[] = { "Default (auto)", "Nearest", "Linear", "Linear on FMV", };
graphicsSettings->Add(new PopupMultiChoice(&g_Config.iTexFiltering, gs->T("Upscale Type"), texFilters, 1, 4, gs, screenManager()));
#ifdef USING_GLES2
g_Config.bFramebuffersCPUConvert = g_Config.bFramebuffersToMem;
#endif
// Audio
ViewGroup *audioSettingsScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT));
ViewGroup *audioSettings = new LinearLayout(ORIENT_VERTICAL);
@ -266,6 +262,13 @@ void GameSettingsScreen::CreateViews() {
tabHolder->AddTab("System", systemSettingsScroll);
systemSettings->Add(new CheckBox(&g_Config.bJit, s->T("Dynarec", "Dynarec (JIT)")));
systemSettings->Add(new CheckBox(&g_Config.bFastMemory, s->T("Fast Memory", "Fast Memory (Unstable)")));
systemSettings->Add(new CheckBox(&g_Config.bFastMemory, s->T("Day Light Saving")));
static const char *dateFormat[] = { "YYYYMMDD", "MMDDYYYY", "DDMMYYYY"};
graphicsSettings->Add(new PopupMultiChoice(&g_Config.iDateFormat, gs->T("Date Format"), dateFormat, 0, 2, gs, screenManager()));
static const char *timeFormat[] = { "12HR", "24HR"};
graphicsSettings->Add(new PopupMultiChoice(&g_Config.iTimeFormat, gs->T("Time Format"), timeFormat, 0, 1, gs, screenManager()));
static const char *buttonPref[] = { "Use O to confirm", "Use X to confirm"};
graphicsSettings->Add(new PopupMultiChoice(&g_Config.iTimeFormat, gs->T("Button Perference"), buttonPref, 0, 1, gs, screenManager()));
}
void GameSettingsScreen::update(InputState &input) {