GPU: Remove GPU_compute_shader_support #120909
|
@ -210,12 +210,6 @@ def write_sysinfo(filepath):
|
|||
output.write("Maximum Pipeline Image Units:\t%d\n" % gpu.capabilities.max_textures_get())
|
||||
output.write("Maximum Image Units:\t%d\n" % gpu.capabilities.max_images_get())
|
||||
|
||||
output.write("\nFeatures:\n")
|
||||
output.write("Compute Shader Support: \t%d\n" %
|
||||
gpu.capabilities.compute_shader_support_get())
|
||||
output.write("Image Load/Store Support: \t%d\n" %
|
||||
gpu.capabilities.shader_image_load_store_support_get())
|
||||
|
||||
if bpy.app.build_options.cycles:
|
||||
import cycles
|
||||
output.write(title("Cycles"))
|
||||
|
|
|
@ -6913,16 +6913,8 @@ class VIEW3D_PT_shading_compositor(Panel):
|
|||
|
||||
def draw(self, context):
|
||||
shading = context.space_data.shading
|
||||
|
||||
import gpu
|
||||
is_supported = (gpu.capabilities.compute_shader_support_get()
|
||||
and gpu.capabilities.shader_image_load_store_support_get())
|
||||
|
||||
row = self.layout.row()
|
||||
row.active = is_supported
|
||||
row.prop(shading, "use_compositor", expand=True)
|
||||
if shading.use_compositor != 'DISABLED' and not is_supported:
|
||||
self.layout.label(text="Compositor not supported on this platform", icon='ERROR')
|
||||
|
||||
|
||||
class VIEW3D_PT_gizmo_display(Panel):
|
||||
|
|
|
@ -101,10 +101,6 @@ static bool is_subdivision_evaluation_possible_on_gpu()
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!GPU_compute_shader_support()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (GPU_max_compute_shader_storage_blocks() < MAX_GPU_SUBDIV_SSBOS) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -97,12 +97,7 @@ void DRW_curves_init(DRWData *drw_data)
|
|||
CurvesUniformBufPool *pool = drw_data->curves_ubos;
|
||||
pool->reset();
|
||||
|
||||
if (GPU_transform_feedback_support() || GPU_compute_shader_support()) {
|
||||
g_tf_pass = DRW_pass_create("Update Curves Pass", (DRWState)0);
|
||||
}
|
||||
else {
|
||||
g_tf_pass = DRW_pass_create("Update Curves Pass", DRW_STATE_WRITE_COLOR);
|
||||
}
|
||||
g_tf_pass = DRW_pass_create("Update Curves Pass", (DRWState)0);
|
||||
|
||||
drw_curves_ensure_dummy_vbo();
|
||||
}
|
||||
|
|
|
@ -72,12 +72,7 @@ static void drw_hair_ensure_vbo()
|
|||
|
||||
void DRW_hair_init()
|
||||
{
|
||||
if (GPU_transform_feedback_support() || GPU_compute_shader_support()) {
|
||||
g_tf_pass = DRW_pass_create("Update Hair Pass", DRW_STATE_NO_DRAW);
|
||||
}
|
||||
else {
|
||||
g_tf_pass = DRW_pass_create("Update Hair Pass", DRW_STATE_WRITE_COLOR);
|
||||
}
|
||||
g_tf_pass = DRW_pass_create("Update Hair Pass", DRW_STATE_NO_DRAW);
|
||||
|
||||
drw_hair_ensure_vbo();
|
||||
}
|
||||
|
|
|
@ -1101,29 +1101,21 @@ void DRW_shgroup_call_compute(DRWShadingGroup *shgroup,
|
|||
int groups_z_len)
|
||||
{
|
||||
BLI_assert(groups_x_len > 0 && groups_y_len > 0 && groups_z_len > 0);
|
||||
BLI_assert(GPU_compute_shader_support());
|
||||
|
||||
drw_command_compute(shgroup, groups_x_len, groups_y_len, groups_z_len);
|
||||
}
|
||||
|
||||
void DRW_shgroup_call_compute_ref(DRWShadingGroup *shgroup, int groups_ref[3])
|
||||
{
|
||||
BLI_assert(GPU_compute_shader_support());
|
||||
|
||||
drw_command_compute_ref(shgroup, groups_ref);
|
||||
}
|
||||
|
||||
void DRW_shgroup_call_compute_indirect(DRWShadingGroup *shgroup, GPUStorageBuf *indirect_buf)
|
||||
{
|
||||
BLI_assert(GPU_compute_shader_support());
|
||||
|
||||
drw_command_compute_indirect(shgroup, indirect_buf);
|
||||
}
|
||||
|
||||
void DRW_shgroup_barrier(DRWShadingGroup *shgroup, eGPUBarrier type)
|
||||
{
|
||||
BLI_assert(GPU_compute_shader_support());
|
||||
|
||||
drw_command_barrier(shgroup, type);
|
||||
}
|
||||
|
||||
|
|
|
@ -42,10 +42,7 @@ struct DRWViewData {
|
|||
|
||||
DRWViewData()
|
||||
{
|
||||
/* Only for GL >= 4.3 implementation for now. */
|
||||
if (GPU_compute_shader_support()) {
|
||||
manager = new draw::Manager();
|
||||
}
|
||||
manager = new draw::Manager();
|
||||
};
|
||||
|
||||
~DRWViewData()
|
||||
|
|
|
@ -48,7 +48,6 @@ bool GPU_clear_viewport_workaround();
|
|||
bool GPU_crappy_amd_driver();
|
||||
|
||||
bool GPU_geometry_shader_support();
|
||||
bool GPU_compute_shader_support();
|
||||
bool GPU_shader_draw_parameters_support();
|
||||
bool GPU_hdr_support();
|
||||
bool GPU_texture_view_support();
|
||||
|
|
|
@ -162,11 +162,6 @@ bool GPU_clear_viewport_workaround()
|
|||
return GCaps.clear_viewport_workaround;
|
||||
}
|
||||
|
||||
bool GPU_compute_shader_support()
|
||||
{
|
||||
return GCaps.compute_shader_support;
|
||||
}
|
||||
|
||||
bool GPU_geometry_shader_support()
|
||||
{
|
||||
return GCaps.geometry_shader_support;
|
||||
|
|
|
@ -44,7 +44,6 @@ struct GPUCapabilities {
|
|||
const char *(*extension_get)(int);
|
||||
|
||||
bool mem_stats_support = false;
|
||||
bool compute_shader_support = false;
|
||||
bool geometry_shader_support = false;
|
||||
bool shader_draw_parameters_support = false;
|
||||
bool transform_feedback_support = false;
|
||||
|
|
|
@ -606,7 +606,6 @@ bool gpu_shader_create_info_compile(const char *name_starts_with_filter)
|
|||
continue;
|
||||
}
|
||||
if ((info->metal_backend_only_ && GPU_backend_get_type() != GPU_BACKEND_METAL) ||
|
||||
(GPU_compute_shader_support() == false && info->compute_source_ != nullptr) ||
|
||||
(GPU_geometry_shader_support() == false && info->geometry_source_ != nullptr) ||
|
||||
(GPU_transform_feedback_support() == false && info->tf_type_ != GPU_SHADER_TFB_NONE))
|
||||
{
|
||||
|
|
|
@ -427,7 +427,6 @@ void MTLBackend::capabilities_init(MTLContext *ctx)
|
|||
|
||||
/* Feature support */
|
||||
GCaps.mem_stats_support = false;
|
||||
GCaps.compute_shader_support = true;
|
||||
GCaps.shader_draw_parameters_support = true;
|
||||
GCaps.hdr_viewport_support = true;
|
||||
|
||||
|
@ -438,21 +437,18 @@ void MTLBackend::capabilities_init(MTLContext *ctx)
|
|||
GCaps.max_shader_storage_buffer_bindings = 14;
|
||||
GCaps.max_storage_buffer_size = size_t(ctx->device.maxBufferLength);
|
||||
|
||||
if (GCaps.compute_shader_support) {
|
||||
GCaps.max_work_group_count[0] = 65535;
|
||||
GCaps.max_work_group_count[1] = 65535;
|
||||
GCaps.max_work_group_count[2] = 65535;
|
||||
|
||||
/* In Metal, total_thread_count is 512 or 1024, such that
|
||||
* threadgroup `width*height*depth <= total_thread_count` */
|
||||
uint max_threads_per_threadgroup_per_dim = ([device supportsFamily:MTLGPUFamilyApple4] ||
|
||||
MTLBackend::capabilities.supports_family_mac1) ?
|
||||
1024 :
|
||||
512;
|
||||
GCaps.max_work_group_size[0] = max_threads_per_threadgroup_per_dim;
|
||||
GCaps.max_work_group_size[1] = max_threads_per_threadgroup_per_dim;
|
||||
GCaps.max_work_group_size[2] = max_threads_per_threadgroup_per_dim;
|
||||
}
|
||||
GCaps.max_work_group_count[0] = 65535;
|
||||
GCaps.max_work_group_count[1] = 65535;
|
||||
GCaps.max_work_group_count[2] = 65535;
|
||||
/* In Metal, total_thread_count is 512 or 1024, such that
|
||||
* threadgroup `width*height*depth <= total_thread_count` */
|
||||
uint max_threads_per_threadgroup_per_dim = ([device supportsFamily:MTLGPUFamilyApple4] ||
|
||||
MTLBackend::capabilities.supports_family_mac1) ?
|
||||
1024 :
|
||||
512;
|
||||
GCaps.max_work_group_size[0] = max_threads_per_threadgroup_per_dim;
|
||||
GCaps.max_work_group_size[1] = max_threads_per_threadgroup_per_dim;
|
||||
GCaps.max_work_group_size[2] = max_threads_per_threadgroup_per_dim;
|
||||
|
||||
GCaps.transform_feedback_support = true;
|
||||
GCaps.stencil_export_support = true;
|
||||
|
|
|
@ -202,6 +202,13 @@ void GLBackend::platform_init()
|
|||
}
|
||||
}
|
||||
|
||||
/* Compute shaders have some issues with those versions (see #94936). */
|
||||
if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_ANY, GPU_DRIVER_OFFICIAL) &&
|
||||
(strstr(version, "4.5.14831") || strstr(version, "4.5.14760")))
|
||||
{
|
||||
support_level = GPU_SUPPORT_LEVEL_UNSUPPORTED;
|
||||
}
|
||||
|
||||
GPG.init(device,
|
||||
os,
|
||||
driver,
|
||||
|
@ -345,12 +352,6 @@ static void detect_workarounds()
|
|||
GCaps.shader_draw_parameters_support = false;
|
||||
GCaps.broken_amd_driver = true;
|
||||
}
|
||||
/* Compute shaders have some issues with those versions (see #94936). */
|
||||
if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_ANY, GPU_DRIVER_OFFICIAL) &&
|
||||
(strstr(version, "4.5.14831") || strstr(version, "4.5.14760")))
|
||||
{
|
||||
GCaps.compute_shader_support = false;
|
||||
}
|
||||
/* We have issues with this specific renderer. (see #74024) */
|
||||
if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_UNIX, GPU_DRIVER_OPENSOURCE) &&
|
||||
(strstr(renderer, "AMD VERDE") || strstr(renderer, "AMD KAVERI") ||
|
||||
|
@ -526,26 +527,22 @@ void GLBackend::capabilities_init()
|
|||
GCaps.mem_stats_support = epoxy_has_gl_extension("GL_NVX_gpu_memory_info") ||
|
||||
epoxy_has_gl_extension("GL_ATI_meminfo");
|
||||
GCaps.shader_draw_parameters_support = epoxy_has_gl_extension("GL_ARB_shader_draw_parameters");
|
||||
GCaps.compute_shader_support = epoxy_has_gl_extension("GL_ARB_compute_shader") &&
|
||||
epoxy_gl_version() >= 43;
|
||||
GCaps.geometry_shader_support = true;
|
||||
GCaps.max_samplers = GCaps.max_textures;
|
||||
GCaps.hdr_viewport_support = false;
|
||||
|
||||
if (GCaps.compute_shader_support) {
|
||||
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 0, &GCaps.max_work_group_count[0]);
|
||||
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 1, &GCaps.max_work_group_count[1]);
|
||||
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 2, &GCaps.max_work_group_count[2]);
|
||||
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 0, &GCaps.max_work_group_size[0]);
|
||||
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 1, &GCaps.max_work_group_size[1]);
|
||||
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 2, &GCaps.max_work_group_size[2]);
|
||||
glGetIntegerv(GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS,
|
||||
&GCaps.max_shader_storage_buffer_bindings);
|
||||
glGetIntegerv(GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS, &GCaps.max_compute_shader_storage_blocks);
|
||||
int64_t max_ssbo_size;
|
||||
glGetInteger64v(GL_MAX_SHADER_STORAGE_BLOCK_SIZE, &max_ssbo_size);
|
||||
GCaps.max_storage_buffer_size = size_t(max_ssbo_size);
|
||||
}
|
||||
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 0, &GCaps.max_work_group_count[0]);
|
||||
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 1, &GCaps.max_work_group_count[1]);
|
||||
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 2, &GCaps.max_work_group_count[2]);
|
||||
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 0, &GCaps.max_work_group_size[0]);
|
||||
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 1, &GCaps.max_work_group_size[1]);
|
||||
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 2, &GCaps.max_work_group_size[2]);
|
||||
glGetIntegerv(GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, &GCaps.max_shader_storage_buffer_bindings);
|
||||
glGetIntegerv(GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS, &GCaps.max_compute_shader_storage_blocks);
|
||||
int64_t max_ssbo_size;
|
||||
glGetInteger64v(GL_MAX_SHADER_STORAGE_BLOCK_SIZE, &max_ssbo_size);
|
||||
GCaps.max_storage_buffer_size = size_t(max_ssbo_size);
|
||||
|
||||
GCaps.transform_feedback_support = true;
|
||||
GCaps.texture_view_support = epoxy_gl_version() >= 43 ||
|
||||
epoxy_has_gl_extension("GL_ARB_texture_view");
|
||||
|
|
|
@ -255,7 +255,6 @@ void VKBackend::capabilities_init(VKDevice &device)
|
|||
|
||||
/* Reset all capabilities from previous context. */
|
||||
GCaps = {};
|
||||
GCaps.compute_shader_support = true;
|
||||
GCaps.geometry_shader_support = true;
|
||||
GCaps.shader_draw_parameters_support =
|
||||
device.physical_device_vulkan_11_features_get().shaderDrawParameters;
|
||||
|
|
|
@ -245,7 +245,16 @@ PyDoc_STRVAR(
|
|||
" :rtype: bool\n");
|
||||
static PyObject *pygpu_compute_shader_support_get(PyObject * /*self*/)
|
||||
{
|
||||
return PyBool_FromLong(GPU_compute_shader_support());
|
||||
static bool deprecation_warning_issued = false;
|
||||
if (!deprecation_warning_issued) {
|
||||
PyErr_WarnEx(PyExc_DeprecationWarning,
|
||||
"compute_shader_support_get is deprecated. All platforms have support for "
|
||||
"compute shaders.",
|
||||
1);
|
||||
deprecation_warning_issued = true;
|
||||
}
|
||||
|
||||
return PyBool_FromLong(true);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(
|
||||
|
@ -259,6 +268,15 @@ PyDoc_STRVAR(
|
|||
" :rtype: bool\n");
|
||||
static PyObject *pygpu_shader_image_load_store_support_get(PyObject * /*self*/)
|
||||
{
|
||||
static bool deprecation_warning_issued = false;
|
||||
if (!deprecation_warning_issued) {
|
||||
PyErr_WarnEx(
|
||||
PyExc_DeprecationWarning,
|
||||
"shader_image_load_store_support_get is deprecated. All platforms have support for "
|
||||
"image load store.",
|
||||
1);
|
||||
deprecation_warning_issued = true;
|
||||
}
|
||||
/* Now required to start Blender. */
|
||||
return PyBool_FromLong(true);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue