Commit Graph
197 Commits
Author SHA1 Message Date
tabi.katalin 2507532623 Fix GLES shader compile errors
Detected two shader compile errors while replaying GLES apps:
1. „#extension directive must occur before any non-preprocessor token” -  Fix the order of precisions and extensions in the shader code.
2. „extension 'GL_OES_texture_cube_map_array' is not supported”  - Do not add extensions if they are actually not supported. TEXTURE_CUBE_MAP_ARRAY was added to GLES 3.2 so   GL_OES_texture_cube_map_array and GL_EXT_texture_cube_map_array are no longer used.
2019-02-25 11:30:25 +00:00
baldurk 180b6f7cdc Remove use of shading_language_420pack and explicit_attrib_location
* On GL we can manually set these bindings when needed, and then we don't
  require those extensions.
2019-02-13 18:50:53 +00:00
baldurk 11819ed3be Refactor and clean up internal shaders to be better organised
* Split up old uber-cbuffers used for unrelated shaders into shader-specific
  cbuffers (DebugPixelCBufferData -> TexDisplayPSCBuffer / CheckerboardCBuffer /
  MeshPixelCBuffer).
* Split up HLSL files so not everything is lumped into 'debugdisplay.hlsl' but
  has separate files as appropriate.
* Use #include in GLSL and HLSL to better organise shader code together rather
  than relying on lumping files together on the C++ side.
* Renamed files like 'debugcbuffers.h' to 'hlsl_cbuffers.h'.
* Trimmed out some extensions/cruft that isn't needed in the GLSL side since we
  no longer use separable shaders.
* Combine some shaders like Outline/Checkerboard that were similar into central
  place.
2019-02-13 18:50:53 +00:00
baldurk 86ff87863e Update copyright years to 2019 2019-02-01 18:32:13 +00:00
baldurk 18958fedd0 Workaround ARM driver bug, hide UBOs unless they're used. Closes #1225 2019-01-04 12:26:30 +00:00
baldurk 761f8be4bd Fix mesh view with double vertex attribute inputs 2019-01-04 11:48:35 +00:00
baldurk b08d277b61 Apply clang-format to embedded internal shader source
* It gets a couple of things less than ideal, mostly glsl block names being on
  the next line, but otherwise it's readable and stops mixed tabs/spaces which
  had snuck in without checks.
2018-12-17 17:10:34 +00:00
tabi.katalin a8ca37f5e5 Fix OpenGL ES fragment shader compile error
Fix fragment shader compile error (too many parameters in function call) when replaying OpenGL ES desktop application.
2018-12-17 17:10:03 +00:00
baldurk 13e7d1c134 Support display of YUV textures on D3D11, D3D12 and Vulkan
* Supported textures are decoded into standard format of YUVA, displayed
  visually with Y in green, U in blue, V in red.
* A new texture display mode 'YUVA decode' has been added which does a default
  full-range conversion from YUV to RGB.
* Custom shaders can be used to implement a custom decode matrix.
2018-12-14 20:14:07 +00:00
baldurk 62ba684567 Move Vec4u to a global struct next to Vec4f 2018-12-13 23:43:07 +00:00
tabi.katalin b54477036d Fix fragment shader compile error
OpenGL ES does not allow swizzles on scalar expressions. It causes error when replaying OpenGL ES desktop application.
2018-11-12 18:41:54 +00:00
baldurk 57caf01394 Refactor heatmap for quad overdraw/triangle size to be applied late
* Instead of baking these into the overlay texture and trying to decode them
  afterwards, we instead write a grayscale 16F value into the overlay texture,
  and add a special decode display mode that will use the heatmap and bucketing
  provided.
* This means that saving these overlay textures now saves grayscale. When saving
  to an 8-bit format, we remap to 0-255 so that greater than 1.0 values are
  mapped lower.
2018-11-01 12:23:12 +00:00
baldurk 159a67b853 Implement MSAA to Array colour copies. Closes #1023 2018-10-05 18:16:59 +01:00
baldurk 7a6580bb0f Fix compilation of all debug shaders on GLES 2018-10-04 16:07:38 +01:00
baldurk 11cba8d36b Disable quad overdraw overlay on GLES 2018-10-04 16:07:37 +01:00
baldurk ec165964bc Fix some pedantic GLSL compilation problems 2018-10-04 16:07:36 +01:00
baldurk 345208e0d9 Avoid atomic ops on vector members
* This doesn't translate well to metalsl and is in general not very useful - we
  were only doing it to avoid packing issues which in some cases are moot
  anyway. E.g. the histogram buffer doesn't have to be std140 and packed like an
  array of vectors, it can be std430 and packed like an array of uints.
2018-09-05 12:51:00 +01:00
baldurk 04dc71ce32 Fix compilation of depth MSAA <-> Array shaders on Vulkan
* glslang doesn't like the GL_ARB_sample_shading extension
2018-08-02 18:44:31 +01:00
baldurk a82c7a10d3 Implement proxied MSAA texture contents on OpenGL 2018-08-01 17:29:39 +01:00
baldurk 0b6f735ad2 Tidy up vertex-fragment structures in HLSL shaders
* Fix a few mismatches and delete wireframeV2F which is not needed in any other
  shaders but the mesh rendering path. Others just need SV_Position.
2018-08-01 17:29:36 +01:00
baldurk 296f84fb7e Change GL text rendering to be compatible with a wider set of versions
* In particular this will work with GLES 2.0
2018-07-06 22:44:26 +01:00
baldurk 573ab82fbf Match varying names in case some GL driver doesn't link by location 2018-07-06 22:44:16 +01:00
baldurk 487ac04d83 When generating GLES shaders without uniforms, declare precision
* This usually comes from debuguniforms.h, but if we exclude it we still need to
  declare the precision.
