From 6d6ea77df23480048e88924e1070d2d8228ad0eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 9 Oct 2013 11:01:52 +0200 Subject: [PATCH] Add comments (speedup plans for GLES) and reformat a bit (no changes) --- GPU/GLES/Framebuffer.cpp | 164 ++++++++++++++++----------------- GPU/GLES/TransformPipeline.cpp | 59 ++++++++++-- GPU/GLES/TransformPipeline.h | 9 +- 3 files changed, 133 insertions(+), 99 deletions(-) diff --git a/GPU/GLES/Framebuffer.cpp b/GPU/GLES/Framebuffer.cpp index 7679301265..c1af6d360b 100644 --- a/GPU/GLES/Framebuffer.cpp +++ b/GPU/GLES/Framebuffer.cpp @@ -101,10 +101,8 @@ inline u16 RGBA8888toRGBA5551(u32 px) { void ConvertFromRGBA8888(u8 *dst, u8 *src, u32 stride, u32 height, GEBufferFormat format); void CenterRect(float *x, float *y, float *w, float *h, - float origW, float origH, float frameW, float frameH) -{ - if (g_Config.bStretchToDisplay) - { + float origW, float origH, float frameW, float frameH) { + if (g_Config.bStretchToDisplay) { *x = 0; *y = 0; *w = frameW; @@ -115,8 +113,7 @@ void CenterRect(float *x, float *y, float *w, float *h, float origRatio = origW/origH; float frameRatio = frameW/frameH; - if (origRatio > frameRatio) - { + if (origRatio > frameRatio) { // Image is wider than frame. Center vertically. float scale = origW / frameW; *x = 0.0f; @@ -128,9 +125,7 @@ void CenterRect(float *x, float *y, float *w, float *h, *h = (frameH + *h) / 2.0f; // (408 + 720) / 2 = 564 #endif *y = (frameH - *h) / 2.0f; - } - else - { + } else { // Image is taller than frame. Center horizontally. float scale = origH / frameH; *y = 0.0f; @@ -237,31 +232,32 @@ FramebufferManager::FramebufferManager() : // Check vendor string to try and guess GPU const char *cvendor = (char *)glGetString(GL_VENDOR); - if(cvendor) { + if (cvendor) { const std::string vendor(cvendor); - - if(vendor == "NVIDIA Corporation" + if (vendor == "NVIDIA Corporation" || vendor == "Nouveau" || vendor == "nouveau") { gpuVendor = GPU_VENDOR_NVIDIA; - } else if(vendor == "Advanced Micro Devices, Inc." + } else if (vendor == "Advanced Micro Devices, Inc." || vendor == "ATI Technologies Inc.") { gpuVendor = GPU_VENDOR_AMD; - } else if(vendor == "Intel" + } else if (vendor == "Intel" || vendor == "Intel Inc." || vendor == "Intel Corporation" || vendor == "Tungsten Graphics, Inc") { // We'll assume this last one means Intel gpuVendor = GPU_VENDOR_INTEL; - } else if(vendor == "ARM") + } else if (vendor == "ARM") { gpuVendor = GPU_VENDOR_ARM; - else if(vendor == "Imagination Technologies") + } else if (vendor == "Imagination Technologies") { gpuVendor = GPU_VENDOR_POWERVR; - else if(vendor == "Qualcomm") + } else if (vendor == "Qualcomm") { gpuVendor = GPU_VENDOR_ADRENO; - else + } else { gpuVendor = GPU_VENDOR_UNKNOWN; - } else + } + } else { gpuVendor = GPU_VENDOR_UNKNOWN; + } gstate_c.gpuVendor = gpuVendor; NOTICE_LOG(SCEGE, "GPU Vendor : %s", cvendor); } @@ -789,6 +785,9 @@ void FramebufferManager::CopyDisplayToOutput() { GLuint colorTexture = fbo_get_color_texture(vfb->fbo); + // TODO ES3: Use glInvalidateFramebuffer to discard depth/stencil data at the end of frame. + // and to discard extraFBOs_ after using them. + if (useFXAA_ && extraFBOs_.size() == 1) { glBindTexture(GL_TEXTURE_2D, colorTexture); @@ -810,12 +809,13 @@ void FramebufferManager::CopyDisplayToOutput() { // These are in the output display coordinates float x, y, w, h; CenterRect(&x, &y, &w, &h, 480.0f, 272.0f, (float)PSP_CoreParameter().pixelWidth, (float)PSP_CoreParameter().pixelHeight); - + #if defined(USING_GLES2) && !defined(__SYMBIAN32__) && !defined(MEEGO_EDITION_HARMATTAN) && !defined(IOS) if (gl_extensions.NV_draw_texture) { // Fast path for Tegra. TODO: Make this path work on desktop nvidia, seems glew doesn't have a clue. - glDrawTextureNV(colorTexture, 0, - x, y, w, h, 0.0f, + // Actually, on Desktop we should just use glBlitFramebuffer. + glDrawTextureNV(colorTexture, 0, + x, y, w, h, 0.0f, 0, 0, 480.0f / (float)vfb->width, 272.0f / (float)vfb->height); return; } @@ -829,12 +829,12 @@ void FramebufferManager::CopyDisplayToOutput() { void FramebufferManager::ReadFramebufferToMemory(VirtualFramebuffer *vfb, bool sync) { #ifndef USING_GLES2 - if(sync) { + if (sync) { PackFramebufferAsync_(NULL); // flush async just in case when we go for synchronous update } -#endif +#endif - if(vfb) { + if (vfb) { // We'll pseudo-blit framebuffers here to get a resized and flipped version of vfb. // For now we'll keep these on the same struct as the ones that can get displayed // (and blatantly copy work already done above while at it). @@ -855,7 +855,7 @@ void FramebufferManager::ReadFramebufferToMemory(VirtualFramebuffer *vfb, bool s } // Create a new fbo if none was found for the size - if(!nvfb) { + if (!nvfb) { nvfb = new VirtualFramebuffer(); nvfb->fbo = 0; nvfb->fb_address = vfb->fb_address; @@ -927,8 +927,8 @@ void FramebufferManager::ReadFramebufferToMemory(VirtualFramebuffer *vfb, bool s #ifdef USING_GLES2 PackFramebufferSync_(nvfb); // synchronous glReadPixels #else - if(gl_extensions.PBO_ARB || !gl_extensions.ATIClampBug) { - if(!sync) { + if (gl_extensions.PBO_ARB || !gl_extensions.ATIClampBug) { + if (!sync) { PackFramebufferAsync_(nvfb); // asynchronous glReadPixels using PBOs } else { PackFramebufferSync_(nvfb); // synchronous glReadPixels @@ -939,7 +939,6 @@ void FramebufferManager::ReadFramebufferToMemory(VirtualFramebuffer *vfb, bool s } void FramebufferManager::BlitFramebuffer_(VirtualFramebuffer *src, VirtualFramebuffer *dst, bool flip, float upscale, float vscale) { - if (dst->fbo) { fbo_bind_as_render_target(dst->fbo); } else { @@ -947,13 +946,13 @@ void FramebufferManager::BlitFramebuffer_(VirtualFramebuffer *src, VirtualFrameb fbo_unbind(); return; } - - if(glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) { + + if (glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) { ERROR_LOG(SCEGE, "Incomplete target framebuffer, aborting blit"); fbo_unbind(); return; } - + glstate.viewport.set(0, 0, dst->width, dst->height); DisableState(); @@ -971,15 +970,15 @@ void FramebufferManager::BlitFramebuffer_(VirtualFramebuffer *src, VirtualFrameb CompileDraw2DProgram(); DrawActiveTexture(x, y, w, h, (float)PSP_CoreParameter().pixelWidth, (float)PSP_CoreParameter().pixelHeight, flip, upscale, vscale, draw2dprogram_); - + glBindTexture(GL_TEXTURE_2D, 0); fbo_unbind(); } // TODO: SSE/NEON void ConvertFromRGBA8888(u8 *dst, u8 *src, u32 stride, u32 height, GEBufferFormat format) { - if(format == GE_FORMAT_8888) { - if(src == dst) { + if (format == GE_FORMAT_8888) { + if (src == dst) { return; } else { // Here lets assume they don't intersect memcpy(dst, src, stride * height * 4); @@ -990,18 +989,17 @@ void ConvertFromRGBA8888(u8 *dst, u8 *src, u32 stride, u32 height, GEBufferForma u16 *dst16 = (u16 *)dst; switch (format) { case GE_FORMAT_565: // BGR 565 - for(int i = 0; i < size; i++) { + for (int i = 0; i < size; i++) { dst16[i] = RGBA8888toRGB565(src32[i]); } break; case GE_FORMAT_5551: // ABGR 1555 - for(int i = 0; i < size; i++) { + for (int i = 0; i < size; i++) { dst16[i] = RGBA8888toRGBA5551(src32[i]); } - break; case GE_FORMAT_4444: // ABGR 4444 - for(int i = 0; i < size; i++) { + for (int i = 0; i < size; i++) { dst16[i] = RGBA8888toRGBA4444(src32[i]); } break; @@ -1024,35 +1022,32 @@ void FramebufferManager::PackFramebufferAsync_(VirtualFramebuffer *vfb) { bool useCPU = g_Config.iRenderingMode == FB_READFBOMEMORY_CPU; // We'll prepare two PBOs to switch between readying and reading - if(!pixelBufObj_) { + if (!pixelBufObj_) { GLuint pbos[MAX_PBO]; - glGenBuffers(MAX_PBO, pbos); pixelBufObj_ = new AsyncPBO[MAX_PBO]; - - for(int i = 0; i < MAX_PBO; i++) { + for (int i = 0; i < MAX_PBO; i++) { pixelBufObj_[i].handle = pbos[i]; pixelBufObj_[i].maxSize = 0; pixelBufObj_[i].reading = false; } } - // Receive previously requested data from a PBO - if(pixelBufObj_[nextPBO].reading) { + if (pixelBufObj_[nextPBO].reading) { glBindBuffer(GL_PIXEL_PACK_BUFFER, pixelBufObj_[nextPBO].handle); packed = (GLubyte *)glMapBuffer(GL_PIXEL_PACK_BUFFER, GL_READ_ONLY); - if(packed) { - DEBUG_LOG(SCEGE, "Reading PBO to memory , bufSize = %u, packed = %08x, fb_address = %08x, stride = %u, pbo = %u", + if (packed) { + DEBUG_LOG(SCEGE, "Reading PBO to memory , bufSize = %u, packed = %08x, fb_address = %08x, stride = %u, pbo = %u", pixelBufObj_[nextPBO].size, packed, pixelBufObj_[nextPBO].fb_address, pixelBufObj_[nextPBO].stride, nextPBO); - if(useCPU) { - ConvertFromRGBA8888(Memory::GetPointer(pixelBufObj_[nextPBO].fb_address), packed, - pixelBufObj_[nextPBO].stride, pixelBufObj_[nextPBO].height, + if (useCPU) { + ConvertFromRGBA8888(Memory::GetPointer(pixelBufObj_[nextPBO].fb_address), packed, + pixelBufObj_[nextPBO].stride, pixelBufObj_[nextPBO].height, pixelBufObj_[nextPBO].format); - } else { + } else { // We don't need to convert, GPU already did (or should have) Memory::Memcpy(pixelBufObj_[nextPBO].fb_address, packed, pixelBufObj_[nextPBO].size); } @@ -1061,12 +1056,11 @@ void FramebufferManager::PackFramebufferAsync_(VirtualFramebuffer *vfb) { } glUnmapBuffer(GL_PIXEL_PACK_BUFFER); - unbind = true; } // Order packing/readback of the framebuffer - if(vfb) { + if (vfb) { int pixelType, pixelSize, pixelFormat, align; bool reverseOrder = (gpuVendor == GPU_VENDOR_NVIDIA) || (gpuVendor == GPU_VENDOR_AMD); @@ -1108,16 +1102,16 @@ void FramebufferManager::PackFramebufferAsync_(VirtualFramebuffer *vfb) { fbo_bind_for_read(vfb->fbo); } else { fbo_unbind(); - if(gl_extensions.FBO_ARB) { + if (gl_extensions.FBO_ARB) { glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); } return; } - if(glCheckFramebufferStatus(GL_READ_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) { + if (glCheckFramebufferStatus(GL_READ_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) { ERROR_LOG(SCEGE, "Incomplete source framebuffer, aborting read"); fbo_unbind(); - if(gl_extensions.FBO_ARB) { + if (gl_extensions.FBO_ARB) { glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); } return; @@ -1125,9 +1119,9 @@ void FramebufferManager::PackFramebufferAsync_(VirtualFramebuffer *vfb) { glBindBuffer(GL_PIXEL_PACK_BUFFER, pixelBufObj_[currentPBO_].handle); - if(pixelBufObj_[currentPBO_].maxSize < bufSize) { + 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 { @@ -1136,7 +1130,7 @@ void FramebufferManager::PackFramebufferAsync_(VirtualFramebuffer *vfb) { pixelBufObj_[currentPBO_].maxSize = bufSize; } - 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); @@ -1150,21 +1144,21 @@ void FramebufferManager::PackFramebufferAsync_(VirtualFramebuffer *vfb) { switch(error) { case 0: break; - case GL_INVALID_ENUM: - ERROR_LOG(SCEGE, "glReadPixels: GL_INVALID_ENUM"); + case GL_INVALID_ENUM: + ERROR_LOG(SCEGE, "glReadPixels: GL_INVALID_ENUM"); break; - case GL_INVALID_VALUE: - ERROR_LOG(SCEGE, "glReadPixels: GL_INVALID_VALUE"); + case GL_INVALID_VALUE: + ERROR_LOG(SCEGE, "glReadPixels: GL_INVALID_VALUE"); break; - case GL_INVALID_OPERATION: - // GL_INVALID_OPERATION will happen sometimes midframe but everything - // seems to work out when actually mapping buffers? - // GL_SAMPLE_BUFFERS, GL_READ_BUFFER, GL_BUFFER_SIZE/MAPPED, + case GL_INVALID_OPERATION: + // GL_INVALID_OPERATION will happen sometimes midframe but everything + // seems to work out when actually mapping buffers? + // GL_SAMPLE_BUFFERS, GL_READ_BUFFER, GL_BUFFER_SIZE/MAPPED, // GL_PIXEL_PACK_BUFFER_BINDING, all have the expected values. - ERROR_LOG(SCEGE, "glReadPixels: GL_INVALID_OPERATION"); + ERROR_LOG(SCEGE, "glReadPixels: GL_INVALID_OPERATION"); break; - case GL_INVALID_FRAMEBUFFER_OPERATION: - ERROR_LOG(SCEGE, "glReadPixels: GL_INVALID_FRAMEBUFFER_OPERATION"); + case GL_INVALID_FRAMEBUFFER_OPERATION: + ERROR_LOG(SCEGE, "glReadPixels: GL_INVALID_FRAMEBUFFER_OPERATION"); break; default: ERROR_LOG(SCEGE, "glReadPixels: UNKNOWN OPENGL ERROR %u", error); @@ -1172,7 +1166,7 @@ void FramebufferManager::PackFramebufferAsync_(VirtualFramebuffer *vfb) { } fbo_unbind(); - if(gl_extensions.FBO_ARB) { + if (gl_extensions.FBO_ARB) { glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); } @@ -1188,7 +1182,7 @@ void FramebufferManager::PackFramebufferAsync_(VirtualFramebuffer *vfb) { currentPBO_ = nextPBO; - if(unbind) { + if (unbind) { glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); } } @@ -1209,13 +1203,13 @@ void FramebufferManager::PackFramebufferSync_(VirtualFramebuffer *vfb) { u32 fb_address = (0x04000000) | vfb->fb_address; GLubyte *packed = 0; - if(vfb->format == GE_FORMAT_8888) { + if (vfb->format == GE_FORMAT_8888) { packed = (GLubyte *)Memory::GetPointer(fb_address); } else { // End result may be 16-bit but we are reading 32-bit, so there may not be enough space at fb_address packed = (GLubyte *)malloc(bufSize * sizeof(GLubyte)); } - if(packed) { + if (packed) { DEBUG_LOG(SCEGE, "Reading framebuffer to mem, bufSize = %u, packed = %p, fb_address = %08x", (u32)bufSize, packed, fb_address); @@ -1225,26 +1219,26 @@ void FramebufferManager::PackFramebufferSync_(VirtualFramebuffer *vfb) { switch(error) { case 0: break; - case GL_INVALID_ENUM: - ERROR_LOG(SCEGE, "glReadPixels: GL_INVALID_ENUM"); + case GL_INVALID_ENUM: + ERROR_LOG(SCEGE, "glReadPixels: GL_INVALID_ENUM"); break; - case GL_INVALID_VALUE: - ERROR_LOG(SCEGE, "glReadPixels: GL_INVALID_VALUE"); + case GL_INVALID_VALUE: + ERROR_LOG(SCEGE, "glReadPixels: GL_INVALID_VALUE"); break; case GL_INVALID_OPERATION: - // GL_INVALID_OPERATION will happen sometimes midframe but everything - // seems to work out when actually reading? - ERROR_LOG(SCEGE, "glReadPixels: GL_INVALID_OPERATION"); + // GL_INVALID_OPERATION will happen sometimes midframe but everything + // seems to work out when actually reading? + ERROR_LOG(SCEGE, "glReadPixels: GL_INVALID_OPERATION"); break; - case GL_INVALID_FRAMEBUFFER_OPERATION: - ERROR_LOG(SCEGE, "glReadPixels: GL_INVALID_FRAMEBUFFER_OPERATION"); + case GL_INVALID_FRAMEBUFFER_OPERATION: + ERROR_LOG(SCEGE, "glReadPixels: GL_INVALID_FRAMEBUFFER_OPERATION"); break; default: ERROR_LOG(SCEGE, "glReadPixels: UNKNOWN OPENGL ERROR %u", error); break; } - if(vfb->format != GE_FORMAT_8888) { // If not RGBA 8888 we need to convert + if (vfb->format != GE_FORMAT_8888) { // If not RGBA 8888 we need to convert ConvertFromRGBA8888(Memory::GetPointer(fb_address), packed, vfb->fb_stride, vfb->height, vfb->format); free(packed); } @@ -1323,7 +1317,7 @@ void FramebufferManager::DecimateFBOs() { VirtualFramebuffer *vfb = vfbs_[i]; int age = frameLastFramebufUsed - std::max(vfb->last_frame_render, vfb->last_frame_used); - if(updateVram && age == 0 && !vfb->memoryUpdated && vfb == displayFramebuf_) + if (updateVram && age == 0 && !vfb->memoryUpdated && vfb == displayFramebuf_) ReadFramebufferToMemory(vfb); if (vfb == displayFramebuf_ || vfb == prevDisplayFramebuf_ || vfb == prevPrevDisplayFramebuf_) { diff --git a/GPU/GLES/TransformPipeline.cpp b/GPU/GLES/TransformPipeline.cpp index 2cdf07f775..ad664217db 100644 --- a/GPU/GLES/TransformPipeline.cpp +++ b/GPU/GLES/TransformPipeline.cpp @@ -15,10 +15,54 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. -// Ideas for speeding things up -// Use superblocks! +// Ideas for speeding things up on mobile OpenGL ES implementations +// +// Use superbuffers! Yes I just invented that name. +// +// The idea is to avoid respecifying the vertex format between every draw call (multiple glVertexAttribPointer ...) +// by combining the contents of multiple draw calls into one buffer, as long as +// they have exactly the same output vertex format. (different input formats is fine! This way +// we can combine the data for multiple draws with different numbers of bones, as we consider numbones < 4 to be = 4) +// into one VBO. +// +// This will likely be a win because I believe that between every change of VBO + glVertexAttribPointer*N, the driver will +// perform a lot of validation, probably at draw call time, while all the validation can be skipped if the only thing +// that changes between two draw calls is simple state or texture or a matrix etc, not anything vertex related. +// Also the driver will have to manage hundreds instead of thousands of VBOs in games like GTA. +// +// * Every 10 frames or something, do the following: +// - Frame 1: +// + Mark all drawn buffers with in-frame sequence numbers (alternatively, +// just log them in an array) +// - Frame 2 (beginning?): +// + Take adjacent buffers that have the same output vertex format, and add them +// to a list of buffers to combine. Create said buffers with appropriate sizes +// and precompute the offsets that the draws should be written into. +// - Frame 2 (end): +// + Actually do the work of combining the buffers. This probably means re-decoding +// the vertices into a new one. Will also have to apply index offsets. +// +// Also need to change the drawing code so that we don't glBindBuffer and respecify glVAP if +// two subsequent drawcalls come from the same superbuffer. +// +// Or we ignore all of this including vertex caching and simply find a way to do highly optimized vertex streaming, +// like Dolphin is trying to. That will likely never be able to reach the same speed as perfectly optimized +// superbuffers though. For this we will have to JIT the vertex decoder but that's not too hard. +// +// Now, when do we delete superbuffers? Maybe when half the buffers within have been killed? +// +// Another idea for GTA which switches textures a lot while not changing much other state is to use ES 3 Array +// textures, if they are the same size (even if they aren't, might be okay to simply resize the textures to match +// if they're just a multiple of 2 away) or something. Then we'd have to add a W texture coordinate to choose the +// texture within the bound texture array to the vertex data when merging into superbuffers. +// +// There are even more things to try. For games that do matrix palette skinning by quickly switching bones and +// just drawing a few triangles per call (NBA, FF:CC, Tekken 6 etc) we could even collect matrices, upload them +// all at once, writing matrix indices into the vertices in addition to the weights, and then doing a single +// draw call with specially generated shader to draw the whole mesh. This code will be seriously complex though. + #include "base/timeutil.h" #include "Common/MemoryUtil.h" @@ -64,8 +108,9 @@ enum { #define VERTEXCACHE_DECIMATION_INTERVAL 17 -inline float clamp(float in, float min, float max) { - return in < min ? min : (in > max ? max : in); +// Check for max first as clamping to max is more common than min when lighting. +inline float clamp(float in, float min, float max) { + return in > max ? max : (in < min ? min : in); } TransformDrawEngine::TransformDrawEngine() @@ -812,7 +857,7 @@ VertexDecoder *TransformDrawEngine::GetVertexDecoder(u32 vtype) { auto iter = decoderMap_.find(vtype); if (iter != decoderMap_.end()) return iter->second; - VertexDecoder *dec = new VertexDecoder(); + VertexDecoder *dec = new VertexDecoder(); dec->SetVertexType(vtype); decoderMap_[vtype] = dec; return dec; @@ -861,13 +906,13 @@ void TransformDrawEngine::SubmitPrim(void *verts, void *inds, GEPrimitiveType pr if (!indexGen.PrimCompatible(prevPrim_, prim) || numDrawCalls >= MAX_DEFERRED_DRAW_CALLS) Flush(); - + // TODO: Is this the right thing to do? if (prim == GE_PRIM_KEEP_PREVIOUS) { prim = prevPrim_; } prevPrim_ = prim; - + SetupVertexDecoder(vertType); dec_->IncrementStat(STAT_VERTSSUBMITTED, vertexCount); diff --git a/GPU/GLES/TransformPipeline.h b/GPU/GLES/TransformPipeline.h index 3550412f69..0cb0866a0f 100644 --- a/GPU/GLES/TransformPipeline.h +++ b/GPU/GLES/TransformPipeline.h @@ -42,12 +42,6 @@ struct DecVtxFormat; // DRAWN_ONCE -> death // DRAWN_RELIABLE -> death - -// Don't bother storing information about draws smaller than this. -enum { - VERTEX_CACHE_THRESHOLD = 20, -}; - // Try to keep this POD. class VertexArrayInfo { public: @@ -64,6 +58,7 @@ public: drawsUntilNextFullHash = 0; } ~VertexArrayInfo(); + enum Status { VAI_NEW, VAI_HASHING, @@ -78,7 +73,7 @@ public: u32 vbo; u32 ebo; - // Precalculated parameter for drawdrawElements + // Precalculated parameter for drawRangeElements u16 numVerts; u16 maxIndex; s8 prim;