Commit Graph

1113 Commits

Author SHA1 Message Date
baldurk 6d64fc7a1a Handle NULL index buffer being bound for indexed draws better 2015-01-28 02:23:17 +00:00
baldurk a703dc54d0 Fix instancing support for post-vs mesh views on D3D11 and GL
* We stream-out or transform feedback the whole instanced draw at once,
  producing a buffer containing all N instances in one. Then when the
  client requests postvs data, an offset into the buffer is calculated
  (in 1/N chunks) and carried through everywhere.
* Since we were using the offset to indicate where the system position
  output lay for since-last-clear auto drawing of meshes, we rearrange
  the output attribute order so system position is always first in the
  list.
* Also since-last-clear now doesn't include the current event, but does
  include any previous instances before the current instance.
2015-01-28 02:21:14 +00:00
baldurk 7bf45d043b Fix incorrect null check that could crash with no VS bound 2015-01-26 19:55:42 +00:00
baldurk d41a285f4d Skip built-in input attributes when copying attrib locations over 2015-01-26 19:50:23 +00:00
baldurk 0777a87dee Fix mismatch between C# struct and C++ struct (was hidden in padding) 2015-01-26 19:48:19 +00:00
baldurk 4c44fc67cb Fix copy-paste error, use the right interface for getting name 2015-01-26 19:48:00 +00:00
baldurk 00226df891 Fix making TCS/TES/GS shaders separable by inserting gl_PerVertex 2015-01-26 19:10:00 +00:00
baldurk d7c8c1026c Support XFB from geometry or tessellation shaders
* Also set default near/far planes for auto-calculation to 0.1/100
2015-01-26 19:09:39 +00:00
baldurk 20927953ed Add some handling for strangely formed DXBC shader files. Refs #122
* This is the fun with reverse engineering formats, sometimes they do
  mad crazy stuff.
2015-01-26 18:07:01 +00:00
baldurk b8f54dc008 Add absolutely horrendously disgusting hack for 'fixing' XFB varyings
* This might be an nvidia bug but I honestly don't know what the syntax
  for varyings is, and the spec seems vague (it just says 'user-defined'
  variables). This system/heuristic works on NVIDIA and AMD though, so
  it'll have to do for now.
2015-01-26 17:20:31 +00:00
baldurk 577af9c257 Fix enum typo for polygon mode 2015-01-26 17:19:34 +00:00
baldurk 64bcf35838 Make sure to copy across attrib location values from 'real' vs program 2015-01-26 16:57:57 +00:00
baldurk 06a549cf01 Fix vertex inputs on GL to use input attrib bindpoint mapping 2015-01-26 16:55:07 +00:00
baldurk 184d3a6789 Prime post-vs data when log is loaded (or bufferviewer is newly opened)
* This fixes the bug that's been around for a while, where if you have
  an event selected and then open the buffer viewer, it won't have the
  post vs data available until you re-select that event.
2015-01-26 14:27:16 +00:00
baldurk 5c46ccb86d Use abs instead of saturate to do double-sided lighting on meshes
* This means we don't need to care about winding making normals inside
  out, and in this case it's not a bad thing to light backfaces I think.
2015-01-26 13:24:24 +00:00
baldurk 41be32a5cd Fix uniforms to make sure we don't get confused between two programs 2015-01-26 13:22:10 +00:00
baldurk 9c9c92b08f Use XFB to get postvs data (not post gs/tess yet), and render 2015-01-26 13:07:24 +00:00
baldurk 846a83d6b1 Set SSBO/UBO bindings by name so it's more robust
* This will work in case the binding order changes between two impls,
  and it also works if copying program state between two programs that
  might have different UBO/SSBO sets.
2015-01-26 02:07:45 +00:00
baldurk beae000c5a Upgrade functions from mostly to fully implemented
* As far as I know there are no problems - bugs will be reported I'm
  sure but they merit the status :).
2015-01-25 22:51:27 +00:00
baldurk 6bc7eedfa4 Implement vertex and triangle highlighting for GL buffer viewer 2015-01-25 22:50:18 +00:00
baldurk 29b40a0971 Bugfix for line topologies being compared wrongly 2015-01-25 22:49:53 +00:00
baldurk 6155d6d925 Suppress listing gl_PointSize or gl_ClipDistance if they weren't used 2015-01-25 21:38:40 +00:00
baldurk 9bd5fabe1a Implement axis markers and frustum helper on GL mesh view 2015-01-25 21:11:56 +00:00
baldurk 0f297734f3 Add geometry-shader calculated face normals for lit mesh view
* Also fix up the depth buffer part of output windows (since it wasn't
  used for anything else)
