Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee_next/eevee_renderbuffers.cc
| Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | light_tx.ensure_2d_array(color_format, | ||||
| max_light_color_layer > 0 ? extent : int2(1), | max_light_color_layer > 0 ? extent : int2(1), | ||||
| max_ii(1, max_light_color_layer)); | max_ii(1, max_light_color_layer)); | ||||
| const AOVsInfoData &aovs = inst_.film.aovs_info; | const AOVsInfoData &aovs = inst_.film.aovs_info; | ||||
| aov_color_tx.ensure_2d_array( | aov_color_tx.ensure_2d_array( | ||||
| color_format, (aovs.color_len > 0) ? extent : int2(1), max_ii(1, aovs.color_len)); | color_format, (aovs.color_len > 0) ? extent : int2(1), max_ii(1, aovs.color_len)); | ||||
| aov_value_tx.ensure_2d_array( | aov_value_tx.ensure_2d_array( | ||||
| float_format, (aovs.value_len > 0) ? extent : int2(1), max_ii(1, aovs.value_len)); | float_format, (aovs.value_len > 0) ? extent : int2(1), max_ii(1, aovs.value_len)); | ||||
| eGPUTextureFormat cryptomatte_format = GPU_R32F; | |||||
| const int cryptomatte_layer_len = inst_.film.cryptomatte_layer_max_get(); | |||||
| if (cryptomatte_layer_len == 2) { | |||||
| cryptomatte_format = GPU_RG32F; | |||||
| } | |||||
| else if (cryptomatte_layer_len == 3) { | |||||
| cryptomatte_format = GPU_RGBA32F; | |||||
fclem: Another idea, is to use `GPU_R32F` with multiple layer to avoid the unnecessary 4th comp. | |||||
Done Inline ActionsThat would become 3 store operations when drawing materials and 3 read operations during film accumulation. Haven't tested what the performance implications are think they should be negligible on modern hardware, but still... jbakker: That would become 3 store operations when drawing materials and 3 read operations during film… | |||||
| } | |||||
| cryptomatte_tx.acquire( | |||||
| pass_extent(static_cast<eViewLayerEEVEEPassType>(EEVEE_RENDER_PASS_CRYPTOMATTE_OBJECT | | |||||
| EEVEE_RENDER_PASS_CRYPTOMATTE_ASSET | | |||||
| EEVEE_RENDER_PASS_CRYPTOMATTE_MATERIAL)), | |||||
| cryptomatte_format); | |||||
| } | } | ||||
| void RenderBuffers::release() | void RenderBuffers::release() | ||||
| { | { | ||||
| depth_tx.release(); | depth_tx.release(); | ||||
| combined_tx.release(); | combined_tx.release(); | ||||
| normal_tx.release(); | normal_tx.release(); | ||||
| vector_tx.release(); | vector_tx.release(); | ||||
| diffuse_color_tx.release(); | diffuse_color_tx.release(); | ||||
| specular_color_tx.release(); | specular_color_tx.release(); | ||||
| volume_light_tx.release(); | volume_light_tx.release(); | ||||
| emission_tx.release(); | emission_tx.release(); | ||||
| environment_tx.release(); | environment_tx.release(); | ||||
| shadow_tx.release(); | shadow_tx.release(); | ||||
| ambient_occlusion_tx.release(); | ambient_occlusion_tx.release(); | ||||
| cryptomatte_tx.release(); | |||||
| } | } | ||||
| } // namespace blender::eevee | } // namespace blender::eevee | ||||
Another idea, is to use GPU_R32F with multiple layer to avoid the unnecessary 4th comp.