Commit Graph
238 Commits
Author SHA1 Message Date
Aliya PazylbekovaandBaldur Karlsson 2cb546686b Vk Pixel History: multi sampled colour
Colour only, depth/stencil copy not supported.
This means that we only report pre-mod and post-mod colour values for
events. Since stencil copy is not supported, number of fragments is
not reported, and shader output is not queried.
2020-04-29 18:48:37 +01:00
baldurk 745b65b3d2 Fix sampling from cube textures 2020-04-27 17:03:12 +01:00
baldurk 105f0e4e9f Fix GL handling of matrix parameters to specify :col instead of :row
* In GL matrices are also split column-wise
2020-04-24 20:51:32 +01:00
baldurk 18713f644e Implement OpImageQueryLod by faking derivatives on sample quad 2020-04-23 19:14:09 +01:00
baldurk 7d0d492a66 Add missing copyright statement in shader 2020-04-10 16:58:52 +01:00
Aliya PazylbekovaandBaldur Karlsson 8d2ad78f05 Vk Pixel History: refactoring, per fragment depth
- Refactor to use common funcs
- Add per fragment depth data
- Rename pixelhistory.frag to pixelhistory_primid.frag
- Fix how some per fragment pipelines are created

For per fragment data we create 3 pipelines
1) Post modification pipeline
changes the stencil state and scissors around the target pixel
2) Shader output pipeline
in addition to above, disables rasterization discard, depth bounds test,
culling and turns off blending
3) Primitive ID pipe
in addition to above, disables depth test and depth write, and changes
the fragment shader to only output primitive ID
2020-03-20 16:16:12 +00:00
Aliya PazylbekovaandBaldur Karlsson 83623af8d8 Vk Pixel History: per fragment data
- For now only per fragment primitive ID, and colour values, not depth
information.
2020-03-20 16:16:12 +00:00
baldurk cb94a28768 Create GLES shaders as version 300 if replaying on GL ES 3.0. Refs #1770 2020-03-11 18:00:53 +00:00
baldurk 936e6372cb Remove use of 3rdparty/ prefix from includes
* We instead always have 3rdparty/ in the relevant include search paths and rely
  on that. Each library still has its own unique base dir within 3rdparty to
  clarify where the include is coming from.
2020-03-11 18:00:53 +00:00
baldurk 295d3958dd Refactor D3D11 pixel history to use buffer output instead of texture
* This removes the requirement that the colour output format be UAV-compatible.
* It also makes addressing simpler and removes the requirement for
2020-02-18 19:18:51 +00:00
baldurk a98a8c49a7 Improve handling of multi-dimensional array input/outputs from shaders 2020-02-03 18:18:16 +00:00
baldurk df266eb04d Fix some version properties in windows resource files 2020-01-14 18:02:10 +00:00
baldurk 2916c0f9f7 Update copyright years to 2020 2020-01-06 16:20:45 +00:00
baldurk e9bb5a8219 Initialise color when doing manual resolve on GL 2019-12-18 19:09:18 +00:00
baldurk 14d01ff995 Remove support for serialising STL types, remove STL interop 2019-12-16 18:10:32 +00:00
baldurk bd9f4fc389 Remove use of vector/string from core project
* This also affects the drivers via interfaces e.g. IReplayDriver and some
  utility functions.
2019-12-16 18:10:31 +00:00
baldurk f68645bddc Reduce dependencies pulled in by common.h 2019-12-16 17:06:16 +00:00
baldurk 5f72b9d53c Remove std::string/std::vector use from os-specific layer 2019-12-16 17:06:15 +00:00
baldurk ff08748238 Ensure all files have trailing new-lines and enforce with clang warning 2019-12-02 20:28:05 +00:00
baldurk 11c39377b1 Handle range adaption in texture remapping
* This can be used in saving overlays, stencil, etc
2019-11-27 11:05:24 +00:00
baldurk 938056a67c Add support for serialising MSAA initial states on GL 2019-11-26 17:38:27 +00:00
baldurk edc8fb6bd6 Be more precise with texture remapping to handle integer textures 2019-11-26 17:38:26 +00:00
baldurk c497446524 Simplify D3D texture render shader parameters, fix scaling bug in D3D12
* We previously relied on setting the viewport smaller than the output
  dimensions in D3D11 to scale for lower mips. In D3D12 the viewport is set to
  the output dimensions internally so we can't do that, so instead apply a
  manual scale.
