Some work for shader debugging is identical to setting up the quad
overlay, so I've moved that logic to their own functions.
Some portions of creating a global shader debug state, and the
entirety of the initial shader debug state were agnostic of D3D API,
so they now exist in DXBC code.
On drivers only supportinmg OpenGL 3.3, like llvmpipe, ARB_gpu_shader5 may
not be available, but (u)intBitsToFloat and floatBitsTo* are part of GLSL 330,
and are also availabe by enabling the extension ARB_shader_bit_encoding.
Consequently, check for this extension when ARB_gpu_shader5 is not available,
require it when available, and enable the bit code path using these bit cast
functions accordingly.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
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
Implemented PerformanceCounterViewer::OnEventChanged to handle global event changes.
Behaviour can be toggled on/off via a new 'Sync Views' button similar to the Mesh Viewer; the default is off.
In early testing with D3D12 shader debugging, these functions did
not require any differences from the D3D11 versions. Moving them to
a common location to avoid some code duplication.
* The primary user is the main logfile itself, but it's useful for debugging
purposes to be able to log to a file and still open it externally in a viewer
without having the logging code take exclusive access to it.
* Issues not following the template will be closed. It is too much of a drain on
project resources to deal with bug reports that are not well formatted and
unclear. The template is easy to fill out and does not ask much.
* The only difference in these is whether or not pre-multiplied alpha is assumed
to be used, and that doesn't change the actual data - only the interpretation.
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.