2015-01-25 20:30:03 +00:00
baldurk 4674b76930 Remove attributes not used in VS from GL vtx attribute list 2015-01-25 19:55:07 +00:00
baldurk 5972ffa661 Implement mesh-specific fragment shader to display secondary data 2015-01-25 19:31:47 +00:00
baldurk 8318720561 Re-implement GL RenderMesh in the new terms - much simpler!
* Still missing several features:
  - solid shading of 'secondary' data
  - highlighting of vertices/faces/supporting faces
  - helpers like axis markers or frustum
  - post VS data and re-projection
2015-01-25 19:31:13 +00:00
baldurk da2470dbcf Use correct stride value 2015-01-25 17:16:57 +00:00
baldurk 44f498de0d Fixes to ensure postvs data is available & properly used 2015-01-25 16:59:42 +00:00
baldurk 177c5cdfc1 Set default depth-stencil state for rendering checkerboard pattern 2015-01-25 16:44:25 +00:00
baldurk 22c9775008 Refactor RenderMesh() to now purely render what's specified
* So RenderMesh doesn't pick up anything implicitly from the current
  event, log, pipeline state etc - everything it needs is explicitly
  provided by the config parameters (note this might include a buffer
  generated by postvs data fetching, but the implementation now doesn't
  need to care or treat it as a special case.
2015-01-25 14:04:41 +00:00
baldurk 92e830b801 Return Post VS mesh data just with buffer ID & description
* This will allow shifting to RenderMesh being run locally just by
  the UI specifying the buffer and simple vertex specification, rather
  than by relying on any local log properties (or replaying the log).
* The reasoning behind this change is that it becomes much simpler to
  implement, rather than having to modify the draw to do what we want,
  we just do an entirely custom draw based on a few properties - similar
  to the texture rendering. This will help e.g. for writing a GL
  implementation.
* The second benefit is that we can just transfer the buffer contents
  across the network when replaying remotely, so mesh rendering can be
  implemented even for remote replay - the last unimplemented feature.
* It could also be used similar to the image viewer in future, to
  display mesh files.
2015-01-24 22:06:45 +00:00
baldurk 30516c31c6 Make sure we don't try to debug when no trace is available 2015-01-22 15:18:10 +00:00
baldurk ee5a904350 Handle arrays of samplers properly 2015-01-22 15:17:09 +00:00
baldurk bc866b9fb2 I always get markdown links the wrong way around 2015-01-20 19:54:47 +00:00
baldurk bdee4706da Move the contributing section out of COMPILE.md into CONTRIBUTING.md
* Since CONTRIBUTING.md gets auto-linked whenever opening a pull-request,
  this is more convenient for contributors.
2015-01-20 19:54:44 +00:00
baldurk 94a5b77be9 Disable GL mesh preview because it's buggy and soon to be rewritten 2015-01-20 15:14:22 +00:00
baldurk a1bc380f06 Fix missing else that caused all samplers to be skipped. Oooops. 2015-01-20 15:05:13 +00:00
baldurk 6326b3344d s/Constant Buffers/Uniforms and UBOs/ on GL pipeline view 2015-01-20 15:00:39 +00:00
baldurk 96b8818120 Give constant buffer previewer proper naming on OpenGL logs 2015-01-20 14:57:20 +00:00
baldurk 45a78df2ae Fix vertex input attribute/buffer mutual highlighting 2015-01-20 13:52:06 +00:00
baldurk 57c8aa476f Use GetRow instead of GetPositionFromControl as it's more reliable 2015-01-20 13:45:38 +00:00
baldurk 74b231a413 Make sure TES and TCS are the right way around 2015-01-20 11:51:31 +00:00
baldurk 68f8f1b6e3 Fix GL pipeline state table layouts 2015-01-20 11:39:06 +00:00
baldurk 0ee9e9be76 Re-add functions to stb_image_write to write to a FILE*. 2015-01-19 13:25:27 +00:00
baldurk 128779581f Update to stb_image_write v0.97 and stb_image v2.02 2015-01-19 13:25:24 +00:00
baldurk c071d883c7 Make sure to clamp data being saved to .hdr to non-negative 2015-01-19 11:38:35 +00:00
baldurk 5425a9d423 Allow opengl types in buffer format string parsing 2015-01-19 02:08:35 +00:00
baldurk aa81a3955c Display 'read-write' type objects grouped together in GL pipe state
* This includes atomic counters, shader storage buffer objects and images.
2015-01-19 02:04:29 +00:00
baldurk de6d93c47f Improve GL shader reflection to include Atomic bufs, SSBOs and images 2015-01-19 02:04:08 +00:00