Merge branch 'blender-v4.4-release'
This commit is contained in:
@@ -2543,7 +2543,7 @@ enum {
|
||||
};
|
||||
|
||||
struct ImageNewData {
|
||||
PropertyPointerRNA pprop;
|
||||
PropertyPointerRNA pprop = {};
|
||||
};
|
||||
|
||||
static ImageNewData *image_new_init(bContext *C, wmOperator *op)
|
||||
@@ -2552,7 +2552,7 @@ static ImageNewData *image_new_init(bContext *C, wmOperator *op)
|
||||
return static_cast<ImageNewData *>(op->customdata);
|
||||
}
|
||||
|
||||
ImageNewData *data = static_cast<ImageNewData *>(MEM_callocN(sizeof(ImageNewData), __func__));
|
||||
ImageNewData *data = MEM_new<ImageNewData>(__func__);
|
||||
UI_context_active_but_prop_get_templateID(C, &data->pprop.ptr, &data->pprop.prop);
|
||||
op->customdata = data;
|
||||
return data;
|
||||
@@ -2560,7 +2560,9 @@ static ImageNewData *image_new_init(bContext *C, wmOperator *op)
|
||||
|
||||
static void image_new_free(wmOperator *op)
|
||||
{
|
||||
MEM_SAFE_FREE(op->customdata);
|
||||
if (op->customdata) {
|
||||
MEM_delete(static_cast<ImageNewData *>(op->customdata));
|
||||
}
|
||||
}
|
||||
|
||||
static int image_new_exec(bContext *C, wmOperator *op)
|
||||
@@ -2656,7 +2658,7 @@ static int image_new_invoke(bContext *C, wmOperator *op, const wmEvent * /*event
|
||||
{
|
||||
/* Get property in advance, it doesn't work after WM_operator_props_dialog_popup. */
|
||||
ImageNewData *data;
|
||||
op->customdata = data = static_cast<ImageNewData *>(MEM_callocN(sizeof(ImageNewData), __func__));
|
||||
op->customdata = data = MEM_new<ImageNewData>(__func__);
|
||||
UI_context_active_but_prop_get_templateID(C, &data->pprop.ptr, &data->pprop.prop);
|
||||
|
||||
/* Better for user feedback. */
|
||||
|
||||
@@ -331,9 +331,18 @@ GPUShader *GPU_shader_create_from_python(std::optional<StringRefNull> vertcode,
|
||||
std::optional<StringRefNull> fragcode,
|
||||
std::optional<StringRefNull> geomcode,
|
||||
std::optional<StringRefNull> libcode,
|
||||
const std::optional<StringRefNull> defines,
|
||||
std::optional<StringRefNull> defines,
|
||||
const std::optional<StringRefNull> name)
|
||||
{
|
||||
std::string defines_cat = "#define GPU_RAW_PYTHON_SHADER\n";
|
||||
if (defines) {
|
||||
defines_cat += defines.value();
|
||||
defines = defines_cat;
|
||||
}
|
||||
else {
|
||||
defines = defines_cat;
|
||||
}
|
||||
|
||||
std::string libcodecat;
|
||||
|
||||
if (!libcode) {
|
||||
|
||||
@@ -11,6 +11,13 @@ SHADER_LIBRARY_CREATE_INFO(gpu_srgb_to_framebuffer_space)
|
||||
/* Undefine the macro that avoids compilation errors. */
|
||||
#undef blender_srgb_to_framebuffer_space
|
||||
|
||||
/* Raw python shaders don't have create infos and thus don't generate the needed `srgbTarget`
|
||||
* uniform automatically. For API compatibility, we sill define this loose uniform, but it will
|
||||
* not be parsed by the Metal or Vulkan backend. */
|
||||
#ifdef GPU_RAW_PYTHON_SHADER
|
||||
uniform bool srgbTarget = false;
|
||||
#endif
|
||||
|
||||
vec4 blender_srgb_to_framebuffer_space(vec4 in_color)
|
||||
{
|
||||
if (srgbTarget) {
|
||||
|
||||
@@ -99,7 +99,7 @@ struct PointerRNA {
|
||||
extern const PointerRNA PointerRNA_NULL;
|
||||
|
||||
struct PropertyPointerRNA {
|
||||
PointerRNA ptr;
|
||||
PointerRNA ptr = {};
|
||||
PropertyRNA *prop = nullptr;
|
||||
};
|
||||
|
||||
@@ -107,10 +107,10 @@ struct PropertyPointerRNA {
|
||||
* Stored result of a RNA path lookup (as used by anim-system)
|
||||
*/
|
||||
struct PathResolvedRNA {
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
PointerRNA ptr = {};
|
||||
PropertyRNA *prop = nullptr;
|
||||
/** -1 for non-array access. */
|
||||
int prop_index;
|
||||
int prop_index = -1;
|
||||
};
|
||||
|
||||
/* Property */
|
||||
|
||||
Reference in New Issue
Block a user