2019-11-13 10:05:30 +00:00
Gert WollnyandBaldur Karlsson 44e7bbe439 gl: Handle the use of (u)intBitsToFloat by using a separate define
The shader code is preprocessed with glslang that doesn't use the driver
capabilities to define macros indicating the availability of extensions,
instead it uses its own set of supported extensions, and in this case
it supports ARB_gpu_shader5. As a result the generated shader code would
make use of the (u)intBitsToFloat conversion functions based on the define
GL_ARB_gpu_shader5 also if the driver doesn't support this extension.

Hence an additional define is added to indicate whether bit casting
functions are available, and the extension is only enabled/required when
the driver actually supports it.

Closes: #1586

v2: - Fix ws
    - reword commit message

v3: - check for ARB_shader_bit_encoding and ARB_gpu_shader5 in shader creation code
    - don't enable GL_ARB_gpu_shader5 unconditionally in the OpenGL shader
    - reword commit message

v4: Use an additional define HAS_BIT_CONVERSION to make sure gslang correctly
    parses the shader code (Baldurk).

v6: - Add HAS_BIT_CONVERSION also with the GLES code path (Baldur)
    - split patch
    - reword commit message(s) (Baldur)

v7: fix ws

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>

lala
2019-11-11 14:50:46 +00:00
tabi.katalinandBaldur Karlsson 4037927834 Fix histogram shader compilation for GLES
These are not supported in GLES and causes shader compile errors when replaying a capture: 
- OpenGL does not allow swizzles on scalar expressions
- implicit cast from "int" to "float"
- implicit cast from "int" to "uint"
Scalar swizzling can be replaced by vec4 and constant types can be explicitly specified.
2019-10-24 18:02:10 +01:00
baldurk 8ce2ea2202 Improve calculation of histogram
* The histogram shouldn't be calculated as channel-wise averages, but instead by
  'stacking' the channels (each channel contributes 1 to the appropriate
  bucket).
* Degenerate channels (where min==max) are excluded and listed only as a single
  spike, to avoid blowing out the automatic y-axis.
2019-10-10 16:48:42 +01:00
baldurk 2d473c39e7 Keep format in GL shaders for R/W images 2019-09-23 13:45:29 +01:00
Dominic Filion Guayandbaldurk 57c60cdfb8 Fixed issue with MSAA textures on Oculus Quest. 2019-09-18 19:28:42 +01:00
baldurk 6971a585aa Fix compilation on 32-bit windows 2019-08-26 16:52:09 +01:00
baldurk 3b524ea7f1 Fix reflection of arrays-of-binds - textures and buffers 2019-08-26 13:22:26 +01:00
baldurk 07158ad24c Fix support for triangle fans on GL/Vulkan 2019-08-20 15:33:12 +01:00
baldurk 9e68cbe59b Fix typo in unit tests 2019-08-16 19:00:40 +01:00
baldurk 0c3b827b35 Test specialization constant IDs and default values properly 2019-08-16 17:38:35 +01:00
baldurk dc660aa26c Allow building SPIR-V with debug info and check debug info in reflection 2019-08-16 17:38:35 +01:00
baldurk 3b00566ace Move GLSL reflection tests to common place for SPIR-V to use 2019-08-16 16:12:01 +01:00
baldurk 7715188d0d GLES 3.1 can't handle MSAA array textures, only 3.2 can 2019-06-28 11:01:19 +01:00
baldurk a5c909ec0c Don't try to use MSAA array textures on MoltenVK 2019-06-21 12:51:52 +01:00
baldurk 28cde37849 Add support for generating SPIR-V shaders for OpenGL
* Only a couple of these are needed - ones we might link with user shaders in a
  program
2019-06-07 18:44:13 +01:00
baldurk a27234c28c Split apart some of the SPIR-V headers
* We don't want to have glslang specific bits mixed in with general SPIR-V bits.
  This is also preparing for moving some SPIR-V structs into common code that
  can be re-used in new reflection/disassembly as well as editing.
2019-06-03 14:16:42 +01:00
baldurk afb7fa3771 Add handling for MSAA Array textures on GL/GLSL shaders. Closes #1333 2019-04-01 14:21:52 +01:00
baldurk fc8203ed6c Make D3D11 overlay rendering FL9 compatible. Closes #1332 2019-03-29 17:48:15 +00:00
tabi.katalinandBaldur Karlsson 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.katalinandBaldur Karlsson 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