Commit Graph

281 Commits

Author SHA1 Message Date
baldurk 61eba9a460 Add utility functions globally for mapping shader enums <-> idx 2014-08-18 11:18:39 +01:00
baldurk 561b7a0e58 Only complain about initial states being missing for non-buffers 2014-08-18 11:01:37 +01:00
baldurk 55e0178ec9 Add quad overdraw mode. Thanks Stephen Hill (@self_shadow)!
* http://blog.selfshadow.com/2012/11/12/counting-quads/
* Quad Overdraw based on ScenePS4 from the revised implementation. The
  colours are new, up to 20 levels. Picking pixels shows the overdraw level
* Available per-pass and per-drawcall, a pass defined the same way as in
  the mesh view, drawcalls since last clear or RT change.
* List of events now passed through to RenderOverlay the same as RenderMesh
2014-08-17 15:28:51 +01:00
baldurk 8a5150297f Set the event for group marker selection to the last real drawcall 2014-08-17 15:22:11 +01:00
baldurk 1e240740c6 Mark VAOs as written when modified
* This means even non-dirty VAOs, if modified during cap frame, will have
  initial states applied properly on replay
2014-08-15 21:24:59 +01:00
baldurk d520443fd3 Remove hackish tracking of VAO chunks, mark as dirty resource instead
* The VAO will then have initial contents grabbed and applied
2014-08-15 21:22:47 +01:00
baldurk 703fbba431 Apply enabled/disabled vertex attribs too 2014-08-15 18:57:37 +01:00
baldurk deead1c90e Assert on record should only happen when writing 2014-08-15 18:57:27 +01:00
baldurk 3303cc69e1 Remove dummy locals no longer needed.
* VAO initial state is not working yet - it gets reverted because the VAOs
  aren't marked as dirty (ie. initial state not needed because replay is
  accurate at the first replay, not out of sync) and not marked as written
  mid-frame (ie. restarting and replaying again shouldn't be out of sync as
  nothing was changed).
2014-08-15 17:29:27 +01:00
baldurk f3e9e3ffed Save off and store VAO initial frame state 2014-08-15 17:10:20 +01:00
baldurk c6f4536614 Change initial contents to struct with resource/uint/byte blob
* Allows drivers to store a blob of data instead of just a ResourceType
  object for storing initial contents. The ResourceManager takes ownership
  of the memory and delete[]s it when it's done.
2014-08-15 16:59:54 +01:00
baldurk 3aa14d8240 Add TODO note 2014-08-15 16:10:06 +01:00
baldurk 5f206da36d Add hooks for vertex attrib format/binding functions 2014-08-15 16:09:53 +01:00
baldurk d6251dd66f Don't rely on WrapperMap when iterating current resources 2014-08-15 15:01:10 +01:00
baldurk 0c4d8a23bf Rename function to be a bit better understood 2014-08-15 14:51:06 +01:00
baldurk 0c086abc6f Substitute fake backbuffer FBO where FBO binding state is 0 2014-08-15 14:47:07 +01:00
baldurk 56430387db Hook Vertex Buffer binding functions and save as initial state
* Vertex attrib state is a property of the VAO so should be saved as
  initial resource contents.
2014-08-15 14:26:13 +01:00
baldurk 437cc374c2 Save program & program pipeline bindings 2014-08-15 13:16:56 +01:00
baldurk 2717e05b48 Save draw and read framebuffer bindings, add some more TODOs 2014-08-15 12:33:32 +01:00
baldurk 7d52069401 Get initial sampler bindings 2014-08-15 12:20:18 +01:00
baldurk 0a83acef51 Pre-bake into pipeline and program data shader IDs per stage 2014-08-15 11:15:38 +01:00
baldurk 4352317f52 Instead of tracking layout, query variable's offset & stride
* It's unfortunate to have to use program introspection so heavily like
  this (perhaps there should be a GL-specific shader reflection structure
  like DXBC where these locations and strides could be cached), but it's
  not too bad and handles any arbitrary layout
