Commit Graph

87 Commits

Author SHA1 Message Date
baldurk ae91bdcde2 Add detection/support for reverse-z projection matrices. Refs #169 2016-01-20 19:58:24 +01:00
baldurk 8b7a025853 Refactor BGRA formats to not be special (so allow any BGRA format)
* Also add ASTC and D16S8 types while in the neighbourhood
2015-11-29 22:05:26 +01:00
baldurk 707910b647 Tweak viewport/scissor overlay to be a little clearer 2015-11-19 01:33:22 +01:00
baldurk 9856b171c1 Take stencil value from max of red or green channel
* I swear some implementations return stencil in the green channel, but
  the spec says red channel. This should be safe
2015-10-26 18:15:31 +01:00
baldurk 543f15ae4a Fix GL clear-before-draw shader overlay. Refs #164 2015-10-26 11:49:23 +01:00
baldurk 57ba6e0806 Add overlays to clear before current draw/pass. Refs #164
* Depth is not cleared, only colour buffers.
* This uses the same definition of pass as the quad overdraw overlay,
  which isn't quite the same as the auto-grouping passes (which allow
  for varying colour binds being grouped together). It only counts up
  to the last draw where the outputs were different.
2015-10-25 15:49:16 +01:00
baldurk c7cfdcc689 Add basic support for displaying/picking S8 textures. Refs #165 2015-10-25 14:09:43 +01:00
baldurk 45351acdf6 Linux compile fix 2015-07-08 17:30:01 +02:00
baldurk 4c988e9e3a Better arcball controls in the mesh viewer
* Tweaked flycam a bit too, but not much.
* Refactored the API/C# side camera classes to avoid exposing a ton of
  stuff just to do relative rotations in the arcball via quaternions.
2015-07-07 15:38:00 +02:00
baldurk dd9aff3890 Implement right click to pick vertices in the mesh viewer. Refs #139 2015-07-07 10:02:36 +02:00
baldurk edda31248f Render bounding box around mesh, centre & scale arcball on bbox
* The arcball lookat position can also be dragged with alt-click or
  middle click.
* Also supports other elements as position not just magically-selected
  "POSITION" element.
2015-07-06 19:58:45 +02:00
baldurk 741d061985 Make sure texture is mipmap complete for min/max and histogram fetch
* If the app hasn't set max level appropriately, we will need to, to be
  sure that filtering doesn't come back just with black.
2015-04-02 17:40:26 +01:00
baldurk 4f8544e7c6 Handle matrices as shader outputs in GL
* We handle them mostly as a series of rows, adding only the first row
  as a varying name, but incrementing the stride for each to account for
  the space taken up by a matrix.
2015-04-02 00:05:37 +01:00
baldurk 6cd1f70bb6 Fix several warnings for compiling on VS2015
* Note at the time of committing there are still some warnings in MS
  headers that you might need to suppress in a couple of files.
* 3rd party code just has the warnings suppressed for ease of merging.
* The majority of warning fixes were for local variables shadowing
  other locals, function parameters, or members. In most cases they
  weren't a problem, but in some cases it was potentially dangerous!
2015-03-13 10:16:19 +00:00
baldurk c3e381a76a Remap entire index buffer for post-vs data, instead of just shifting
* Previously for post VS data we could maintain the index buffer by just
  doing the stream-out/transform feedback for a point list with each
  unique index. To maintain the index buffer we padded out any gaps in
  the indices with a single value, so that we could just shift the
  indices. This causes severe problems though if the indices start at 0
  and contain an invalid value like 0xcccccccc - we'd allocate a huge
  array and perform a massively wasteful streamout.
* Instead, we just stream out on the tightly packed list of unique
  indices, then remap each 'real' index to where it is in the tightly
  packed output buffer.
2015-03-10 21:05:59 +00:00
baldurk f46e31c4ba Only account for mip in slice/face index for 3D textures.
* This prevents arrays or cubemaps from having the slice or face index
  be incorrectly modified by the mip being displayed. Thanks Xavyiy on
  twitter for the report.
  https://twitter.com/Xavyiy/status/574352181190594560
2015-03-07 23:58:37 +00:00
baldurk 12519df942 Fix crash if we insert 0 into indices list that already contains 0 2015-02-26 17:28:25 +00:00
baldurk f160c28d16 Fix GL PickPixel to be able to read back depth & stencil in two passes
* GL doesn't seem to support reading both depth and stencil channels
  from a single texture, so we need to do a second pass to read back
  the stencil component
2015-02-26 15:41:47 +00:00
baldurk fae5aabcce Handle missing/unsized formats on replay
* This can happen if someone binds an uncreated texture (!).
2015-02-25 22:22:32 +00:00
baldurk ae9e9e8f9f Fix highlight boxes to not have a little pixel missing in the corner
* Also in the HLSL version, we were indexing off the end of an array
  since we were drawing 5 lines but only had 4 verts in the array.
  Oops!