2018-07-06 22:44:10 +01:00
baldurk f3a210c636 Workaround for ARM bug if declaring UBOs with larger binding than set
* If the descriptor set only declares bindings 0 and 1, then a declared
  UBO with binding 2 - even if unused by the shader - will crash the
  driver.
* As a workaround for now we just #define out these UBOs unless
  compiling a pipeline that requires them.
* On OpenGL we just define the macro always, since this isn't needed.
2018-02-26 15:42:33 +00:00
baldurk cc16a81d2c Add necessary extension for compiling #version 150 fixedcol.frag
* Previously we were implicitly satisfying this by making it a separable
  program.
2018-02-21 18:32:52 +00:00
baldurk 2f73ed373b Implement GLES overlays by dropping use of separable programs
* GLES separable programs are completely broken, so we need to just go
  back to ye-olde style of linking shaders together. On GLES this is
  particularly painful as it means we have to version match whatever
  shader the user was using.
2018-02-13 21:10:11 +00:00
baldurk 528fa085b4 On ES when declaring a #version 100 shader, don't append the 'es' suffix 2018-02-13 21:10:09 +00:00
baldurk 77569fa75d Patch checkerboard.frag for GLES compat (input/output precise match) 2018-01-31 18:24:17 +00:00
baldurk a69efa1702 Refactor debug manager, reducing duplication and better organisation
* In many cases (particularly on D3D11/D3D12) the replay would simply
  forward functions as-is to the debug manager for implementation. This
  meant that change any of those function signatures required more
  tedious copy-pasting than was necessary, and didn't make much sense.
* Now the replay class is responsible for implementing all the
  functionality and owns any debug-only API resources, but can still use
  the debug manager for any indirect utility functions like caching,
  etc.
* The API resources are better organised by task in the replay class
  rather than being all over the place.
* Finally on vulkan, added some helper functions to reduce the
  boilerplate involved in initialising objects.
2018-01-16 16:29:39 +00:00
baldurk 65724841b6 Shader discard doesn't seem to work well on mobile, remove it
* Instead we write transparent black when out of bounds. This only works
  when we're blending, but the cases that we don't blend are when we do
  a blit to a precisely sized output target with no offset, so it
  shouldn't cause a problem.
2018-01-02 15:13:07 +00:00
baldurk e305029ddd Update copyright years to 2018 2018-01-01 17:55:29 +00:00
Jimmy Lee 06502e12c4 remap all depth format for gles depth fetch 2017-07-21 08:18:56 -07:00
babymustgrowstrong 3b1ace7a53 Various fixes/improvements from Android OpenGL ES development 2017-06-08 06:01:39 -07:00
baldurk 70e8abb382 Fix handling of slice offsets for 3D textures
* There were inconsistencies that could lead to off-by-one or
  missampling in some cases when applying a slight offset to ensure we
  sample the selected slice of the texture.
2017-05-23 16:42:55 +01:00
babymustgrowstrong 43d4268263 Various changes/fixes for OpenGLES
bgra8_ext support
glMapBufferOES support
shader compile fix debuguniforms.h
2017-05-03 15:30:43 -07:00
baldurk ae50fa99ee Revamp version tagging, remove ugly suffix on git hash. Refs #571
* Tacking -official onto the git hash was a hack only needed on windows,
  and since we want more information it doesn't scale.
* Instead we track anything we need to know about the version in
  separate variables, like whether it's a stable build or a nightly/
  local build. Or if it's built by a downstream distribution then the
  version number for the downstream build.
2017-04-27 19:47:50 +01:00
Janos Pantos 46a12525ef Modify shaders to be GLES compatible. 2017-03-09 19:13:21 +00:00
baldurk 71c05ed572 Remove some of the redundant places where git commit hash is #define'd 2017-02-16 17:10:02 +00:00
baldurk 5f36a16612 atomic operations on buffers aren't writeonly 2017-02-13 10:00:37 +00:00
baldurk d368cf2919 Require GL_ARB_gpu_shader5 for gl_SampleMaskIn in quad write shader 2017-01-24 10:14:55 +00:00
baldurk 5c8fca5791 Require GL_ARB_shader_image_load_store for quad-overdraw resolve pass 2017-01-17 18:38:32 +00:00
baldurk a88486d380 Fix uint/int cast compile error 2017-01-17 18:38:32 +00:00
baldurk 21d6f41c97 Change GLSL shaders to compile at #version 150 and add #extensions
* For some #extensions we can fallback to a lesser path (or just drop
  that functionality - e.g. displaying cubemap arrays if there's no
  extension for it).
2017-01-17 16:55:26 +00:00
baldurk eb5761dabe Use non-instanced triangle lists to draw text overlay
* Mesa GL seems like it doesn't like the instanced draw, for whatever
  reason.
2017-01-17 11:02:40 +00:00
baldurk 4a80a744c3 Add explicit cast (gl_InstanceID is int), fixes errors on mesa compiler 2017-01-17 11:02:33 +00:00
baldurk 030cbfde9a Batch update copyright years everywhere 2017-01-06 12:13:31 +00:00
baldurk 1a2ff55fa4 Ensure proper precedence when calculating SRGB to linear conversion 2017-01-02 20:16:27 +00:00
baldurk 5de727e254 Move PS constant buffer to register 0 2016-11-18 16:31:31 +01:00
baldurk 92b6d7f87d Implement triangle size overlay for D3D12 using mesh output 2016-11-18 16:31:29 +01:00
baldurk c08a357598 Remove redundancy in D3D mesh shaders, add mesh rendering for D3D12 2016-11-18 16:31:24 +01:00