2014-08-14 17:08:45 +01:00
baldurk bd4efeedcd Work in progress filling of UBO values. Not correct yet 2014-08-14 16:22:03 +01:00
baldurk e54aed0c2b Always consider non-buffer-backed uniform blocks as used 2014-08-14 14:29:20 +01:00
baldurk 6f35d1fb27 Correctly generate nested structure/AoS types in GL uniforms 2014-08-14 12:06:33 +01:00
baldurk cb89bc5891 Fix wrong value index being used 2014-08-13 17:01:16 +01:00
baldurk 6a6aa9b446 Handle what should be all the GL uniform types 2014-08-13 16:23:20 +01:00
baldurk 7ab9815aaf Introduce a bindpoint mapping as part of the pipeline state
* For APIs where the shader namespace/bindpoint (which may be arbitrary
  like 'the Nth texture resource' can be mapped, at each event, to the
  actual API bind point where the object is.
* On D3D11 this is pass-through, on GL this returns the value of each
  uniform.
* This also means GL shader reflection structures are properly immutable
  and the variance in the uniform values is handled elsewhere.
* In future this might need to be expanded to support more complex binding
  methods, where the mapping returns the resource rather than just mapping
  to an integer bind ponit.
2014-08-13 15:56:55 +01:00
baldurk a56608e0cd Hook glGetProgramResourceIndex 2014-08-13 15:53:55 +01:00
baldurk 3d09b6ad28 Use the right name length value! 2014-08-13 15:33:40 +01:00
baldurk 279c43c352 Add a couple more variable types, need to fill this in eventually 2014-08-13 15:33:27 +01:00
baldurk 5df45e8b5b Use correct location for UBOs 2014-08-13 13:29:28 +01:00
baldurk b39d829fbf A few optimisations in cases where *tons* of LoadLibrary calls happen
* Bail if we find an IAT entry already hooked as it means this module has
  been processed already.
* Avoid allocations/std::string in the ApplyHooks function.
2014-08-13 13:04:07 +01:00
baldurk fe027e61d5 Crash fixes, ensure we read back from valid uniform locations
* We can't use the uniform locations from our separable program as that's
  not guaranteed to be the same in the real program (could end up reading
  a completely different uniform value).
2014-08-13 13:03:12 +01:00
baldurk df5913855e Follow up to last commit, allocate sizeof(char_type), not 1 byte
* This week is apparently not a good week for avoiding stupid mistakes.
2014-08-13 11:11:34 +01:00
baldurk dcbba16af5 Don't assign "" to elems as it can later get free()d invalidly 2014-08-13 09:32:53 +01:00
baldurk ff371ee768 Verify that texture ID is found as tex2d before proceeding 2014-08-12 19:11:59 +01:00
baldurk 8158af7a9f Attempt to make separable shader prog, add input/output fetching
* Also moved shader reflection code into separate file
2014-08-12 17:01:18 +01:00
baldurk ebb5894010 If semantic is empty and we have variable name, use that instead 2014-08-12 16:47:31 +01:00
baldurk 49ab71181c Add some system attributes from GL 2014-08-12 16:47:00 +01:00
baldurk 38866f9829 Update TODO 2014-08-12 16:46:45 +01:00
baldurk fceabf7948 Explicitly handle initing from empty arrays, and assign NULL or "" 2014-08-12 16:46:35 +01:00
baldurk 0c52714def Remove a loop that doesn't need to be there any more 2014-08-09 01:46:00 +01:00
baldurk e7ab52cd22 Skip a few core modules 2014-08-09 01:45:43 +01:00
baldurk 9beaabb83b Make the lock only cover the ApplyHook function 2014-08-09 01:45:11 +01:00
baldurk 1b0eae755a Bail out immediately if IAT entry is already hooked
* This avoids going into VirtualProtect changing the page access while code
  may potentially be executing these areas of memory (since the module is
  hooked, and may have returned to user code)
2014-08-09 01:44:45 +01:00
baldurk aa690d7183 Add lock around hook apply function 2014-08-09 00:36:15 +01:00
baldurk f8bf111e9a Hook all modules, redundantly but safely, on each LoadLibrary() 2014-08-09 00:04:06 +01:00
Baldur Karlsson ec683ea474 Make sure outputs are always erased 2014-08-08 14:01:02 +01:00
Baldur Karlsson 2947e508a6 Fix array overrun 2014-08-08 14:00:50 +01:00