* We can remove D3D's OutlineStripVB, as we're doing it all in the
  shader.
2015-02-25 22:22:06 +00:00
baldurk 3a309dcd14 Fix for compile errors/warnings on linux
* The daily linux auto-compile script was broken, it's fixed now!
2015-02-25 19:02:26 +00:00
baldurk 33deeb8618 ARB_dsa part 2 - Implement Texture* family of functions
* Since this would be another duplicated set of code, move the variants
  into common functions - each of the variants (ARB_dsa, EXT_dsa,
  non-DSA and possibly MultiTex) calls into a common function just with
  a different resource record.
* Handling the ARB/EXT dsa differences on the texture calls, the target
  parameter is set to GL_NONE for the ARB dsa calls (which lack a target
  parameter). Then in the serialise replay part, if the target is
  GL_NONE we use the ARB variant and otherwise use the EXT variant.
  See the comments at the top of gl_texture_funcs.cpp
* For functions with common code that needs to happen on replay, we pass
  the resource's ID instead of its record, to be compatible with replay
  where there are no records. To save time & unnecessary queries, also
  force all internal texture creates on replay to happen through the
  DSA interfaces so we don't have to go looking up the texture via
  selectors.
2015-02-22 23:36:33 +00:00
baldurk 7cbb68f329 Implement quad overdraw overlays for GL
* The implementation needs the fine dFdx/dFdy variants, which are only
  available in GLSL 4.50 and above. Without that support we fall back
  to the normal dFdx/dFdy which are implementation dependent. In my
  quick test on nvidia it so happened that it was still fine, but that's
  not guaranteed.
2015-02-12 20:04:48 +00:00
baldurk a7185cbf9c Remove pipeline validation (was just for debugging) 2015-02-12 18:13:11 +00:00
baldurk 086cc0e491 Rejig overlays to use separable programs instead of monolithic prog
* This means the overlays should now work for separable and monolithic
  program setups.
2015-02-12 16:46:09 +00:00
baldurk 54ad900f53 Set parameters for custom shaders, and update template & snippet buttons
* RENDERDOC_TextureType has different value meanings for the different
  types on GL - need to update the docs to reflect this.
2015-02-09 22:38:44 +00:00
baldurk 86d0b8a952 Implement custom display shaders for OpenGL logs, no parameters yet
* glsl and hlsl custom display shaders are kept separate, and only shown
  for the appropriate log type.
* The little snippets added in the shader editor aren't updated yet, and
  none of the pre-defined shader constants are filled out.
2015-02-09 22:19:13 +00:00
baldurk 8ccf071865 Implement GetTextureData for GL - underlying code behind texture saving
* This should support all forms of textures off the bat, multisampled
  textures, 3D textures, arrays, compressed and uncompressed, etc.
2015-02-09 17:29:13 +00:00
baldurk bdb823c20b Slice index for 3D textures is always relative to overall depth 2015-02-09 12:32:44 +00:00
baldurk 6f711a3470 Handle a couple of error cases more gracefully in GL xfb 2015-02-08 10:45:36 +00:00
baldurk c3ca815da1 #version technically needs to come even before #if preprocessor stmts 2015-02-08 10:34:32 +00:00
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 d41a285f4d Skip built-in input attributes when copying attrib locations over 2015-01-26 19:50:23 +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 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 64bcf35838 Make sure to copy across attrib location values from 'real' vs program 2015-01-26 16:57:57 +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 6bc7eedfa4 Implement vertex and triangle highlighting for GL buffer viewer 2015-01-25 22:50:18 +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 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 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 94a5b77be9 Disable GL mesh preview because it's buggy and soon to be rewritten 2015-01-20 15:14:22 +00:00
baldurk c63f44f0aa Make sure to destroy GL debug context and associated resources 2015-01-05 02:15:00 +00:00
baldurk e17a543e96 Split texture display shaders into precompiled variants
* GL won't let you define too many texture uniforms, and currently the tex
  sampling code blows it for the texture display shader. So we split it
  by float/uint/sint and pick the right compiled version.
2014-12-22 23:21:15 +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 1cf2a41cd7 Fix display of mips, GL_NEAREST_MIPMAP_NEAREST is required
* If GL_NEAREST is specified it means the whole mip chain is locked off,
  even if we do textureLod in the shader.
* Instead, go back to using GL_NEAREST_MIPMAP_NEAREST and clamp the
  MAX_LEVEL to make the texture mipmap complete when necessary.
2014-12-06 20:52:51 +00:00