Grey out high quality depth of field when it's not supported by GPU

This commit is contained in:
Antony Riakiotakis
2015-03-30 12:47:37 +02:00
parent 01e0062b4c
commit bfe63bbfc4
3 changed files with 24 additions and 5 deletions

View File

@@ -45,6 +45,8 @@
#include "BKE_paint.h"
#include "BKE_scene.h"
#include "GPU_extensions.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
@@ -1758,6 +1760,11 @@ static void rna_GPUDOFSettings_blades_set(PointerRNA *ptr, const int value)
}
static int rna_gpu_is_hq_supported_get(PointerRNA *UNUSED(ptr))
{
return GPU_instanced_drawing_support() && GPU_geometry_shader_support();
}
#else
static void rna_def_transform_orientation(BlenderRNA *brna)
@@ -3947,6 +3954,12 @@ static void rna_def_gpu_dof_fx(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "high_quality", 1);
RNA_def_property_ui_text(prop, "High Quality", "Use high quality depth of field");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
prop = RNA_def_property(srna, "is_hq_supported", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_gpu_is_hq_supported_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "High Quality", "Use high quality depth of field");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
}
static void rna_def_gpu_ssao_fx(BlenderRNA *brna)