Commit Graph
927 Commits
Author SHA1 Message Date
baldurk 3298905d1d Optimise/improve hookset.pl, return dummy function pointers
* Now instead of returning NULL for entry points that we don't support and
  hoping the application will handle that or error out, instead we return
  a function that will log an error if it is ever called, and then pass
  through to the real function. In most cases, the capture will probably be
  broken as whichever function isn't saved.
* hookset.pl is much faster too, it outputs the whole gl_hookset_defs.h
  file and doesn't do multiple searches over the whole set of headers in
  official/ for each function.
2014-12-20 19:54:46 +00:00
baldurk fe3be81c94 Don't error about textures that aren't complete anyway 2014-12-20 19:54:46 +00:00
Baldur Karlsson 91f85838c5 Merge pull request #116 from loosche/show_normalized_uvs
Add normalized UV coordinates to the TextureViewer window.
2014-12-19 08:35:06 +00:00
loosche 9ef5080302 Change the normalized UV formatting to use Formatter.Format() instead of
doing it myself.
2014-12-19 00:31:17 -08:00
loosche 5f3b535d31 Add normalized UV coordinates to the TextureViewer window. 2014-12-19 00:11:19 -08:00
baldurk 4dcbe41a90 Mark framebuffers as high traffic/dirty after too many attachments
* Seen on Metro 2033 - if a single FBO is used for many cases, with
  attachments added and removed repeatedly. We just give up and fall back
  to fetching them as frame initial state for that framebuffer.
2014-12-19 00:11:49 +00:00
baldurk 08d82c43e9 Allow glBindBufferBase/glBindBufferRange and glBindBuffers for b2c
* Seen in Metro 2033 Redux.
* b2c = bind-to-create. These functions are valid to do that, so we
  serialise a glBindBuffer chunk to create them.
2014-12-19 00:11:41 +00:00
baldurk bc7867499a Add heuristic to avoid extreme bloating with repeated glTexImage
* Seen in Metro Redux, glTexImage was used to upload a 1920x1080 32bpp
  image over and over, and each chunk faithfully recorded the data. Instead
  we detect when glTexImage is called with the same size parameters, no
  resizing/recreation effectively occurs, so we drop the chunk and just
  mark the texture as dirty to fetch the data later.
2014-12-18 22:02:44 +00:00
baldurk 6b34b5815d Don't kill connection thread if user cancels closing 2014-12-18 18:02:50 +00:00
baldurk bbbf18b6f3 Try to avoid hooking into module that was unloaded elsewhere.
* There is still a small race condition, but worst case if it's hit then
  we load a library and free it, and the only way to protect it is to lock
  around FreeLibrary which is quite scary.
2014-12-17 22:13:03 +00:00
baldurk dfa8cf70ac GL_RGB5 is probably more correct as GL_UNSIGNED_SHORT_5_6_5
* It has one bit more precision in green, but it has the right number of
  channels, so it's a better fit than GL_UNSIGNED_SHORT_5_5_5_1
2014-12-17 21:22:32 +00:00
baldurk a974380dfb Handle glCopyTexImage as proper creation functions, not just copies
* Seen in Clockwork Empires - glCopyTexImage was used to create a texture
  and this wasn't being handled properly.
2014-12-17 20:57:49 +00:00
baldurk b1150987a4 Just warn for programs found that have no shaders attached
* Seen in Clockwork Empires, eventually this won't be a problem as the
  programs will get trimmed via not being referenced in the captured frame
2014-12-17 20:57:49 +00:00
baldurk 48bf8290df Fetching texture records more consistently/easily 2014-12-17 20:57:48 +00:00
baldurk 10172c0516 Get the sodding parameters the right way around.
* Idiot.
2014-12-17 20:54:21 +00:00
baldurk c1c97e291b When reading the frame don't fudge the current state
* e.g. when binding a buffer we only want to protect the current state (so
  as not to mess anything up like VAOs) before we're reading the frame.
2014-12-17 18:29:55 +00:00
baldurk 10926066bc Fix a couple of GL functions in the wrong hookset type 2014-12-17 18:22:05 +00:00
baldurk 194dd16504 Fix minmax incorrect always sampling from 2D texture (OpenGL) 2014-12-17 18:21:40 +00:00
baldurk 2ffde0988c Exclude steam's overlay dll. Credit to roalercon. Closes #114 2014-12-17 17:39:41 +00:00
baldurk b64e58916b Remove spammy debug message 2014-12-16 22:07:15 +00:00
baldurk 119d9242ab Demote error to warning
* This is the error 6152332e36 was intended
  to address!
