2022-02-11 09:07:11 +11:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
* Copyright 2020 Blender Foundation. All rights reserved. */
|
2020-09-07 18:52:30 +02:00
|
|
|
|
|
|
|
|
/** \file
|
|
|
|
|
* \ingroup gpu
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "GPU_platform.h"
|
|
|
|
|
|
|
|
|
|
namespace blender::gpu {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This includes both hardware capabilities & workarounds.
|
2022-01-20 11:55:33 +11:00
|
|
|
* Try to limit these to the implementation code-base (i.e.: `gpu/opengl/`).
|
2020-09-07 18:52:30 +02:00
|
|
|
* Only add workarounds here if they are common to all implementation or
|
|
|
|
|
* if you need access to it outside of the GPU module.
|
2022-01-20 11:55:33 +11:00
|
|
|
* Same goes for capabilities (i.e.: texture size).
|
2021-01-04 12:00:18 +11:00
|
|
|
*/
|
2020-09-07 18:52:30 +02:00
|
|
|
struct GPUCapabilities {
|
|
|
|
|
int max_texture_size = 0;
|
2022-03-22 12:38:28 +01:00
|
|
|
int max_texture_3d_size = 0;
|
2020-09-07 18:52:30 +02:00
|
|
|
int max_texture_layers = 0;
|
|
|
|
|
int max_textures = 0;
|
|
|
|
|
int max_textures_vert = 0;
|
|
|
|
|
int max_textures_geom = 0;
|
|
|
|
|
int max_textures_frag = 0;
|
2022-03-22 12:38:28 +01:00
|
|
|
int max_samplers = 0;
|
2021-05-28 08:16:26 +02:00
|
|
|
int max_work_group_count[3] = {0, 0, 0};
|
|
|
|
|
int max_work_group_size[3] = {0, 0, 0};
|
2021-05-14 11:15:00 -03:00
|
|
|
int max_uniforms_vert = 0;
|
|
|
|
|
int max_uniforms_frag = 0;
|
|
|
|
|
int max_batch_indices = 0;
|
|
|
|
|
int max_batch_vertices = 0;
|
|
|
|
|
int max_vertex_attribs = 0;
|
|
|
|
|
int max_varying_floats = 0;
|
2022-03-15 16:04:41 +01:00
|
|
|
int max_shader_storage_buffer_bindings = 0;
|
2022-05-11 15:19:10 +02:00
|
|
|
int max_compute_shader_storage_blocks = 0;
|
2021-05-14 11:15:00 -03:00
|
|
|
int extensions_len = 0;
|
|
|
|
|
const char *(*extension_get)(int);
|
|
|
|
|
|
2020-09-07 19:53:48 +02:00
|
|
|
bool mem_stats_support = false;
|
2021-05-26 16:49:17 +02:00
|
|
|
bool compute_shader_support = false;
|
|
|
|
|
bool shader_storage_buffer_objects_support = false;
|
2020-09-12 06:10:11 +02:00
|
|
|
bool shader_image_load_store_support = false;
|
2022-03-22 12:38:28 +01:00
|
|
|
bool transform_feedback_support = false;
|
|
|
|
|
|
2020-09-07 18:52:30 +02:00
|
|
|
/* OpenGL related workarounds. */
|
|
|
|
|
bool mip_render_workaround = false;
|
|
|
|
|
bool depth_blitting_workaround = false;
|
|
|
|
|
bool use_main_context_workaround = false;
|
|
|
|
|
bool broken_amd_driver = false;
|
2021-01-04 11:41:54 +01:00
|
|
|
bool use_hq_normals_workaround = false;
|
2022-05-10 08:10:46 +02:00
|
|
|
bool clear_viewport_workaround = false;
|
2020-09-07 19:53:48 +02:00
|
|
|
/* Vulkan related workarounds. */
|
2022-03-22 12:38:28 +01:00
|
|
|
|
|
|
|
|
/* Metal related workarounds. */
|
|
|
|
|
/* Minimum per-vertex stride in bytes (For a vertex buffer). */
|
|
|
|
|
int minimum_per_vertex_stride = 1;
|
2020-09-07 18:52:30 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
extern GPUCapabilities GCaps;
|
|
|
|
|
|
2020-09-12 06:10:11 +02:00
|
|
|
} // namespace blender::gpu
|