Commit Graph

295 Commits

Author SHA1 Message Date
baldurk 0b580f32c3 Fetch per-frag post-modification & shader output values 2014-08-24 01:00:20 +01:00
baldurk f219dc2090 Add depth state that INCR_SATs stencil, tests eq & writes depth 2014-08-24 01:00:19 +01:00
baldurk d55be5f687 Duplicate up pixel modifications based on # frags 2014-08-24 01:00:18 +01:00
baldurk 1c4eccd06e Use STENCIL_OP_INCR_SAT to count number of fragments writing 2014-08-24 01:00:17 +01:00
baldurk 5ed280ae33 Markers don't increment drawcall ID, use eventID for prev/next/parent 2014-08-24 00:59:26 +01:00
baldurk f9a38c9e1f Workaround fxc compiler bug in d3dcompiler_43 by avoiding flow control
* Old method gave:

error X8000: D3D11 Internal Compiler Error: Invalid Bytecode: Instructions
calculating derivatives across pixels, and using temp storage or indexed
values for input coordinates, are not permitted within flow control that
has a branch condition that could vary across pixels. Opcode 53 (count is
1-based).

* It seemed related to taking ddx() of things like SV_CullDistance inside
  the if(), so I refactored to not branch, and instead just avoid the
  InterlockedAdd only and when not a hit it will just write to an ignored
  element at the end of the UAV.
2014-08-24 00:42:27 +01:00
baldurk db39eafd32 Update the documentation email address 2014-08-22 08:18:33 +01:00
baldurk 4ccc7d3901 Update email in code & add menu item for nightly builds 2014-08-22 08:13:21 +01:00
baldurk c75721b24f Update email address in README 2014-08-22 08:06:23 +01:00
baldurk 8c2da527f7 A bit more tidy up and rearrangement in preparation 2014-08-21 21:48:21 +01:00
baldurk f36636998a Tidy up pixel history a bit, move shaders & states into common 2014-08-20 23:52:45 +01:00
baldurk b38e7f20d3 Speculative fix for crash with null values in TimedUpdate.TickTB 2014-08-19 22:45:29 +01:00
baldurk fc347a0235 Update to 4.5 official headers, tweak to GL enum
* GLenum enum now lists all GL_ before GLX_ and WGL_ to give priority for
  string representation.
* Also dropped eGL_UNKNOWN_ENUM for eGL_NONE as it's a little friendlier
2014-08-18 18:40:10 +01:00
baldurk 24ae01a3f7 Set rows/columns to 0 when members[] contains array values 2014-08-18 11:18:53 +01:00
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