Commit Graph

74 Commits

Author SHA1 Message Date
Jeroen Bakker
e2dc63c5de Fix #147618: PyGPU incorrect colors when drawing images
644fb2b679 fixed a long standing issue
that offscreen example showed the wrong colors. However the fix assumes
that input texture color space is always sRGB.

This adds a shader variation that draws textures that are stored in scene referred
linear color space (like all of our Image data-block).

Co-authored-by: Clément Foucault <foucault.clem@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/147788
2025-10-16 19:12:16 +02:00
Hans Goudey
a68d39e9d9 Cleanup: Formatting
Run `make format` after the library update in the previous commit.
2025-10-02 12:55:42 -04:00
Clément Foucault
1f2c906e2a GPU: Shader: Always mute line directives for GLSL
This is motivated by the latest changes to the preprocessor
which outputs a lot of line directives when code is
generated or unrolled.

In this case the reported line would be correct but not
correctly displayed.

Moreover the system of outputing hashes inside the
`#line` directive proved to be incompatible with some
compilers and tools (renderdoc).

This commit always comments the line directives before
compilation (solves the compatibility issue).
When error logging, we then scan the commented
directives to output the correct filename and source
line. The log line is kept untouched and will show
the correct final generated code that triggered the
error.

This also fixed the error line parsing for vulkan.

Pull Request: https://projects.blender.org/blender/blender/pulls/145096
2025-08-26 12:46:46 +02:00
Clément Foucault
2f2ff44e56 GPU: Shader: Remove legacy creation API
This API is no longer used for 5.0.

Pull Request: https://projects.blender.org/blender/blender/pulls/144819
2025-08-20 09:25:32 +02:00
Clément Foucault
1388a70914 GPU: Remove wrapper type for gpu::Shader
This is the first step into merging DRW_gpu_wrapper.hh into
the GPU module.

This is very similar to #119825.

Pull Request: https://projects.blender.org/blender/blender/pulls/144229
2025-08-11 09:34:28 +02:00
Miguel Pozo
0730d3f256 Fix: Python API: bpy.app.is_job_running('SHADER_COMPILATION')
Shader compilation no longer uses the `WM_job` API.
Add a `GPU_shader_batch_is_compiling` function to query if there's any
shader compilation happening, and update `bpy_app_is_job_running` to
handle this as a special case.

Pull Request: https://projects.blender.org/blender/blender/pulls/143559
2025-07-31 20:06:27 +02:00
Miguel Pozo
fca4a16975 Fix: GPU: GPUWorker lock
Prevent race conditions caused by calling `GPUWorker::wake_up` when the
worker is not waiting.
Found to be an issue in #139627, since `wake_up` is likely to be called
before the thread has fully started.

Pull Request: https://projects.blender.org/blender/blender/pulls/139842
2025-06-10 17:24:18 +02:00
Miguel Pozo
2db0b92280 GPU: Add CompilationPriority
Allow adding compilation batches to different priority queues.
Set priorities so static shaders are always compiled first,
then materials, and optimized materials last.

Pull Request: https://projects.blender.org/blender/blender/pulls/139456
2025-05-29 19:43:02 +02:00
Clément Foucault
8bba1c8056 Fix #139191: GPU: Blender crashes on startup with addons that use pyGPU shader
This was caused by missing `shader->constants`.
Creating an empty `SpecializationConstants` fixes the issue.
2025-05-26 11:09:49 +02:00
Miguel Pozo
e6638d6e5e Refactor: GPU: GPUMaterial & GPUPass compilation
Cleanup and simplification of GPUMaterial and GPUPass compilation.
See #133674 for details/goals.

- Remove the `draw_manage_shader` thread.
  Deferred compilation is now handled by the gpu::ShaderCompiler
  through the batch compilation API.
  Batch management is handled by the `GPUPassCache`.
- Simplify `GPUMaterial` status tracking so it just queries the
  `GPUPass` status.
- Split the `GPUPass` and the `GPUCodegen` code.
- Replaced the (broken) `GPU_material_recalc_flag_get` with the new
  `GPU_pass_compilation_timestamp`.