2014-12-15 19:06:44 +00:00
Baldur Karlsson bfb22ee1fd Tweak to contributing section of README 2014-12-14 23:08:42 +00:00
baldurk abbc00adbf Work around glVertexArrayVertexAttribDivisorEXT not being present 2014-12-14 12:17:43 +00:00
baldurk 7d293ddd76 Add a vendor check to avoid glGetProgramPipelineiv+GL_COMPUTE_SHADER 2014-12-14 12:17:42 +00:00
baldurk 7c663de948 Add vendor check to avoid glCopyImageSubData on <4x4 compressed mips 2014-12-14 12:17:41 +00:00
baldurk 652f3529a3 Track if a context is core or not, re-check vendor checks on core
* When a compatibility context is created (via the old CreateContext, or
  via an appropriate CreateContextAttribs call), we can still do the vendor
  checks but we want to make sure we perform them again if we ever create a
  core profile context. Note that actually *using* a compatibility context
  isn't supported at the moment, but this won't explicitly break that.
2014-12-14 12:17:41 +00:00
baldurk 86c110184a Only query depth stencil texture mode for depth-stencil textures 2014-12-14 12:17:39 +00:00
baldurk a984352b74 Add a vendor check to avoid querying GL_POLYGON_MODE on AMD 2014-12-14 12:17:38 +00:00
baldurk e1d01970c6 Add fetching of Indirect params, and stepping through MultiDraw calls
* This means glMultiDrawIndirect is fetched, decomposed into child draw
  calls and you can step through them individually
2014-12-14 12:17:38 +00:00
baldurk 071663dd7e Make sure last draw data is set every time, not just when reading
* These values are used to show the current pipeline state (as it's
  convenient to show this data with the rest of the 'state', even if it's
  not state. That means they need to be set every time when executing, not
  just once when reading.
2014-12-14 02:16:15 +00:00
baldurk 644a493f5b Fix enums being wrong when added to even tlist 2014-12-14 02:12:50 +00:00
baldurk 378ef162b5 When replaying don't use VertexAttribPointer functions (or DSA equiv)
* It seems like there's some buggy behaviour when mixing and matching 'old'
  style vertex attrib pointer/offset functions, and the new attrib/vertex
  buffer binding style (which we use in VAO initial state since it's a
  superset of functionality).
* Fortunately, the spec defines exactly how VertexAttribPointer is defined
  in terms of the new system, so just do the replacement ourselves.
2014-12-14 01:48:13 +00:00
baldurk 2c12423975 Return some WGL extensions that we can easily support. 2014-12-14 00:29:16 +00:00
baldurk d433869e3c Make sure bind-to-create chunks don't affect object state
* e.g. if the 'wrong' VAO was bound at the time we replayed a
  bind-to-create chunk, then we'd trample that VAO state (and it might not
  ever be restored). So when reading, not executing, save and restore the
  buffer binding.
2014-12-13 23:43:51 +00:00
baldurk 6ca8fc0c1b Propagate resource dirtiness over copies 2014-12-13 23:42:18 +00:00
baldurk 881e513f59 Replay glTexBuffer commands in-frame 2014-12-13 21:16:15 +00:00
baldurk 8db4095b09 Don't call into real glFlushMappedBuffer unless it was really mapped 2014-12-13 21:15:58 +00:00
baldurk 35a13fe160 Make sure all arrays preserve 'depth' when calculating mip dims 2014-12-13 21:15:42 +00:00
baldurk f55e8cdd37 Only mark resources as referenced while capturing a frame 2014-12-12 20:23:16 +00:00
baldurk ce514d12ad Fix last vertex not highlighting 2014-12-12 19:18:03 +00:00
baldurk c207391b54 Linux compile fixes. 2014-12-12 00:15:45 +00:00
baldurk 15e7764b89 Ignore lack of initial state for VAOs 2014-12-11 23:18:32 +00:00
baldurk 9860d8bba8 Mark buffers referenced so they're kept alive even if deleted in-frame
* We need to have more comprehensive frame references for several reasons
  but this will handle the case where a buffer is created, bound, deleted
  before the frame ends.
2014-12-11 23:18:06 +00:00
baldurk a3d374c103 Check component type AFTER constructing the format 2014-12-11 22:54:38 +00:00
baldurk 3d99c14c9f Handle cubemap face targets in GetSizedFormat 2014-12-11 22:49:34 +00:00
baldurk 5fe0354ce4 Drop use of CONTEXT_FORWARD_COMPATIBLE_BIT, add CORE_PROFILE_BIT 2014-12-11 22:41:11 +00:00
baldurk 12af78d535 Print out the attribs a context is created with 2014-12-11 22:39:35 +00:00
baldurk c8e29488ef Fix proxy target checks, make sure real function is called
* If the target is a proxy target or the internal format is invalid, make
  sure we still call the real GL function, but don't do anything ourselves.
2014-12-11 22:22:33 +00:00
baldurk 95e3f01686 Handle attachment ID being 0 (unbind attachment) 2014-12-11 22:05:04 +00:00
baldurk 6523dfde31 Add ARB function aliases for vertex functions 2014-12-11 22:04:49 +00:00