Merge branch 'blender-v4.1-release'

This commit is contained in:
Campbell Barton
2024-02-15 21:22:52 +11:00
5 changed files with 40 additions and 5 deletions
+6 -5
View File
@@ -212,12 +212,13 @@ enum {
G_DEBUG_GPU = (1 << 16), /* gpu debug */
G_DEBUG_IO = (1 << 17), /* IO Debugging (for Collada, ...). */
G_DEBUG_GPU_FORCE_WORKAROUNDS = (1 << 18), /* force gpu workarounds bypassing detections. */
G_DEBUG_GPU_RENDERDOC = (1 << 19), /* Enable RenderDoc integration. */
G_DEBUG_XR = (1 << 20), /* XR/OpenXR messages */
G_DEBUG_XR_TIME = (1 << 21), /* XR/OpenXR timing messages */
G_DEBUG_GPU_COMPILE_SHADERS = (1 << 19), /* Compile all statically defined shaders. . */
G_DEBUG_GPU_RENDERDOC = (1 << 20), /* Enable RenderDoc integration. */
G_DEBUG_XR = (1 << 21), /* XR/OpenXR messages */
G_DEBUG_XR_TIME = (1 << 22), /* XR/OpenXR timing messages */
G_DEBUG_GHOST = (1 << 22), /* Debug GHOST module. */
G_DEBUG_WINTAB = (1 << 23), /* Debug Wintab. */
G_DEBUG_GHOST = (1 << 23), /* Debug GHOST module. */
G_DEBUG_WINTAB = (1 << 24), /* Debug Wintab. */
};
#define G_DEBUG_ALL \
+7
View File
@@ -332,6 +332,13 @@ typedef enum {
*/
int GPU_shader_get_builtin_uniform(GPUShader *shader, int builtin);
/**
* Compile all staticly defined shaders and print a report to the console.
*
* This is used for platform support, where bug reports can list all failing shaders.
*/
void GPU_shader_compile_static();
/** DEPRECATED: Use hardcoded buffer location instead. */
typedef enum {
GPU_UNIFORM_BLOCK_VIEW = 0, /* viewBlock */
+6
View File
@@ -447,6 +447,12 @@ GPUShader *GPU_shader_create_from_python(const char *vertcode,
return sh;
}
void GPU_shader_compile_static()
{
printf("Compiling all static GPU shaders. This process takes a while.\n");
gpu_shader_create_info_compile("");
}
/** \} */
/* -------------------------------------------------------------------- */
@@ -159,6 +159,10 @@ void WM_init_gpu()
GPU_pass_cache_init();
if (G.debug & G_DEBUG_GPU_COMPILE_SHADERS) {
GPU_shader_compile_static();
}
gpu_is_init = true;
}
+17
View File
@@ -658,6 +658,7 @@ static void print_help(bArgs *ba, bool all)
BLI_args_print_arg_doc(ba, "--debug-wintab");
BLI_args_print_arg_doc(ba, "--debug-gpu");
BLI_args_print_arg_doc(ba, "--debug-gpu-force-workarounds");
BLI_args_print_arg_doc(ba, "--debug-gpu-compile-shaders");
if (defs.with_renderdoc) {
BLI_args_print_arg_doc(ba, "--debug-gpu-renderdoc");
}
@@ -1224,6 +1225,17 @@ static int arg_handle_debug_gpu_set(int /*argc*/, const char ** /*argv*/, void *
return 0;
}
static const char arg_handle_debug_gpu_compile_shaders_set_doc[] =
"\n"
"\tCompile all staticly defined shaders to test platform compatibility.";
static int arg_handle_debug_gpu_compile_shaders_set(int /*argc*/,
const char ** /*argv*/,
void * /*data*/)
{
G.debug |= G_DEBUG_GPU_COMPILE_SHADERS;
return 0;
}
static const char arg_handle_debug_gpu_renderdoc_set_doc[] =
"\n"
"\tEnable Renderdoc integration for GPU frame grabbing and debugging.";
@@ -2438,6 +2450,11 @@ void main_args_setup(bContext *C, bArgs *ba, bool all)
CB_EX(arg_handle_debug_mode_generic_set, jobs),
(void *)G_DEBUG_JOBS);
BLI_args_add(ba, nullptr, "--debug-gpu", CB(arg_handle_debug_gpu_set), nullptr);
BLI_args_add(ba,
nullptr,
"--debug-gpu-compile-shaders",
CB(arg_handle_debug_gpu_compile_shaders_set),
nullptr);
if (defs.with_renderdoc) {
BLI_args_add(
ba, nullptr, "--debug-gpu-renderdoc", CB(arg_handle_debug_gpu_renderdoc_set), nullptr);