- Add the `GPU_pass_cache_wait_for_all` and
  `GPU_shader_batch_wait_for_all`, and remove the busy waits from
   EEVEE.
- Remove many unused functions, properties, includes...

Pull Request: https://projects.blender.org/blender/blender/pulls/135637
2025-05-22 17:53:22 +02:00
Clément Foucault
caac241c84 GPU: Make Shader Specialization Constant API Thread Safe
This allows multiple threads to request different specializations without
locking usage of all specialized shaders program when a new specialization
is being compiled.

The specialization constants are bundled in a structure that is being
passed to the `Shader::bind()` method. The structure is owned by the
calling thread and only used by the `Shader::bind()`.
Only querying for the specialized shader (Map lookup) is locking the shader
usage.

The variant compilation is now also locking and ensured that
multiple thread trying to compile the same variant will never result
in race condition.

Note that this removes the `is_dirty` optimization. This can be added
back if this becomes a bottleneck in the future. Otherwise, the
performance impact is not noticeable.

Pull Request: https://projects.blender.org/blender/blender/pulls/136991
2025-05-19 17:42:55 +02:00
Miguel Pozo
c16aba915f GPU: Add GPU_shader_batch_cancel
Fix the recently implemented ShaderCompiler::batch_cancel.
Expose it with GPU_shader_batch_cancel and
GPU_shader_specialization_batch_cancel.
Use them in the EEVEE ShaderModule destructor, to prevent blocking on
destruction when there are in-flight compilations.

Pull Request: https://projects.blender.org/blender/blender/pulls/138774
2025-05-12 19:54:03 +02:00
Miguel Pozo
992e7c95a7 GPU: Converge ShaderCompiler implementations
Part of #136993.

Share as much of the ShaderCompiler implementations as possible.
Remove the ShaderCompiler/ShaderCompilerGeneric split and make most of
its functions non virtual.
Move the `get_compiler` function from `Context` to `GPUBackend` and
creation/deletion to `GPUBackend::init/delete_resources`.
Add a `batch_cancel` function to `ShaderCompiler` (needed for the
GPUPass refactor).

As a nice extra, the multithreaded OpenGL compilation has become faster
too.
The barbershop materials + EEVEE static shaders have gone from 27s to
22s.

I have not observed any performance difference on Vulkan or Metal.

Pull Request: https://projects.blender.org/blender/blender/pulls/136676
2025-05-08 18:16:47 +02:00
Clément Foucault
58d32b482b Fix #138354: GPU: Race condition with SRGB builtin uniform
Multiple threads would be setting the globals
`g_shader_builtin_srgb_transform` and
`g_shader_builtin_srgb_is_dirty`.

These are use for color management inside the builtin
shaders. But the render thread could modify these
values even if its shader have no use of these.

The fix is to move these globals to the `gpu::Context`
class. This way we remove the race condition.
2025-05-07 16:43:42 +02:00
Miguel Pozo
a5ed5dc4bf GPU: Support deferred compilation in ShaderCompilerGeneric
Update the `ShaderCompilerGeneric` to support deferred compilation
using the batch compilation API, so we can get rid of
`drw_manager_shader`.
This approach also allows supporting non-blocking compilation
for static shaders.

This shouldn't cause any behavior changes at the moment, since batch
compilation is not yet used when parallel compilation is disabled.

This adds a `GPUWorker` and a `GPUSecondaryContext` as an easy to use
wrapper for managing secondary GPU contexts.

