diff options
Diffstat (limited to 'source/blender')
11 files changed, 64 insertions, 86 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_depth_of_field.c b/source/blender/draw/engines/eevee/eevee_depth_of_field.c index 25d256e86b3..ae8e7614302 100644 --- a/source/blender/draw/engines/eevee/eevee_depth_of_field.c +++ b/source/blender/draw/engines/eevee/eevee_depth_of_field.c @@ -202,7 +202,7 @@ void EEVEE_depth_of_field_cache_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_ struct GPUBatch *quad = DRW_cache_fullscreen_quad_get(); const bool use_alpha = !DRW_state_draw_background(); - psl->dof_down = DRW_pass_create("DoF Downsample", DRW_STATE_WRITE_COLOR); + DRW_PASS_CREATE(psl->dof_down, DRW_STATE_WRITE_COLOR); grp = DRW_shgroup_create(e_data.dof_downsample_sh[use_alpha], psl->dof_down); DRW_shgroup_uniform_texture_ref(grp, "colorBuffer", &effects->source_buffer); @@ -211,8 +211,7 @@ void EEVEE_depth_of_field_cache_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_ DRW_shgroup_uniform_vec2(grp, "dofParams", effects->dof_params, 1); DRW_shgroup_call(grp, quad, NULL); - psl->dof_scatter = DRW_pass_create("DoF Scatter", - DRW_STATE_WRITE_COLOR | DRW_STATE_ADDITIVE_FULL); + DRW_PASS_CREATE(psl->dof_scatter, DRW_STATE_WRITE_COLOR | DRW_STATE_ADDITIVE_FULL); /* This create an empty batch of N triangles to be positioned * by the vertex shader 0.4ms against 6ms with instancing */ @@ -227,7 +226,7 @@ void EEVEE_depth_of_field_cache_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_ DRW_shgroup_call_procedural_triangles(grp, sprite_len, NULL); - psl->dof_resolve = DRW_pass_create("DoF Resolve", DRW_STATE_WRITE_COLOR); + DRW_PASS_CREATE(psl->dof_resolve, DRW_STATE_WRITE_COLOR); grp = DRW_shgroup_create(e_data.dof_resolve_sh[use_alpha], psl->dof_resolve); DRW_shgroup_uniform_texture_ref(grp, "scatterBuffer", &effects->dof_blur); diff --git a/source/blender/draw/engines/eevee/eevee_effects.c b/source/blender/draw/engines/eevee/eevee_effects.c index 79569216399..8a85c6671fd 100644 --- a/source/blender/draw/engines/eevee/eevee_effects.c +++ b/source/blender/draw/engines/eevee/eevee_effects.c @@ -277,7 +277,8 @@ void EEVEE_effects_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) EEVEE_TextureList *txl = vedata->txl; EEVEE_StorageList *stl = vedata->stl; EEVEE_EffectsInfo *effects = stl->effects; - int downsample_write = DRW_STATE_WRITE_DEPTH; + DRWState downsample_write = DRW_STATE_WRITE_DEPTH; + DRWShadingGroup *grp; /* Intel gpu seems to have problem rendering to only depth format. * Use color texture instead. */ @@ -288,17 +289,16 @@ void EEVEE_effects_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) struct GPUBatch *quad = DRW_cache_fullscreen_quad_get(); { - psl->color_downsample_ps = DRW_pass_create("Downsample", DRW_STATE_WRITE_COLOR); - DRWShadingGroup *grp = DRW_shgroup_create(e_data.downsample_sh, psl->color_downsample_ps); + DRW_PASS_CREATE(psl->color_downsample_ps, DRW_STATE_WRITE_COLOR); + grp = DRW_shgroup_create(e_data.downsample_sh, psl->color_downsample_ps); DRW_shgroup_uniform_texture_ref(grp, "source", &e_data.color_src); DRW_shgroup_uniform_float(grp, "fireflyFactor", &sldata->common_data.ssr_firefly_fac, 1); DRW_shgroup_call(grp, quad, NULL); } { - psl->color_downsample_cube_ps = DRW_pass_create("Downsample Cube", DRW_STATE_WRITE_COLOR); - DRWShadingGroup *grp = DRW_shgroup_create(e_data.downsample_cube_sh, - psl->color_downsample_cube_ps); + DRW_PASS_CREATE(psl->color_downsample_cube_ps, DRW_STATE_WRITE_COLOR); + grp = DRW_shgroup_create(e_data.downsample_cube_sh, psl->color_downsample_cube_ps); DRW_shgroup_uniform_texture_ref(grp, "source", &e_data.color_src); DRW_shgroup_uniform_float(grp, "texelSize", &e_data.cube_texel_size, 1); DRW_shgroup_uniform_int_copy(grp, "Layer", 0); @@ -307,37 +307,30 @@ void EEVEE_effects_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) { /* Perform min/max downsample */ - DRWShadingGroup *grp; - - psl->maxz_downlevel_ps = DRW_pass_create("HiZ Max Down Level", - downsample_write | DRW_STATE_DEPTH_ALWAYS); + DRW_PASS_CREATE(psl->maxz_downlevel_ps, downsample_write | DRW_STATE_DEPTH_ALWAYS); grp = DRW_shgroup_create(e_data.maxz_downlevel_sh, psl->maxz_downlevel_ps); DRW_shgroup_uniform_texture_ref(grp, "depthBuffer", &txl->maxzbuffer); DRW_shgroup_call(grp, quad, NULL); /* Copy depth buffer to halfres top level of HiZ */ - psl->maxz_downdepth_ps = DRW_pass_create("HiZ Max Copy Depth Halfres", - downsample_write | DRW_STATE_DEPTH_ALWAYS); + DRW_PASS_CREATE(psl->maxz_downdepth_ps, downsample_write | DRW_STATE_DEPTH_ALWAYS); grp = DRW_shgroup_create(e_data.maxz_downdepth_sh, psl->maxz_downdepth_ps); DRW_shgroup_uniform_texture_ref(grp, "depthBuffer", &e_data.depth_src); DRW_shgroup_call(grp, quad, NULL); - psl->maxz_downdepth_layer_ps = DRW_pass_create("HiZ Max Copy DepthLayer Halfres", - downsample_write | DRW_STATE_DEPTH_ALWAYS); + DRW_PASS_CREATE(psl->maxz_downdepth_layer_ps, downsample_write | DRW_STATE_DEPTH_ALWAYS); grp = DRW_shgroup_create(e_data.maxz_downdepth_layer_sh, psl->maxz_downdepth_layer_ps); DRW_shgroup_uniform_texture_ref(grp, "depthBuffer", &e_data.depth_src); DRW_shgroup_uniform_int(grp, "depthLayer", &e_data.depth_src_layer, 1); DRW_shgroup_call(grp, quad, NULL); - psl->maxz_copydepth_ps = DRW_pass_create("HiZ Max Copy Depth Fullres", - downsample_write | DRW_STATE_DEPTH_ALWAYS); + DRW_PASS_CREATE(psl->maxz_copydepth_ps, downsample_write | DRW_STATE_DEPTH_ALWAYS); grp = DRW_shgroup_create(e_data.maxz_copydepth_sh, psl->maxz_copydepth_ps); DRW_shgroup_uniform_texture_ref(grp, "depthBuffer", &e_data.depth_src); DRW_shgroup_call(grp, quad, NULL); - psl->maxz_copydepth_layer_ps = DRW_pass_create("HiZ Max Copy DepthLayer Halfres", - downsample_write | DRW_STATE_DEPTH_ALWAYS); + DRW_PASS_CREATE(psl->maxz_copydepth_layer_ps, downsample_write | DRW_STATE_DEPTH_ALWAYS); grp = DRW_shgroup_create(e_data.maxz_copydepth_layer_sh, psl->maxz_copydepth_layer_ps); DRW_shgroup_uniform_texture_ref(grp, "depthBuffer", &e_data.depth_src); DRW_shgroup_uniform_int(grp, "depthLayer", &e_data.depth_src_layer, 1); @@ -346,9 +339,8 @@ void EEVEE_effects_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) if ((effects->enabled_effects & EFFECT_VELOCITY_BUFFER) != 0) { /* This pass compute camera motions to the non moving objects. */ - psl->velocity_resolve = DRW_pass_create("Velocity Resolve", DRW_STATE_WRITE_COLOR); - DRWShadingGroup *grp = DRW_shgroup_create(EEVEE_shaders_velocity_resolve_sh_get(), - psl->velocity_resolve); + DRW_PASS_CREATE(psl->velocity_resolve, DRW_STATE_WRITE_COLOR); + grp = DRW_shgroup_create(EEVEE_shaders_velocity_resolve_sh_get(), psl->velocity_resolve); DRW_shgroup_uniform_texture_ref(grp, "depthBuffer", &e_data.depth_src); DRW_shgroup_uniform_block(grp, "common_block", sldata->common_ubo); DRW_shgroup_uniform_mat4(grp, "currPersinv", effects->velocity_curr_persinv); @@ -357,16 +349,13 @@ void EEVEE_effects_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) } if ((effects->enabled_effects & EFFECT_ALPHA_CHECKER) != 0) { - psl->alpha_checker = DRW_pass_create("Alpha Checker", - DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND_PREMUL_UNDER); - GPUShader *checker_sh = GPU_shader_get_builtin_shader(GPU_SHADER_2D_CHECKER); - DRWShadingGroup *grp = DRW_shgroup_create(checker_sh, psl->alpha_checker); - copy_v4_fl4(effects->color_checker_dark, 0.15f, 0.15f, 0.15f, 1.0f); copy_v4_fl4(effects->color_checker_light, 0.2f, 0.2f, 0.2f, 1.0f); + DRW_PASS_CREATE(psl->alpha_checker, DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND_PREMUL_UNDER); + grp = DRW_shgroup_create(checker_sh, psl->alpha_checker); DRW_shgroup_uniform_vec4(grp, "color1", effects->color_checker_dark, 1); DRW_shgroup_uniform_vec4(grp, "color2", effects->color_checker_light, 1); DRW_shgroup_uniform_int_copy(grp, "size", 8); diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c index 2dd5debfb83..92cd465f771 100644 --- a/source/blender/draw/engines/eevee/eevee_lightprobes.c +++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c @@ -227,8 +227,7 @@ void EEVEE_lightbake_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_LightProbesInfo *pinfo = sldata->probes; { - psl->probe_glossy_compute = DRW_pass_create("LightProbe Glossy Compute", - DRW_STATE_WRITE_COLOR); + DRW_PASS_CREATE(psl->probe_glossy_compute, DRW_STATE_WRITE_COLOR); DRWShadingGroup *grp = DRW_shgroup_create(EEVEE_shaders_probe_filter_glossy_sh_get(), psl->probe_glossy_compute); @@ -253,9 +252,7 @@ void EEVEE_lightbake_cache_init(EEVEE_ViewLayerData *sldata, } { - psl->probe_diffuse_compute = DRW_pass_create("LightProbe Diffuse Compute", - DRW_STATE_WRITE_COLOR); - + DRW_PASS_CREATE(psl->probe_diffuse_compute, DRW_STATE_WRITE_COLOR); DRWShadingGroup *grp = DRW_shgroup_create(EEVEE_shaders_probe_filter_diffuse_sh_get(), psl->probe_diffuse_compute); #ifdef IRRADIANCE_SH_L2 @@ -276,9 +273,7 @@ void EEVEE_lightbake_cache_init(EEVEE_ViewLayerData *sldata, } { - psl->probe_visibility_compute = DRW_pass_create("LightProbe Visibility Compute", - DRW_STATE_WRITE_COLOR); - + DRW_PASS_CREATE(psl->probe_visibility_compute, DRW_STATE_WRITE_COLOR); DRWShadingGroup *grp = DRW_shgroup_create(EEVEE_shaders_probe_filter_visibility_sh_get(), psl->probe_visibility_compute); DRW_shgroup_uniform_int(grp, "outputSize", &pinfo->shres, 1); @@ -298,7 +293,7 @@ void EEVEE_lightbake_cache_init(EEVEE_ViewLayerData *sldata, } { - psl->probe_grid_fill = DRW_pass_create("LightProbe Grid Floodfill", DRW_STATE_WRITE_COLOR); + DRW_PASS_CREATE(psl->probe_grid_fill, DRW_STATE_WRITE_COLOR); DRWShadingGroup *grp = DRW_shgroup_create(EEVEE_shaders_probe_grid_fill_sh_get(), psl->probe_grid_fill); @@ -326,8 +321,7 @@ void EEVEE_lightprobes_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedat pinfo->do_cube_update = false; { - psl->probe_background = DRW_pass_create("World Probe Background Pass", - DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL); + DRW_PASS_CREATE(psl->probe_background, DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL); struct GPUBatch *geom = DRW_cache_fullscreen_quad_get(); DRWShadingGroup *grp = NULL; @@ -381,7 +375,7 @@ void EEVEE_lightprobes_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedat if (DRW_state_draw_support() && !LOOK_DEV_STUDIO_LIGHT_ENABLED(draw_ctx->v3d)) { DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CULL_BACK; - psl->probe_display = DRW_pass_create("LightProbe Display", state); + DRW_PASS_CREATE(psl->probe_display, state); /* Cube Display */ if (scene_eval->eevee.flag & SCE_EEVEE_SHOW_CUBEMAPS && lcache->cube_len > 1) { @@ -765,8 +759,7 @@ void EEVEE_lightprobes_cache_finish(EEVEE_ViewLayerData *sldata, EEVEE_Data *ved if (pinfo->num_planar) { EEVEE_PassList *psl = vedata->psl; EEVEE_TextureList *txl = vedata->txl; - psl->probe_planar_downsample_ps = DRW_pass_create("LightProbe Planar Downsample", - DRW_STATE_WRITE_COLOR); + DRW_PASS_CREATE(psl->probe_planar_downsample_ps, DRW_STATE_WRITE_COLOR); DRWShadingGroup *grp = DRW_shgroup_create(EEVEE_shaders_probe_planar_downsample_sh_get(), psl->probe_planar_downsample_ps); diff --git a/source/blender/draw/engines/eevee/eevee_lights.c b/source/blender/draw/engines/eevee/eevee_lights.c index f64cd340ab2..7106cf0249e 100644 --- a/source/blender/draw/engines/eevee/eevee_lights.c +++ b/source/blender/draw/engines/eevee/eevee_lights.c @@ -319,7 +319,7 @@ void EEVEE_lights_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) psl->shadow_cascade_store_high_pass = NULL; { - psl->shadow_cube_copy_pass = DRW_pass_create("Shadow Copy Pass", DRW_STATE_WRITE_COLOR); + DRW_PASS_CREATE(psl->shadow_cube_copy_pass, DRW_STATE_WRITE_COLOR); DRWShadingGroup *grp = DRW_shgroup_create(e_data.shadow_copy_cube_sh[linfo->shadow_method], psl->shadow_cube_copy_pass); @@ -331,8 +331,7 @@ void EEVEE_lights_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) } { - psl->shadow_cascade_copy_pass = DRW_pass_create("Shadow Cascade Copy Pass", - DRW_STATE_WRITE_COLOR); + DRW_PASS_CREATE(psl->shadow_cascade_copy_pass, DRW_STATE_WRITE_COLOR); DRWShadingGroup *grp = DRW_shgroup_create(e_data.shadow_copy_cascade_sh[linfo->shadow_method], psl->shadow_cascade_copy_pass); @@ -345,7 +344,7 @@ void EEVEE_lights_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) { DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL; - psl->shadow_pass = DRW_pass_create("Shadow Pass", state); + DRW_PASS_CREATE(psl->shadow_pass, state); stl->g_data->shadow_shgrp = DRW_shgroup_create(e_data.shadow_sh, psl->shadow_pass); } diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c index 5a54d7a4615..0ed5d4a0a7d 100644 --- a/source/blender/draw/engines/eevee/eevee_materials.c +++ b/source/blender/draw/engines/eevee/eevee_materials.c @@ -912,6 +912,8 @@ static struct DRWShadingGroup *EEVEE_default_shading_group_get(EEVEE_ViewLayerDa ssr_id = (use_ssr) ? 1 : -1; int options = VAR_MAT_MESH; + EEVEE_PassList *psl = vedata->psl; + BLI_assert(!is_hair || (ob && psys && md)); SET_FLAG_FROM_TEST(options, is_hair, VAR_MAT_HAIR); @@ -922,16 +924,16 @@ static struct DRWShadingGroup *EEVEE_default_shading_group_get(EEVEE_ViewLayerDa create_default_shader(options); } - if (vedata->psl->default_pass[options] == NULL) { + if (psl->default_pass[options] == NULL) { DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | DRW_STATE_CLIP_PLANES; - vedata->psl->default_pass[options] = DRW_pass_create("Default Lit Pass", state); + DRW_PASS_CREATE(psl->default_pass[options], state); /* XXX / WATCH: This creates non persistent binds for the ubos and textures. * But it's currently OK because the following shgroups does not add any bind. * EDIT: THIS IS NOT THE CASE FOR HAIRS !!! DUMMY!!! */ if (!is_hair) { DRWShadingGroup *shgrp = DRW_shgroup_create(e_data.default_lit[options], - vedata->psl->default_pass[options]); + psl->default_pass[options]); add_standard_uniforms(shgrp, sldata, vedata, &ssr_id, NULL, true, true, false, false, false); } } @@ -959,8 +961,7 @@ void EEVEE_materials_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) } { - psl->background_pass = DRW_pass_create("Background Pass", - DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL); + DRW_PASS_CREATE(psl->background_pass, DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL); struct GPUBatch *geom = DRW_cache_fullscreen_quad_get(); DRWShadingGroup *grp = NULL; @@ -1017,23 +1018,23 @@ void EEVEE_materials_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) { DRWState state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL; - psl->depth_pass = DRW_pass_create("Depth Pass", state); + DRW_PASS_CREATE(psl->depth_pass, state); stl->g_data->depth_shgrp = DRW_shgroup_create(e_data.default_prepass_sh, psl->depth_pass); state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CULL_BACK; - psl->depth_pass_cull = DRW_pass_create("Depth Pass Cull", state); + DRW_PASS_CREATE(psl->depth_pass_cull, state); stl->g_data->depth_shgrp_cull = DRW_shgroup_create(e_data.default_prepass_sh, psl->depth_pass_cull); state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CLIP_PLANES; - psl->depth_pass_clip = DRW_pass_create("Depth Pass Clip", state); + DRW_PASS_CREATE(psl->depth_pass_clip, state); stl->g_data->depth_shgrp_clip = DRW_shgroup_create(e_data.default_prepass_clip_sh, psl->depth_pass_clip); DRW_shgroup_uniform_block(stl->g_data->depth_shgrp_clip, "clip_block", sldata->clip_ubo); state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CLIP_PLANES | DRW_STATE_CULL_BACK; - psl->depth_pass_clip_cull = DRW_pass_create("Depth Pass Cull Clip", state); + DRW_PASS_CREATE(psl->depth_pass_clip_cull, state); stl->g_data->depth_shgrp_clip_cull = DRW_shgroup_create(e_data.default_prepass_clip_sh, psl->depth_pass_clip_cull); DRW_shgroup_uniform_block(stl->g_data->depth_shgrp_clip_cull, "clip_block", sldata->clip_ubo); @@ -1041,23 +1042,23 @@ void EEVEE_materials_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) { DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | DRW_STATE_CLIP_PLANES; - psl->material_pass = DRW_pass_create("Material Pass", state); - psl->material_pass_cull = DRW_pass_create("Material Pass Cull", state | DRW_STATE_CULL_BACK); + DRW_PASS_CREATE(psl->material_pass, state); + DRW_PASS_CREATE(psl->material_pass_cull, state | DRW_STATE_CULL_BACK); } { DRWState state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL; - psl->refract_depth_pass = DRW_pass_create("Refract Depth Pass", state); + DRW_PASS_CREATE(psl->refract_depth_pass, state); stl->g_data->refract_depth_shgrp = DRW_shgroup_create(e_data.default_prepass_sh, psl->refract_depth_pass); state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CULL_BACK; - psl->refract_depth_pass_cull = DRW_pass_create("Refract Depth Pass Cull", state); + DRW_PASS_CREATE(psl->refract_depth_pass_cull, state); stl->g_data->refract_depth_shgrp_cull = DRW_shgroup_create(e_data.default_prepass_sh, psl->refract_depth_pass_cull); state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CLIP_PLANES; - psl->refract_depth_pass_clip = DRW_pass_create("Refract Depth Pass Clip", state); + DRW_PASS_CREATE(psl->refract_depth_pass_clip, state); stl->g_data->refract_depth_shgrp_clip = DRW_shgroup_create(e_data.default_prepass_clip_sh, psl->refract_depth_pass_clip); DRW_shgroup_uniform_block( @@ -1065,7 +1066,7 @@ void EEVEE_materials_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CLIP_PLANES | DRW_STATE_CULL_BACK; - psl->refract_depth_pass_clip_cull = DRW_pass_create("Refract Depth Pass Cull Clip", state); + DRW_PASS_CREATE(psl->refract_depth_pass_clip_cull, state); stl->g_data->refract_depth_shgrp_clip_cull = DRW_shgroup_create( e_data.default_prepass_clip_sh, psl->refract_depth_pass_clip_cull); DRW_shgroup_uniform_block( @@ -1074,24 +1075,24 @@ void EEVEE_materials_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) { DRWState state = (DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | DRW_STATE_CLIP_PLANES); - psl->refract_pass = DRW_pass_create("Opaque Refraction Pass", state); + DRW_PASS_CREATE(psl->refract_pass, state); } { DRWState state = (DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | DRW_STATE_CLIP_PLANES | DRW_STATE_WRITE_STENCIL); - psl->sss_pass = DRW_pass_create("Subsurface Pass", state); - psl->sss_pass_cull = DRW_pass_create("Subsurface Pass Cull", state | DRW_STATE_CULL_BACK); + DRW_PASS_CREATE(psl->sss_pass, state); + DRW_PASS_CREATE(psl->sss_pass_cull, state | DRW_STATE_CULL_BACK); e_data.sss_count = 0; } { DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CLIP_PLANES; - psl->transparent_pass = DRW_pass_create("Material Transparent Pass", state); + DRW_PASS_CREATE(psl->transparent_pass, state); } { - psl->update_noise_pass = DRW_pass_create("Update Noise Pass", DRW_STATE_WRITE_COLOR); + DRW_PASS_CREATE(psl->update_noise_pass, DRW_STATE_WRITE_COLOR); DRWShadingGroup *grp = DRW_shgroup_create(e_data.update_noise_sh, psl->update_noise_pass); DRW_shgroup_uniform_texture(grp, "blueNoise", e_data.noise_tex); DRW_shgroup_uniform_vec3(grp, "offsets", e_data.noise_offsets, 1); @@ -1113,7 +1114,7 @@ void EEVEE_materials_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_ALWAYS | DRW_STATE_CULL_BACK; - psl->lookdev_diffuse_pass = DRW_pass_create("LookDev Diffuse Pass", state); + DRW_PASS_CREATE(psl->lookdev_diffuse_pass, state); shgrp = DRW_shgroup_create(e_data.default_lit[options], psl->lookdev_diffuse_pass); add_standard_uniforms(shgrp, sldata, vedata, NULL, NULL, true, true, false, false, false); DRW_shgroup_uniform_vec3(shgrp, "basecol", color_diffuse, 1); @@ -1122,7 +1123,7 @@ void EEVEE_materials_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) DRW_shgroup_uniform_float_copy(shgrp, "roughness", 1.0f); DRW_shgroup_call(shgrp, sphere, NULL); - psl->lookdev_glossy_pass = DRW_pass_create("LookDev Glossy Pass", state); + DRW_PASS_CREATE(psl->lookdev_glossy_pass, state); shgrp = DRW_shgroup_create(e_data.default_lit[options], psl->lookdev_glossy_pass); add_standard_uniforms(shgrp, sldata, vedata, NULL, NULL, true, true, false, false, false); DRW_shgroup_uniform_vec3(shgrp, "basecol", color_chrome, 1); diff --git a/source/blender/draw/engines/eevee/eevee_mist.c b/source/blender/draw/engines/eevee/eevee_mist.c index d8127d7ea1f..9f989146b05 100644 --- a/source/blender/draw/engines/eevee/eevee_mist.c +++ b/source/blender/draw/engines/eevee/eevee_mist.c @@ -106,7 +106,7 @@ void EEVEE_mist_output_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) g_data->mist_falloff *= 0.5f; /* Create Pass and shgroup. */ - psl->mist_accum_ps = DRW_pass_create("Mist Accum", DRW_STATE_WRITE_COLOR | DRW_STATE_ADDITIVE); + DRW_PASS_CREATE(psl->mist_accum_ps, DRW_STATE_WRITE_COLOR | DRW_STATE_ADDITIVE); DRWShadingGroup *grp = DRW_shgroup_create(e_data.mist_sh, psl->mist_accum_ps); DRW_shgroup_uniform_texture_ref(grp, "depthBuffer", &dtxl->depth); DRW_shgroup_uniform_block(grp, "common_block", sldata->common_ubo); diff --git a/source/blender/draw/engines/eevee/eevee_motion_blur.c b/source/blender/draw/engines/eevee/eevee_motion_blur.c index f38252590d8..ad4f72d78dc 100644 --- a/source/blender/draw/engines/eevee/eevee_motion_blur.c +++ b/source/blender/draw/engines/eevee/eevee_motion_blur.c @@ -195,7 +195,7 @@ void EEVEE_motion_blur_cache_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Dat struct GPUBatch *quad = DRW_cache_fullscreen_quad_get(); if ((effects->enabled_effects & EFFECT_MOTION_BLUR) != 0) { - psl->motion_blur = DRW_pass_create("Motion Blur", DRW_STATE_WRITE_COLOR); + DRW_PASS_CREATE(psl->motion_blur, DRW_STATE_WRITE_COLOR); DRWShadingGroup *grp = DRW_shgroup_create(e_data.motion_blur_sh, psl->motion_blur); DRW_shgroup_uniform_int(grp, "samples", &effects->motion_blur_samples, 1); diff --git a/source/blender/draw/engines/eevee/eevee_occlusion.c b/source/blender/draw/engines/eevee/eevee_occlusion.c index 577d7125641..8c1e412672e 100644 --- a/source/blender/draw/engines/eevee/eevee_occlusion.c +++ b/source/blender/draw/engines/eevee/eevee_occlusion.c @@ -151,7 +151,7 @@ void EEVEE_occlusion_output_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata /* Accumulation pass */ DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_ADDITIVE; - psl->ao_accum_ps = DRW_pass_create("AO Accum", state); + DRW_PASS_CREATE(psl->ao_accum_ps, state); DRWShadingGroup *grp = DRW_shgroup_create(e_data.gtao_debug_sh, psl->ao_accum_ps); DRW_shgroup_uniform_texture(grp, "utilTex", EEVEE_materials_get_util_tex()); DRW_shgroup_uniform_texture_ref(grp, "maxzBuffer", &txl->maxzbuffer); @@ -190,7 +190,7 @@ void EEVEE_occlusion_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) * the shading stage. This let us do correct shadowing for each diffuse / specular * lobe present in the shader using the correct normal. */ - psl->ao_horizon_search = DRW_pass_create("GTAO Horizon Search", DRW_STATE_WRITE_COLOR); + DRW_PASS_CREATE(psl->ao_horizon_search, DRW_STATE_WRITE_COLOR); DRWShadingGroup *grp = DRW_shgroup_create(e_data.gtao_sh, psl->ao_horizon_search); DRW_shgroup_uniform_texture(grp, "utilTex", EEVEE_materials_get_util_tex()); DRW_shgroup_uniform_texture_ref(grp, "maxzBuffer", &txl->maxzbuffer); @@ -198,8 +198,7 @@ void EEVEE_occlusion_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) DRW_shgroup_uniform_block(grp, "common_block", sldata->common_ubo); DRW_shgroup_call(grp, quad, NULL); - psl->ao_horizon_search_layer = DRW_pass_create("GTAO Horizon Search Layer", - DRW_STATE_WRITE_COLOR); + DRW_PASS_CREATE(psl->ao_horizon_search_layer, DRW_STATE_WRITE_COLOR); grp = DRW_shgroup_create(e_data.gtao_layer_sh, psl->ao_horizon_search_layer); DRW_shgroup_uniform_texture(grp, "utilTex", EEVEE_materials_get_util_tex()); DRW_shgroup_uniform_texture_ref(grp, "maxzBuffer", &txl->maxzbuffer); @@ -209,7 +208,7 @@ void EEVEE_occlusion_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) DRW_shgroup_call(grp, quad, NULL); if (G.debug_value == 6) { - psl->ao_horizon_debug = DRW_pass_create("GTAO Horizon Debug", DRW_STATE_WRITE_COLOR); + DRW_PASS_CREATE(psl->ao_horizon_debug, DRW_STATE_WRITE_COLOR); grp = DRW_shgroup_create(e_data.gtao_debug_sh, psl->ao_horizon_debug); DRW_shgroup_uniform_texture(grp, "utilTex", EEVEE_materials_get_util_tex()); DRW_shgroup_uniform_texture_ref(grp, "maxzBuffer", &txl->maxzbuffer); diff --git a/source/blender/draw/engines/eevee/eevee_screen_raytrace.c b/source/blender/draw/engines/eevee/eevee_screen_raytrace.c index ed69c5f4727..ca6c9cdbe94 100644 --- a/source/blender/draw/engines/eevee/eevee_screen_raytrace.c +++ b/source/blender/draw/engines/eevee/eevee_screen_raytrace.c @@ -215,7 +215,7 @@ void EEVEE_screen_raytrace_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *v * mipmap for each ray using its pdf. (filtered importance sampling) * We then evaluate the lighting from the probes and mix the results together. */ - psl->ssr_raytrace = DRW_pass_create("SSR Raytrace", DRW_STATE_WRITE_COLOR); + DRW_PASS_CREATE(psl->ssr_raytrace, DRW_STATE_WRITE_COLOR); DRWShadingGroup *grp = DRW_shgroup_create(trace_shader, psl->ssr_raytrace); DRW_shgroup_uniform_texture_ref(grp, "depthBuffer", &e_data.depth_src); DRW_shgroup_uniform_texture_ref(grp, "normalBuffer", &effects->ssr_normal_input); @@ -232,7 +232,7 @@ void EEVEE_screen_raytrace_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *v } DRW_shgroup_call(grp, quad, NULL); - psl->ssr_resolve = DRW_pass_create("SSR Resolve", DRW_STATE_WRITE_COLOR | DRW_STATE_ADDITIVE); + DRW_PASS_CREATE(psl->ssr_resolve, DRW_STATE_WRITE_COLOR | DRW_STATE_ADDITIVE); grp = DRW_shgroup_create(resolve_shader, psl->ssr_resolve); DRW_shgroup_uniform_texture_ref(grp, "depthBuffer", &e_data.depth_src); DRW_shgroup_uniform_texture_ref(grp, "normalBuffer", &effects->ssr_normal_input); diff --git a/source/blender/draw/engines/eevee/eevee_subsurface.c b/source/blender/draw/engines/eevee/eevee_subsurface.c index 2323fdfc31c..19aefd03e72 100644 --- a/source/blender/draw/engines/eevee/eevee_subsurface.c +++ b/source/blender/draw/engines/eevee/eevee_subsurface.c @@ -198,12 +198,10 @@ void EEVEE_subsurface_cache_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data /** Screen Space SubSurface Scattering overview * TODO */ - psl->sss_blur_ps = DRW_pass_create("Blur Horiz", - DRW_STATE_WRITE_COLOR | DRW_STATE_STENCIL_EQUAL); - - DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_ADDITIVE | DRW_STATE_STENCIL_EQUAL; - psl->sss_resolve_ps = DRW_pass_create("Blur Vert", state); - psl->sss_accum_ps = DRW_pass_create("Resolve Accum", state); + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_STENCIL_EQUAL; + DRW_PASS_CREATE(psl->sss_blur_ps, state); + DRW_PASS_CREATE(psl->sss_resolve_ps, state | DRW_STATE_ADDITIVE); + DRW_PASS_CREATE(psl->sss_accum_ps, state | DRW_STATE_ADDITIVE); } void EEVEE_subsurface_add_pass(EEVEE_ViewLayerData *sldata, diff --git a/source/blender/draw/engines/eevee/eevee_temporal_sampling.c b/source/blender/draw/engines/eevee/eevee_temporal_sampling.c index b191962acf3..a488e16093a 100644 --- a/source/blender/draw/engines/eevee/eevee_temporal_sampling.c +++ b/source/blender/draw/engines/eevee/eevee_temporal_sampling.c @@ -283,7 +283,7 @@ void EEVEE_temporal_sampling_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data if ((effects->enabled_effects & (EFFECT_TAA | EFFECT_TAA_REPROJECT)) != 0) { struct GPUShader *sh = EEVEE_shaders_taa_resolve_sh_get(effects->enabled_effects); - psl->taa_resolve = DRW_pass_create("Temporal AA Resolve", DRW_STATE_WRITE_COLOR); + DRW_PASS_CREATE(psl->taa_resolve, DRW_STATE_WRITE_COLOR); DRWShadingGroup *grp = DRW_shgroup_create(sh, psl->taa_resolve); DRW_shgroup_uniform_texture_ref(grp, "colorHistoryBuffer", &txl->taa_history); |