diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-08-26 15:49:12 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-08-26 15:49:12 +0300 |
commit | a8d9b72dc58a96cb22dd10e1ac7105b7043b35f8 (patch) | |
tree | d14f78fa29a4d6db040c8e4f26fdddeda34f558a | |
parent | d5b1085aa7ad15caf3dbfcc14290faf6447a770a (diff) |
Remove auto resource location fiasco for eevee next
6 files changed, 16 insertions, 19 deletions
diff --git a/source/blender/draw/engines/eevee_next/shaders/infos/eevee_depth_of_field_info.hh b/source/blender/draw/engines/eevee_next/shaders/infos/eevee_depth_of_field_info.hh index b398a6cc4e7..b689a7f53a2 100644 --- a/source/blender/draw/engines/eevee_next/shaders/infos/eevee_depth_of_field_info.hh +++ b/source/blender/draw/engines/eevee_next/shaders/infos/eevee_depth_of_field_info.hh @@ -11,7 +11,7 @@ GPU_SHADER_CREATE_INFO(eevee_depth_of_field_bokeh_lut) .do_static_compilation(true) .local_group_size(DOF_BOKEH_LUT_SIZE, DOF_BOKEH_LUT_SIZE) .additional_info("eevee_shared", "draw_view") - .uniform_buf(1, "DepthOfFieldData", "dof_buf") + .uniform_buf(6, "DepthOfFieldData", "dof_buf") .image(0, GPU_RG16F, Qualifier::WRITE, ImageType::FLOAT_2D, "out_gather_lut_img") .image(1, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "out_scatter_lut_img") .image(2, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "out_resolve_lut_img") @@ -21,7 +21,7 @@ GPU_SHADER_CREATE_INFO(eevee_depth_of_field_setup) .do_static_compilation(true) .local_group_size(DOF_DEFAULT_GROUP_SIZE, DOF_DEFAULT_GROUP_SIZE) .additional_info("eevee_shared", "draw_view") - .uniform_buf(1, "DepthOfFieldData", "dof_buf") + .uniform_buf(6, "DepthOfFieldData", "dof_buf") .sampler(0, ImageType::FLOAT_2D, "color_tx") .sampler(1, ImageType::DEPTH_2D, "depth_tx") .image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "out_color_img") @@ -32,7 +32,7 @@ GPU_SHADER_CREATE_INFO(eevee_depth_of_field_stabilize) .do_static_compilation(true) .local_group_size(DOF_STABILIZE_GROUP_SIZE, DOF_STABILIZE_GROUP_SIZE) .additional_info("eevee_shared", "draw_view", "eevee_velocity_camera") - .uniform_buf(4, "DepthOfFieldData", "dof_buf") + .uniform_buf(6, "DepthOfFieldData", "dof_buf") .sampler(0, ImageType::FLOAT_2D, "coc_tx") .sampler(1, ImageType::FLOAT_2D, "color_tx") .sampler(2, ImageType::FLOAT_2D, "velocity_tx") @@ -57,7 +57,7 @@ GPU_SHADER_CREATE_INFO(eevee_depth_of_field_reduce) .do_static_compilation(true) .local_group_size(DOF_REDUCE_GROUP_SIZE, DOF_REDUCE_GROUP_SIZE) .additional_info("eevee_shared", "draw_view") - .uniform_buf(1, "DepthOfFieldData", "dof_buf") + .uniform_buf(6, "DepthOfFieldData", "dof_buf") .sampler(0, ImageType::FLOAT_2D, "downsample_tx") .storage_buf(0, Qualifier::WRITE, "ScatterRect", "scatter_fg_list_buf[]") .storage_buf(1, Qualifier::WRITE, "ScatterRect", "scatter_bg_list_buf[]") @@ -154,7 +154,7 @@ GPU_SHADER_CREATE_INFO(eevee_depth_of_field_gather_common) "draw_view", "eevee_depth_of_field_tiles_common", "eevee_sampling_data") - .uniform_buf(2, "DepthOfFieldData", "dof_buf") + .uniform_buf(6, "DepthOfFieldData", "dof_buf") .local_group_size(DOF_GATHER_GROUP_SIZE, DOF_GATHER_GROUP_SIZE) .sampler(0, ImageType::FLOAT_2D, "color_tx") .sampler(1, ImageType::FLOAT_2D, "color_bilinear_tx") @@ -229,7 +229,7 @@ GPU_SHADER_CREATE_INFO(eevee_depth_of_field_resolve) "draw_view", "eevee_depth_of_field_tiles_common", "eevee_sampling_data") - .uniform_buf(2, "DepthOfFieldData", "dof_buf") + .uniform_buf(6, "DepthOfFieldData", "dof_buf") .sampler(0, ImageType::DEPTH_2D, "depth_tx") .sampler(1, ImageType::FLOAT_2D, "color_tx") .sampler(2, ImageType::FLOAT_2D, "color_bg_tx") diff --git a/source/blender/draw/engines/eevee_next/shaders/infos/eevee_film_info.hh b/source/blender/draw/engines/eevee_next/shaders/infos/eevee_film_info.hh index c94171db6a9..db82a3265d7 100644 --- a/source/blender/draw/engines/eevee_next/shaders/infos/eevee_film_info.hh +++ b/source/blender/draw/engines/eevee_next/shaders/infos/eevee_film_info.hh @@ -4,7 +4,7 @@ #include "gpu_shader_create_info.hh" GPU_SHADER_CREATE_INFO(eevee_film) - .uniform_buf(4, "FilmData", "film_buf") + .uniform_buf(6, "FilmData", "film_buf") .sampler(0, ImageType::DEPTH_2D, "depth_tx") .sampler(1, ImageType::FLOAT_2D, "combined_tx") .sampler(2, ImageType::FLOAT_2D, "normal_tx") diff --git a/source/blender/draw/engines/eevee_next/shaders/infos/eevee_material_info.hh b/source/blender/draw/engines/eevee_next/shaders/infos/eevee_material_info.hh index 8225a11ed86..24c867a4d5b 100644 --- a/source/blender/draw/engines/eevee_next/shaders/infos/eevee_material_info.hh +++ b/source/blender/draw/engines/eevee_next/shaders/infos/eevee_material_info.hh @@ -52,7 +52,7 @@ GPU_SHADER_CREATE_INFO(eevee_geom_world) .define("MAT_GEOM_WORLD") .builtins(BuiltinBits::VERTEX_ID) .vertex_source("eevee_geom_world_vert.glsl") - .additional_info("draw_modelmat", "draw_resource_id_varying", "draw_resource_handle"); + .additional_info("draw_modelmat_new", "draw_resource_id_varying", "draw_view"); /** \} */ @@ -104,7 +104,6 @@ GPU_SHADER_CREATE_INFO(eevee_surf_deferred) ; GPU_SHADER_CREATE_INFO(eevee_surf_forward) - .auto_resource_location(true) .vertex_out(eevee_surf_iface) /* Early fragment test is needed for render passes support for forward surfaces. */ /* NOTE: This removes the possibility of using gl_FragDepth. */ diff --git a/source/blender/draw/engines/eevee_next/shaders/infos/eevee_motion_blur_info.hh b/source/blender/draw/engines/eevee_next/shaders/infos/eevee_motion_blur_info.hh index d6ff34b0ed2..ec302ec6770 100644 --- a/source/blender/draw/engines/eevee_next/shaders/infos/eevee_motion_blur_info.hh +++ b/source/blender/draw/engines/eevee_next/shaders/infos/eevee_motion_blur_info.hh @@ -6,7 +6,7 @@ GPU_SHADER_CREATE_INFO(eevee_motion_blur_tiles_flatten) .local_group_size(MOTION_BLUR_GROUP_SIZE, MOTION_BLUR_GROUP_SIZE) .additional_info("eevee_shared", "draw_view", "eevee_velocity_camera") - .uniform_buf(4, "MotionBlurData", "motion_blur_buf") + .uniform_buf(6, "MotionBlurData", "motion_blur_buf") .sampler(0, ImageType::DEPTH_2D, "depth_tx") .image(1, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "out_tiles_img") .compute_source("eevee_motion_blur_flatten_comp.glsl"); @@ -35,7 +35,7 @@ GPU_SHADER_CREATE_INFO(eevee_motion_blur_gather) .do_static_compilation(true) .local_group_size(MOTION_BLUR_GROUP_SIZE, MOTION_BLUR_GROUP_SIZE) .additional_info("eevee_shared", "draw_view", "eevee_sampling_data") - .uniform_buf(4, "MotionBlurData", "motion_blur_buf") + .uniform_buf(6, "MotionBlurData", "motion_blur_buf") .sampler(0, ImageType::DEPTH_2D, "depth_tx") .sampler(1, ImageType::FLOAT_2D, "velocity_tx") .sampler(2, ImageType::FLOAT_2D, "in_color_tx") diff --git a/source/blender/draw/engines/eevee_next/shaders/infos/eevee_velocity_info.hh b/source/blender/draw/engines/eevee_next/shaders/infos/eevee_velocity_info.hh index 4e3b299f410..bea120dadd5 100644 --- a/source/blender/draw/engines/eevee_next/shaders/infos/eevee_velocity_info.hh +++ b/source/blender/draw/engines/eevee_next/shaders/infos/eevee_velocity_info.hh @@ -17,13 +17,12 @@ GPU_SHADER_INTERFACE_INFO(eevee_velocity_surface_iface, "motion") GPU_SHADER_CREATE_INFO(eevee_velocity_camera) .define("VELOCITY_CAMERA") - .uniform_buf(1, "CameraData", "camera_prev") - .uniform_buf(2, "CameraData", "camera_curr") - .uniform_buf(3, "CameraData", "camera_next"); + .uniform_buf(3, "CameraData", "camera_prev") + .uniform_buf(4, "CameraData", "camera_curr") + .uniform_buf(5, "CameraData", "camera_next"); GPU_SHADER_CREATE_INFO(eevee_velocity_geom) .define("MAT_VELOCITY") - .auto_resource_location(true) .storage_buf(0, Qualifier::READ, "mat4", "velocity_obj_prev_buf[]") .storage_buf(1, Qualifier::READ, "mat4", "velocity_obj_next_buf[]") .storage_buf(2, Qualifier::READ, "vec4", "velocity_geo_prev_buf[]") diff --git a/source/blender/gpu/intern/gpu_codegen.cc b/source/blender/gpu/intern/gpu_codegen.cc index 4a45a3e63ed..b6021867588 100644 --- a/source/blender/gpu/intern/gpu_codegen.cc +++ b/source/blender/gpu/intern/gpu_codegen.cc @@ -199,8 +199,7 @@ static std::ostream &operator<<(std::ostream &stream, const GPUOutput *output) } /* Trick type to change overload and keep a somewhat nice syntax. */ -struct GPUConstant : public GPUInput { -}; +struct GPUConstant : public GPUInput {}; /* Print data constructor (i.e: vec2(1.0f, 1.0f)). */ static std::ostream &operator<<(std::ostream &stream, const GPUConstant *input) @@ -382,7 +381,7 @@ void GPUCodegen::generate_resources() } ss << "};\n\n"; - info.uniform_buf(0, "NodeTree", GPU_UBO_BLOCK_NAME, Frequency::BATCH); + info.uniform_buf(1, "NodeTree", GPU_UBO_BLOCK_NAME, Frequency::BATCH); } if (!BLI_listbase_is_empty(&graph.uniform_attrs.list)) { @@ -394,7 +393,7 @@ void GPUCodegen::generate_resources() /* TODO(fclem): Use the macro for length. Currently not working for EEVEE. */ /* DRW_RESOURCE_CHUNK_LEN = 512 */ - info.uniform_buf(0, "UniformAttrs", GPU_ATTRIBUTE_UBO_BLOCK_NAME "[512]", Frequency::BATCH); + info.uniform_buf(2, "UniformAttrs", GPU_ATTRIBUTE_UBO_BLOCK_NAME "[512]", Frequency::BATCH); } info.typedef_source_generated = ss.str(); |