(Part of #133674)
Pull Request: https://projects.blender.org/blender/blender/pulls/136518
2025-04-07 15:26:25 +02:00
Clément Foucault
3562433ae7 pyGPU: Deprecate Shader.program getter
This is getting in the way of making the
GPUShader API more threadsafe.

This getter already doesn't work for vulkan
and Metal, and has very limited usage.

Keeping the python function to avoid errors
and display a deprecation warning.

Pull Request: https://projects.blender.org/blender/blender/pulls/136983
2025-04-04 14:23:09 +02:00
Clément Foucault
fb6c68aaef Fix: GPU: Shader source log flooding the console on error
This has been commited by mistake in 86b70143d5
2025-03-04 13:05:22 +01:00
Miguel Pozo
f930d71a1e GPU: Threadsafe shader creation and acquisition
Move the `StaticShader` class from Workbench to `GPU_shader` and make
compilation thread-safe (Shader usage is still not thread-safe).
Use `StaticShader`s for all shader caches.

Subdivision shaders are still not ported.

(Part of #134690)

Pull Request: https://projects.blender.org/blender/blender/pulls/134812
2025-02-27 19:20:33 +01:00
Clément Foucault
86b70143d5 Cleanup: GPU: Remove unused Transform Feedback implementation
Most of the cleanup is inside the metal backend.

Pull Request: https://projects.blender.org/blender/blender/pulls/134349
2025-02-10 17:30:42 +01:00
Brecht Van Lommel
c7502b092d Cleanup: Various clang-tidy warnings in gpu
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:18 +01:00
Campbell Barton
560b6e2831 Cleanup: spelling (make check_spelling_*) 2024-12-11 11:23:51 +11:00
Miguel Pozo
e24eadbb42 GPU: Add assert_framebuffer_shader_compatibility
Ensure all the framebuffer color attachments are written to.

Pull Request: https://projects.blender.org/blender/blender/pulls/130995
2024-12-10 17:13:06 +01:00
Clément Foucault
994c43413a Metal: Remove SSBO Vertex Fetch
This API was used as a workaround to the lack of
geometry shader. It has been rendered redundant
since the introduction of #125782.
2024-12-05 22:58:52 +01:00
Clément Foucault
00a8d006fe GPU: Move Polyline shader to primitive expansion
This port is not so straightforward.

This shader is used in different configurations and is
available to python bindings. So we need to keep
compatibility with different attributes configurations.

This is why attributes are loaded per component and a
uniform sets the length of the component.

Since this shader can be used from both the imm and batch
API, we need to inject some workarounds to bind the buffers
correctly.

The end result is still less versatile than the previous
metal workaround (i.e.: more attribute fetch mode supported),
but it is also way less code.

### Limitations:
The new shader has some limitation:
- Both `color` and `pos` attributes need to be `F32`.
- Each attribute needs to be 4byte aligned.
- Fetch type needs to be `GPU_FETCH_FLOAT`.
- Primitive type needs to be `GPU_PRIM_LINES`, `GPU_PRIM_LINE_STRIP` or `GPU_PRIM_LINE_LOOP`.
- If drawing using an index buffer, it must contain no primitive restart.

Rel #127493

Co-authored-by: Jeroen Bakker <jeroen@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/129315
2024-11-27 17:37:04 +01:00
Campbell Barton
b9f055459a Cleanup: ensure trailing space around comment blocks 2024-11-27 19:01:00 +11:00
Hans Goudey
9b97ba1462 Cleanup: GPU: Avoid raw pointers for shader API strings
Avoid measuring the length of strings repeatedly by passing their
length along with their data with `StringRefNull`. Null termination
seems to be necessary still for passing the shader sources to OpenGL.
Though I doubt this is a bottleneck, it's still nice to avoid overhead from
string operations and this helps move in that direction.

Pull Request: https://projects.blender.org/blender/blender/pulls/127702
2024-11-01 20:00:31 +01:00
Clément Foucault
324517fd78 Cleanup: GPU: Fix clang tidy warnings
Removes some other things like:
- `TRUST_NO_ONE` which was the same as `#ifndef NDEBUG`.
- Replace `reinterpret_cast` by `unwrap`

Pull Request: https://projects.blender.org/blender/blender/pulls/129631
2024-10-31 15:18:29 +01:00
Clément Foucault
62826931b0 GPU: Move more linting and processing of GLSL to compile time
The goal is to reduce the startup time cost of
all of these parsing and string replacement.

All comments are now stripped at compile time.
This comment check added noticeable slowdown at
startup in debug builds and during preprocessing.

Put all metadatas between start and end token.
Use very simple parsing using `StringRef` and
hash all identifiers.

Move all the complexity to the preprocessor that
massagess the metadata into a well expected input
to the runtime parser.

All identifiers are compile time hashed so that no string
comparison is made at runtime.

Speed up the source loading:
- from 10ms to 1.6ms (6.25x speedup) in release
- from 194ms to 6ms (32.3x speedup) in debug

Follow up #129009

Pull Request: https://projects.blender.org/blender/blender/pulls/128927
2024-10-15 19:47:30 +02:00
Clément Foucault
d2fdb22b93 GPU: Add support for in shader printf
This allows much easier debugging of shader programs.

Usage is as simple as adding `printf` calls inside shaders.
example: `printf("Formating %d\n", my_var);`

Contrary to the `drw_print`, this is not limited
to draw manager shader dispatch/draws. It is compatible
with any shader inside blender.
Most notably, this doesn't need a viewport to display.
So this can be used to debug render pipeline.

Data formating is currently limited to only `%x`, `%d`,
`%u` and `%f`. This could be easily extended if this is
really needed.

There is no type checking, so values are directly reinterpreted
as specified by the printf format.

The current approach for making this work is to bind a
storage buffer inside `GPU_shader_bind`, making it
available to any shader that needs it. The storage buffer
is downloaded back to CPU after a frame or a render
step and the content printed to the console.

This scheduling means that you cannot rely on these printfs
to detect crashes. We could add a mode to force flushing
at shader binding to avoid this limitation.

The values are written from the shaders in binary form and
only formated on the CPU. This avoid issues with manual
printing like with `drw_print`.

Pull Request: https://projects.blender.org/blender/blender/pulls/125071
2024-07-19 15:48:00 +02:00
Miguel Pozo
33005ad716 GPU: Non-blocking specialization constants compilation
Update the batch specializations compilation to allow using it in an
async way.

The implementation has 2 main limitations:
- Only one batch at a time can be processed, extra batches will be
  added to a queue.
- Binding a specialization variant that is still being compiled will fail.

Pull Request: https://projects.blender.org/blender/blender/pulls/123015
2024-06-20 18:02:44 +02:00
Miguel Pozo
22652b305e GPU: Add GPU_shaders_precompile_specializations
Allow precompiling specialization constants variations in parallel.
Only supported in OpenGL as the rest of the batch compilation API,
on the other backends the function is a no-op.
This also moves the `SpecializationConstant` from
`gpu_shader_create_info` (private API) into`GPU_common_types`
(public API).

Pull Request: https://projects.blender.org/blender/blender/pulls/122796
2024-06-07 18:45:31 +02:00
Miguel Pozo
a249e93ad1 GPU: Add missing virtual destructor to ShaderCompiler 2024-06-06 15:50:09 +02:00
Miguel Pozo
74224b25a5 GPU: Add GPU_shader_batch_create_from_infos
This is the first commit of the several required to support
subprocess-based parallel compilation on OpenGL.
This provides the base API and implementation, and exposes the max
subprocesses setting on the UI, but it's not used by any code yet.

More information and the rest of the code can be found in #121925.

This one includes:
- A new `GPU_shader_batch` API that allows requesting the compilation
  of multiple shaders at once, allowing GPU backed to compile them in
  parallel and asynchronously without blocking the Blender UI.
- A virtual `ShaderCompiler` class that backends can use to add their
  own implementation.
- A `ShaderCompilerGeneric` class that implements synchronous/blocking
  compilation of batches for backends that don't have their own
  implementation yet.
- A `GLShaderCompiler` that supports parallel compilation using
  subprocesses.
- A new `BLI_subprocess` API, including IPC (required for the
  `GLShaderCompiler` implementation).
- The implementation of the subprocess program in
  `GPU_compilation_subprocess`.
- A new `Max Shader Compilation Subprocesses` option in
  `Preferences > System > Memory & Limits` to enable parallel shader
  compilation and the max number of subprocesses to allocate (each
  subprocess has a relatively high memory footprint).

Implementation Overview:
There's a single `GLShaderCompiler` shared by all OpenGL contexts.
This class stores a pool of up to `GCaps.max_parallel_compilations`
subprocesses that can be used for compilation.
Each subprocess has a shared memory pool used for sending the shader
source code from the main Blender process and for receiving the already
compiled shader binary from the subprocess. This is synchronized using
a series of shared semaphores.
The subprocesses maintain a shader cache on disk inside a
`BLENDER_SHADER_CACHE` folder at the OS temporary folder.
Shaders that fail to compile are tried to be compiled again locally for
proper error reports.
Hanged subprocesses are currently detected using a timeout of 30s.

Pull Request: https://projects.blender.org/blender/blender/pulls/122232
2024-06-05 18:45:57 +02:00
Hans Goudey
fe76d8c946 Refactor: Remove unnecessary C wrappers for vertex and index buffers
Now that all relevant code is C++, the indirection from the C struct
`GPUVertBuf` to the C++ `blender::gpu::VertBuf` class just adds
complexity and necessitates a wrapper API, making more cleanups like
use of RAII or other C++ types more difficult.

This commit replaces the C wrapper structs with direct use of the
vertex and index buffer base classes. In C++ we can choose which parts
of a class are private, so we don't risk exposing too many
implementation details here.

Pull Request: https://projects.blender.org/blender/blender/pulls/119825
2024-03-24 16:38:30 +01:00
Hans Goudey
8b514bccd1 Cleanup: Move remaining GPU headers to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/119807
2024-03-23 01:24:18 +01:00
Miguel Pozo
c713fbc2d3 GPU: Allow printing full shader source on compilation error
Add a define (DEBUG_LOG_SHADER_SRC_ON_ERROR ) in gpu_shader_private.h
to print the full source code of shaders that fail to compile.

Pull Request: https://projects.blender.org/blender/blender/pulls/116470
2024-02-26 17:30:15 +01:00
Jeroen Bakker
4ac0267567 OpenGL: Specialization Constants
This PR adds support for specialization constants for the OpenGL
backend. The minimum OpenGL version we are targetting doesn't
have native support for specialization constants. We simulate this
by keeping track of shader programs for each set of specialization
constants that are being used.

Specialization constants can be used to reduce shader complexity
and improve performance as less registry and/or spilling is done.

This requires the ability to recompile GLShaders. In order to do this
we need to keep track of the sources that are used when the shader
was compiled. For static sources we only store references
(`GLSource::source_ref`), for dynamically generated sources we keep
a copy of the source (`GLSource::source`).

When recompiling the shader GLSL source-code is generated for the
constants stored in `Shader::constants`. When compiling the previous
GLSource that contains specialization constants is then replaced
by the new version.

Pull Request: https://projects.blender.org/blender/blender/pulls/116926
2024-01-12 14:28:50 +01:00
Clément Foucault
1c96d0d861 Metal: Improve shader logging
This adds some `#line` directive between the
source file injection so that the log parser knowns
which file the errors originated from.

This is then followed by a scan over the combined
source to find out the real row number.

This needed some changes in the `Shader::plint_log`
to skip lines to avoid outputing redundant information.
2024-01-01 00:43:09 +13:00
Jason Fielder
335d3a1b75 GPU: Add Shader specialization constant API
Adds API to allow usage of specialization constants in shaders.
Specialization constants are dynamic runtime constants which can
be compiled into a shader pipeline state object (PSO) to improve
runtime performance by reducing shader complexity through
shader compiler constant-folding.

This API allows specialization constant values to be specified
along with a default value if no constant value has been declared.
Each GPU backend is then responsible for caching PSO permutations
against the current specialization configuration.

This patch adds support for specialization constants in the
Metal backend and provides a generalised high-level solution
which can be adopted by other graphics APIs supporting
this feature.

Authored by Apple: Michael Parkin-White
Authored by Blender: Clément Foucault (files in gpu/test folder)

Pull Request: https://projects.blender.org/blender/blender/pulls/115193
2023-12-28 05:34:38 +01:00
Jason Fielder
62219f8da9 Metal: Re-enable workbench NEXT shadows
With the shift to GPU-driven rendering pipeline,
the SSBO vertex fetch paradigm used to
implement workbench shadows on Metal
instead of utilising the geometry shader
path no longer worked correctly.

This is because the draw submission
required vertex amplification up-front,
based on the expected output geometry
amount for a given input geometry.

This patch aims to resolve this
issue through addition of API to
enable the features within the
GPU driven pipeline.

Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/113498
2023-10-19 08:01:17 +02:00
Campbell Barton
e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Sergey Sharybin
c1bc70b711 Cleanup: Add a copyright notice to files and use SPDX format
A lot of files were missing copyright field in the header and
the Blender Foundation contributed to them in a sense of bug
fixing and general maintenance.

This change makes it explicit that those files are at least
partially copyrighted by the Blender Foundation.

Note that this does not make it so the Blender Foundation is
the only holder of the copyright in those files, and developers
who do not have a signed contract with the foundation still
hold the copyright as well.

Another aspect of this change is using SPDX format for the
header. We already used it for the license specification,
and now we state it for the copyright as well, following the
FAQ:

    https://reuse.software/faq/
2023-05-31 16:19:06 +02:00
Clément Foucault
e39c3c600c GPU: ShaderLog: Add more const correctness & notes supports
The metal shader compiler can produce `note` reports.
Treat them as warnings.
2023-05-04 10:59:26 +02:00
Jason Fielder
7b9d1cb51f Eevee: GPU Material node graph optimization.
Certain material node graphs can be very expensive to run. This feature aims to produce secondary GPUPass shaders within a GPUMaterial which provide optimal runtime performance. Such optimizations include baking constant data into the shader source directly, allowing the compiler to propogate constants and perform aggressive optimization upfront.

As optimizations can result in reduction of shader editor and animation interactivity, optimized pass generation and compilation is deferred until all outstanding compilations have completed. Optimization is also delayed util a material has remained unmodified for a set period of time, to reduce excessive compilation. The original variant of the material shader is kept to maintain interactivity.

Also adding a new concept to gpu::Shader allowing assignment of a parent shader from which a shader can pull PSO descriptors and any required metadata for asynchronous shader cache warming. This enables fully asynchronous shader optimization, without runtime hitching, while also reducing runtime hitching for standard materials, by using PSO descriptors from default materials, ahead of rendering.

Further shader graph optimizations are likely also possible with this architecture. Certain scenes, such as Wanderer benefit significantly. Viewport performance for this scene is 2-3x faster on Apple-silicon based GPUs.

Authored by Apple: Michael Parkin-White

Ref T96261
Pull Request #104536
2023-02-14 21:51:03 +01:00
Clément Foucault
158f87203e Cleanup: GPUShader: Reorganize GPU_shader.h to separate depecated API
This avoid confusion to what to use nowadays.
Also improves documentation.
2023-02-13 11:22:38 +01:00
Germano Cavalcante
6269d66da2 PyGPU: GPUShader: implementation of 'attrs_info_get' method
With the new `attrs_info_get` method, we can get information about
the attributes used in a `GPUShader` and thus have more freedom in the
automatic creation of `GPUVertFormat`s

Reviewed By: fclem, campbellbarton

Differential Revision: https://developer.blender.org/D15764
2022-09-01 08:25:55 -03:00
Campbell Barton
c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00
Clément Foucault
c017820692 GPUShader: Improve error/warning logging experience
Thanks to the new `ShaderCreateInfo` we now include source files without
any modification. This let us query which are the source files passed to the
`print_log` function. The log will now include a file with row and column
number which is interpreted as a link in most IDE.

DEBUG_CONTEXT_LINES will add more lines around the error lines for more
context. This is also useful if the error line is imprecise (because of
driver bugs) and the reported line is not sufficient to know the location
of the error.

The DEBUG_DEPENDENCIES option will display the list of included files in
the shader sources. Note that it will not print generated source.

This commit also fixes some issues with unhelpful logs, bogus row & column
numbers, other error format, and bug if row was 0.
2022-02-04 20:21:41 +01:00
Jeroen Bakker
3f42417cd4 Draw: Migrate hair refine compute shader to use create info.
This patch migrates the draw manager hair refine compute shader to use
GPUShaderCreateInfo.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D13915
2022-01-25 14:46:45 +01:00
Jeroen Bakker
9d3f35a0bf Revert "Revert "GPUShaderCreateInfo for interface abstraction""
This reverts commit edee5a947b.

Fixes compilation error (Missing file BLI_float2.hh)
2022-01-17 14:46:32 +01:00