diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-01-27 10:48:37 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-01-27 10:54:24 +0300 |
commit | 5abab0a41a02a0dbae0ea3ec355b7dfb6a778613 (patch) | |
tree | c18ed3a2395967c3aad146e316b26694ed746e4f /source | |
parent | a7f7b0b77e3ffce679c1b3a79bd7b9fd92779959 (diff) |
GPUShaderCreateInfo: Remove push_constant indexing
This is too much impractical and offers no real benefit.
Diffstat (limited to 'source')
41 files changed, 123 insertions, 138 deletions
diff --git a/source/blender/draw/engines/workbench/shaders/infos/workbench_composite_info.hh b/source/blender/draw/engines/workbench/shaders/infos/workbench_composite_info.hh index 030be382a14..f577ae197b4 100644 --- a/source/blender/draw/engines/workbench/shaders/infos/workbench_composite_info.hh +++ b/source/blender/draw/engines/workbench/shaders/infos/workbench_composite_info.hh @@ -9,7 +9,7 @@ GPU_SHADER_CREATE_INFO(workbench_composite) .sampler(0, ImageType::FLOAT_2D, "normalBuffer", Frequency::PASS) .sampler(1, ImageType::FLOAT_2D, "materialBuffer", Frequency::PASS) .uniform_buf(4, "WorldData", "world_data", Frequency::PASS) - .push_constant(0, Type::BOOL, "forceShadowing") + .push_constant(Type::BOOL, "forceShadowing") .fragment_out(0, Type::VEC4, "fragColor") .typedef_source("workbench_shader_shared.h") .fragment_source("workbench_composite_frag.glsl") diff --git a/source/blender/draw/engines/workbench/shaders/infos/workbench_effect_antialiasing_info.hh b/source/blender/draw/engines/workbench/shaders/infos/workbench_effect_antialiasing_info.hh index 00978b5c43b..3e0124546b0 100644 --- a/source/blender/draw/engines/workbench/shaders/infos/workbench_effect_antialiasing_info.hh +++ b/source/blender/draw/engines/workbench/shaders/infos/workbench_effect_antialiasing_info.hh @@ -7,7 +7,7 @@ GPU_SHADER_CREATE_INFO(workbench_taa) .sampler(0, ImageType::FLOAT_2D, "colorBuffer") - .push_constant(0, Type::FLOAT, "samplesWeights", 9) + .push_constant(Type::FLOAT, "samplesWeights", 9) .fragment_out(0, Type::VEC4, "fragColor") .fragment_source("workbench_effect_taa_frag.glsl") .additional_info("draw_fullscreen") @@ -31,7 +31,7 @@ GPU_SHADER_CREATE_INFO(workbench_smaa) .define("SMAA_LUMA_WEIGHT", "float4(1.0, 1.0, 1.0, 1.0)") .define("SMAA_NO_DISCARD") .vertex_out(workbench_smaa_iface) - .push_constant(1, Type::VEC4, "viewportMetrics") + .push_constant(Type::VEC4, "viewportMetrics") .vertex_source("workbench_effect_smaa_vert.glsl") .fragment_source("workbench_effect_smaa_frag.glsl"); @@ -55,8 +55,8 @@ GPU_SHADER_CREATE_INFO(workbench_smaa_stage_2) .define("SMAA_STAGE", "2") .sampler(0, ImageType::FLOAT_2D, "colorTex") .sampler(1, ImageType::FLOAT_2D, "blendTex") - .push_constant(2, Type::FLOAT, "mixFactor") - .push_constant(3, Type::FLOAT, "taaAccumulatedWeight") + .push_constant(Type::FLOAT, "mixFactor") + .push_constant(Type::FLOAT, "taaAccumulatedWeight") .fragment_out(0, Type::VEC4, "out_color") .additional_info("workbench_smaa") .do_static_compilation(true); diff --git a/source/blender/draw/engines/workbench/shaders/infos/workbench_effect_dof_info.hh b/source/blender/draw/engines/workbench/shaders/infos/workbench_effect_dof_info.hh index a885fca6f07..252a7d4f3a3 100644 --- a/source/blender/draw/engines/workbench/shaders/infos/workbench_effect_dof_info.hh +++ b/source/blender/draw/engines/workbench/shaders/infos/workbench_effect_dof_info.hh @@ -11,10 +11,10 @@ GPU_SHADER_CREATE_INFO(workbench_effect_dof) .sampler(5, ImageType::FLOAT_2D, "halfResColorTex") .sampler(6, ImageType::FLOAT_2D, "blurTex") .sampler(7, ImageType::FLOAT_2D, "noiseTex") - .push_constant(0, Type::VEC2, "invertedViewportSize") - .push_constant(1, Type::VEC2, "nearFar") - .push_constant(2, Type::VEC3, "dofParams") - .push_constant(3, Type::FLOAT, "noiseOffset") + .push_constant(Type::VEC2, "invertedViewportSize") + .push_constant(Type::VEC2, "nearFar") + .push_constant(Type::VEC3, "dofParams") + .push_constant(Type::FLOAT, "noiseOffset") .fragment_source("workbench_effect_dof_frag.glsl") .additional_info("draw_fullscreen") .additional_info("draw_view"); diff --git a/source/blender/draw/engines/workbench/shaders/infos/workbench_prepass_info.hh b/source/blender/draw/engines/workbench/shaders/infos/workbench_prepass_info.hh index 5e3b593ee6f..29eadc8048a 100644 --- a/source/blender/draw/engines/workbench/shaders/infos/workbench_prepass_info.hh +++ b/source/blender/draw/engines/workbench/shaders/infos/workbench_prepass_info.hh @@ -36,15 +36,15 @@ GPU_SHADER_CREATE_INFO(workbench_texture_none).define("TEXTURE_NONE"); GPU_SHADER_CREATE_INFO(workbench_texture_single) .sampler(2, ImageType::FLOAT_2D, "imageTexture", Frequency::BATCH) - .push_constant(1, Type::BOOL, "imagePremult") - .push_constant(2, Type::FLOAT, "imageTransparencyCutoff") + .push_constant(Type::BOOL, "imagePremult") + .push_constant(Type::FLOAT, "imageTransparencyCutoff") .define("V3D_SHADING_TEXTURE_COLOR"); GPU_SHADER_CREATE_INFO(workbench_texture_tile) .sampler(2, ImageType::FLOAT_2D_ARRAY, "imageTileArray", Frequency::BATCH) .sampler(3, ImageType::FLOAT_1D_ARRAY, "imageTileData", Frequency::BATCH) - .push_constant(1, Type::BOOL, "imagePremult") - .push_constant(2, Type::FLOAT, "imageTransparencyCutoff") + .push_constant(Type::BOOL, "imagePremult") + .push_constant(Type::FLOAT, "imageTransparencyCutoff") .define("V3D_SHADING_TEXTURE_COLOR") .define("TEXTURE_IMAGE_ARRAY"); @@ -79,8 +79,8 @@ GPU_SHADER_INTERFACE_INFO(workbench_material_iface, "") GPU_SHADER_CREATE_INFO(workbench_material) .uniform_buf(4, "WorldData", "world_data", Frequency::PASS) .uniform_buf(5, "vec4", "materials_data[4096]", Frequency::PASS) - .push_constant(4, Type::INT, "materialIndex") - .push_constant(5, Type::BOOL, "useMatcap") + .push_constant(Type::INT, "materialIndex") + .push_constant(Type::BOOL, "useMatcap") .vertex_out(workbench_material_iface); /** \} */ @@ -95,7 +95,7 @@ GPU_SHADER_CREATE_INFO(workbench_transparent_accum) .fragment_out(0, Type::VEC4, "transparentAccum") .fragment_out(1, Type::VEC4, "revealageAccum") .fragment_out(2, Type::UINT, "objectId") - .push_constant(3, Type::BOOL, "forceShadowing") + .push_constant(Type::BOOL, "forceShadowing") .typedef_source("workbench_shader_shared.h") .fragment_source("workbench_transparent_accum_frag.glsl"); diff --git a/source/blender/draw/engines/workbench/shaders/infos/workbench_shadow_info.hh b/source/blender/draw/engines/workbench/shaders/infos/workbench_shadow_info.hh index 64f491aa201..c26d3c3aaf8 100644 --- a/source/blender/draw/engines/workbench/shaders/infos/workbench_shadow_info.hh +++ b/source/blender/draw/engines/workbench/shaders/infos/workbench_shadow_info.hh @@ -13,8 +13,8 @@ GPU_SHADER_INTERFACE_INFO(workbench_shadow_iface, "vData") GPU_SHADER_CREATE_INFO(workbench_shadow_common) .vertex_in(0, Type::VEC3, "pos") .vertex_out(workbench_shadow_iface) - .push_constant(0, Type::FLOAT, "lightDistance") - .push_constant(1, Type::VEC3, "lightDirection") + .push_constant(Type::FLOAT, "lightDistance") + .push_constant(Type::VEC3, "lightDirection") .vertex_source("workbench_shadow_vert.glsl") .additional_info("draw_mesh"); diff --git a/source/blender/draw/engines/workbench/shaders/infos/workbench_volume_info.hh b/source/blender/draw/engines/workbench/shaders/infos/workbench_volume_info.hh index f212ba9ec1d..dd9492481ec 100644 --- a/source/blender/draw/engines/workbench/shaders/infos/workbench_volume_info.hh +++ b/source/blender/draw/engines/workbench/shaders/infos/workbench_volume_info.hh @@ -10,10 +10,10 @@ GPU_SHADER_CREATE_INFO(workbench_volume) .fragment_out(0, Type::VEC4, "fragColor") .sampler(0, ImageType::DEPTH_2D, "depthBuffer") .sampler(1, ImageType::FLOAT_3D, "densityTexture") - .push_constant(28, Type::INT, "samplesLen") - .push_constant(29, Type::FLOAT, "noiseOfs") - .push_constant(30, Type::FLOAT, "stepLength") - .push_constant(31, Type::FLOAT, "densityScale") + .push_constant(Type::INT, "samplesLen") + .push_constant(Type::FLOAT, "noiseOfs") + .push_constant(Type::FLOAT, "stepLength") + .push_constant(Type::FLOAT, "densityScale") .vertex_source("workbench_volume_vert.glsl") .fragment_source("workbench_volume_frag.glsl") .additional_info("draw_object_infos"); @@ -32,9 +32,9 @@ GPU_SHADER_CREATE_INFO(workbench_volume_smoke) GPU_SHADER_CREATE_INFO(workbench_volume_object) .define("VOLUME_OBJECT") - .push_constant(0, Type::MAT4, "volumeTextureToObject") + .push_constant(Type::MAT4, "volumeTextureToObject") /* FIXME(fclem): This overflow the push_constant limit. */ - .push_constant(16, Type::MAT4, "volumeObjectToTexture") + .push_constant(Type::MAT4, "volumeObjectToTexture") .additional_info("draw_volume", "draw_resource_id_varying"); /** \} */ @@ -47,15 +47,15 @@ GPU_SHADER_CREATE_INFO(workbench_volume_coba) .define("USE_COBA") .sampler(4, ImageType::UINT_3D, "flagTexture") .sampler(5, ImageType::FLOAT_1D, "transferTexture") - .push_constant(18, Type::BOOL, "showPhi") - .push_constant(19, Type::BOOL, "showFlags") - .push_constant(20, Type::BOOL, "showPressure") - .push_constant(21, Type::FLOAT, "gridScale"); + .push_constant(Type::BOOL, "showPhi") + .push_constant(Type::BOOL, "showFlags") + .push_constant(Type::BOOL, "showPressure") + .push_constant(Type::FLOAT, "gridScale"); GPU_SHADER_CREATE_INFO(workbench_volume_no_coba) .sampler(4, ImageType::FLOAT_3D, "shadowTexture") .sampler(5, ImageType::UINT_2D, "transferTexture") - .push_constant(18, Type::VEC3, "activeColor"); + .push_constant(Type::VEC3, "activeColor"); /** \} */ @@ -79,8 +79,8 @@ GPU_SHADER_CREATE_INFO(workbench_volume_slice) .define("VOLUME_SLICE") .vertex_in(1, Type::VEC3, "uvs") .vertex_out(workbench_volume_iface) - .push_constant(32, Type::INT, "sliceAxis") /* -1 is no slice. */ - .push_constant(33, Type::FLOAT, "slicePosition"); + .push_constant(Type::INT, "sliceAxis") /* -1 is no slice. */ + .push_constant(Type::FLOAT, "slicePosition"); /** \} */ diff --git a/source/blender/draw/intern/shaders/draw_hair_refine_info.hh b/source/blender/draw/intern/shaders/draw_hair_refine_info.hh index 3c1af1bf759..b41be7d8605 100644 --- a/source/blender/draw/intern/shaders/draw_hair_refine_info.hh +++ b/source/blender/draw/intern/shaders/draw_hair_refine_info.hh @@ -29,14 +29,14 @@ GPU_SHADER_CREATE_INFO(draw_hair_refine_compute) .sampler(0, ImageType::FLOAT_BUFFER, "hairPointBuffer") .sampler(1, ImageType::UINT_BUFFER, "hairStrandBuffer") .sampler(2, ImageType::UINT_BUFFER, "hairStrandSegBuffer") - .push_constant(0, Type::VEC4, "hairDupliMatrix", 4) - .push_constant(16, Type::BOOL, "hairCloseTip") - .push_constant(17, Type::FLOAT, "hairRadShape") - .push_constant(18, Type::FLOAT, "hairRadTip") - .push_constant(19, Type::FLOAT, "hairRadRoot") - .push_constant(20, Type::INT, "hairThicknessRes") - .push_constant(21, Type::INT, "hairStrandsRes") - .push_constant(22, Type::INT, "hairStrandOffset") + .push_constant(Type::VEC4, "hairDupliMatrix", 4) + .push_constant(Type::BOOL, "hairCloseTip") + .push_constant(Type::FLOAT, "hairRadShape") + .push_constant(Type::FLOAT, "hairRadTip") + .push_constant(Type::FLOAT, "hairRadRoot") + .push_constant(Type::INT, "hairThicknessRes") + .push_constant(Type::INT, "hairStrandsRes") + .push_constant(Type::INT, "hairStrandOffset") .compute_source("common_hair_refine_comp.glsl") .define("HAIR_PHASE_SUBDIV") .do_static_compilation(true); diff --git a/source/blender/draw/intern/shaders/draw_view_info.hh b/source/blender/draw/intern/shaders/draw_view_info.hh index d40f51df543..0a25059ffed 100644 --- a/source/blender/draw/intern/shaders/draw_view_info.hh +++ b/source/blender/draw/intern/shaders/draw_view_info.hh @@ -26,7 +26,7 @@ GPU_SHADER_CREATE_INFO(draw_resource_id_varying) /* Variation used when drawing multiple instances for one object. */ GPU_SHADER_CREATE_INFO(draw_resource_id_uniform) .define("UNIFORM_RESOURCE_ID") - .push_constant(64, Type::INT, "drw_ResourceID"); + .push_constant(Type::INT, "drw_ResourceID"); /** * Declare a resource handle that identify a unique object. @@ -34,7 +34,7 @@ GPU_SHADER_CREATE_INFO(draw_resource_id_uniform) */ GPU_SHADER_CREATE_INFO(draw_resource_handle) .define("resource_handle (drw_resourceChunk * DRW_RESOURCE_CHUNK_LEN + resource_id)") - .push_constant(63, Type::INT, "drw_resourceChunk"); + .push_constant(Type::INT, "drw_resourceChunk"); /** \} */ @@ -54,13 +54,13 @@ GPU_SHADER_CREATE_INFO(draw_modelmat) GPU_SHADER_CREATE_INFO(draw_modelmat_legacy) .define("DRW_LEGACY_MODEL_MATRIX") - .push_constant(38, Type::MAT4, "ModelMatrix") - .push_constant(54, Type::MAT4, "ModelMatrixInverse") + .push_constant(Type::MAT4, "ModelMatrix") + .push_constant(Type::MAT4, "ModelMatrixInverse") .additional_info("draw_view"); GPU_SHADER_CREATE_INFO(draw_modelmat_instanced_attr) - .push_constant(0, Type::MAT4, "ModelMatrix") - .push_constant(16, Type::MAT4, "ModelMatrixInverse") + .push_constant(Type::MAT4, "ModelMatrix") + .push_constant(Type::MAT4, "ModelMatrixInverse") .additional_info("draw_view"); /** \} */ @@ -84,14 +84,14 @@ GPU_SHADER_CREATE_INFO(draw_hair) .sampler(14, ImageType::UINT_BUFFER, "hairStrandBuffer") .sampler(13, ImageType::UINT_BUFFER, "hairStrandSegBuffer") /* TODO(fclem) Pack thoses into one UBO. */ - .push_constant(9, Type::INT, "hairStrandsRes") - .push_constant(10, Type::INT, "hairThicknessRes") - .push_constant(11, Type::FLOAT, "hairRadRoot") - .push_constant(12, Type::FLOAT, "hairRadTip") - .push_constant(13, Type::FLOAT, "hairRadShape") - .push_constant(14, Type::BOOL, "hairCloseTip") - .push_constant(15, Type::INT, "hairStrandOffset") - .push_constant(16, Type::VEC4, "hairDupliMatrix", 4) + .push_constant(Type::INT, "hairStrandsRes") + .push_constant(Type::INT, "hairThicknessRes") + .push_constant(Type::FLOAT, "hairRadRoot") + .push_constant(Type::FLOAT, "hairRadTip") + .push_constant(Type::FLOAT, "hairRadShape") + .push_constant(Type::BOOL, "hairCloseTip") + .push_constant(Type::INT, "hairStrandOffset") + .push_constant(Type::VEC4, "hairDupliMatrix", 4) .additional_info("draw_modelmat", "draw_resource_id"); GPU_SHADER_CREATE_INFO(draw_pointcloud) diff --git a/source/blender/gpu/intern/gpu_shader_create_info.hh b/source/blender/gpu/intern/gpu_shader_create_info.hh index 6236e92a226..63c6e94f4c8 100644 --- a/source/blender/gpu/intern/gpu_shader_create_info.hh +++ b/source/blender/gpu/intern/gpu_shader_create_info.hh @@ -314,7 +314,6 @@ struct ShaderCreateInfo { Vector<StageInterfaceInfo *> geometry_out_interfaces_; struct PushConst { - int index; Type type; StringRefNull name; int array_size; @@ -503,22 +502,14 @@ struct ShaderCreateInfo { /** \name Push constants * * Data managed by GPUShader. Can be set through uniform functions. Must be less than 128bytes. - * One slot represents 4bytes. Each element needs to have enough empty space left after it. - * example: - * [0] = PUSH_CONSTANT(MAT4, "ModelMatrix"), - * ---- 16 slots occupied by ModelMatrix ---- - * [16] = PUSH_CONSTANT(VEC4, "color"), - * ---- 4 slots occupied by color ---- - * [20] = PUSH_CONSTANT(BOOL, "srgbToggle"), - * The maximum slot is 31. * \{ */ - Self &push_constant(int slot, Type type, StringRefNull name, int array_size = 0) + Self &push_constant(Type type, StringRefNull name, int array_size = 0) { BLI_assert_msg(name.find("[") == -1, "Array syntax is forbidden for push constants." "Use the array_size parameter instead."); - push_constants_.append({slot, type, name, array_size}); + push_constants_.append({type, name, array_size}); interface_names_size_ += name.size() + 1; return *(Self *)this; } diff --git a/source/blender/gpu/opengl/gl_shader.cc b/source/blender/gpu/opengl/gl_shader.cc index 1e6e2475665..d1ef6448791 100644 --- a/source/blender/gpu/opengl/gl_shader.cc +++ b/source/blender/gpu/opengl/gl_shader.cc @@ -409,9 +409,6 @@ std::string GLShader::resources_declare(const ShaderCreateInfo &info) const } ss << "\n/* Push Constants. */\n"; for (const ShaderCreateInfo::PushConst &uniform : info.push_constants_) { - if (GLContext::explicit_location_support) { - ss << "layout(location = " << uniform.index << ") "; - } ss << "uniform " << to_string(uniform.type) << " " << uniform.name; if (uniform.array_size > 0) { ss << "[" << uniform.array_size << "]"; diff --git a/source/blender/gpu/opengl/gl_shader_interface.cc b/source/blender/gpu/opengl/gl_shader_interface.cc index 299ea150408..71b908665d3 100644 --- a/source/blender/gpu/opengl/gl_shader_interface.cc +++ b/source/blender/gpu/opengl/gl_shader_interface.cc @@ -437,10 +437,7 @@ GLShaderInterface::GLShaderInterface(GLuint program, const shader::ShaderCreateI } for (const ShaderCreateInfo::PushConst &uni : info.push_constants_) { copy_input_name(input, uni.name, name_buffer_, name_buffer_offset); - /* Until we make use of explicit uniform location. */ - if (true || !GLContext::explicit_location_support) { - input->location = glGetUniformLocation(program, name_buffer_ + input->name_offset); - } + input->location = glGetUniformLocation(program, name_buffer_ + input->name_offset); input->binding = -1; input++; } diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_area_borders_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_area_borders_info.hh index bf746eae9b4..b5dce51fc1b 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_2D_area_borders_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_area_borders_info.hh @@ -29,11 +29,11 @@ GPU_SHADER_CREATE_INFO(gpu_shader_2D_area_borders) .vertex_in(0, Type::VEC2, "pos") .vertex_out(smooth_uv_iface) .fragment_out(0, Type::VEC4, "fragColor") - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") - .push_constant(16, Type::VEC4, "rect") - .push_constant(20, Type::VEC4, "color") - .push_constant(24, Type::FLOAT, "scale") - .push_constant(25, Type::INT, "cornerLen") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::VEC4, "rect") + .push_constant(Type::VEC4, "color") + .push_constant(Type::FLOAT, "scale") + .push_constant(Type::INT, "cornerLen") .vertex_source("gpu_shader_2D_area_borders_vert.glsl") .fragment_source("gpu_shader_2D_area_borders_frag.glsl") .do_static_compilation(true); diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_checker_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_checker_info.hh index 48c261da8dd..b8dbca276ae 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_2D_checker_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_checker_info.hh @@ -26,10 +26,10 @@ GPU_SHADER_CREATE_INFO(gpu_shader_2D_checker) .vertex_in(0, Type::VEC2, "pos") .fragment_out(0, Type::VEC4, "fragColor") - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") - .push_constant(16, Type::VEC4, "color1") - .push_constant(20, Type::VEC4, "color2") - .push_constant(24, Type::INT, "size") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::VEC4, "color1") + .push_constant(Type::VEC4, "color2") + .push_constant(Type::INT, "size") .vertex_source("gpu_shader_2D_vert.glsl") .fragment_source("gpu_shader_checker_frag.glsl") .do_static_compilation(true); diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_diag_stripes_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_diag_stripes_info.hh index 51ce7f503df..b52be8b328e 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_2D_diag_stripes_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_diag_stripes_info.hh @@ -26,11 +26,11 @@ GPU_SHADER_CREATE_INFO(gpu_shader_2D_diag_stripes) .vertex_in(0, Type::VEC2, "pos") .fragment_out(0, Type::VEC4, "fragColor") - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") - .push_constant(16, Type::VEC4, "color1") - .push_constant(20, Type::VEC4, "color2") - .push_constant(24, Type::INT, "size1") - .push_constant(28, Type::INT, "size2") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::VEC4, "color1") + .push_constant(Type::VEC4, "color2") + .push_constant(Type::INT, "size1") + .push_constant(Type::INT, "size2") .vertex_source("gpu_shader_2D_vert.glsl") .fragment_source("gpu_shader_diag_stripes_frag.glsl") .do_static_compilation(true); diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_flat_color_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_flat_color_info.hh index bbc5446f16f..699b0a456f9 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_2D_flat_color_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_flat_color_info.hh @@ -30,7 +30,7 @@ GPU_SHADER_CREATE_INFO(gpu_shader_2D_flat_color) .vertex_in(1, Type::VEC4, "color") .vertex_out(flat_color_iface) .fragment_out(0, Type::VEC4, "fragColor") - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") .vertex_source("gpu_shader_2D_flat_color_vert.glsl") .fragment_source("gpu_shader_flat_color_frag.glsl") .additional_info("gpu_srgb_to_framebuffer_space") diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_color_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_color_info.hh index a6cc9076d4a..8ac9f58d936 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_color_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_color_info.hh @@ -25,6 +25,6 @@ GPU_SHADER_CREATE_INFO(gpu_shader_2D_image_color) .additional_info("gpu_shader_2D_image_common") - .push_constant(16, Type::VEC4, "color") + .push_constant(Type::VEC4, "color") .fragment_source("gpu_shader_image_color_frag.glsl") .do_static_compilation(true); diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_desaturate_color_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_desaturate_color_info.hh index e11d6746446..3e10c0e1651 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_desaturate_color_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_desaturate_color_info.hh @@ -25,7 +25,7 @@ GPU_SHADER_CREATE_INFO(gpu_shader_2D_image_desaturate_color) .additional_info("gpu_shader_2D_image_common") - .push_constant(16, Type::VEC4, "color") - .push_constant(20, Type::FLOAT, "factor") + .push_constant(Type::VEC4, "color") + .push_constant(Type::FLOAT, "factor") .fragment_source("gpu_shader_image_desaturate_frag.glsl") .do_static_compilation(true); diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_info.hh index 3d20b63c265..989e38527c0 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_info.hh @@ -29,7 +29,7 @@ GPU_SHADER_CREATE_INFO(gpu_shader_2D_image_common) .vertex_in(1, Type::VEC2, "texCoord") .vertex_out(smooth_tex_coord_interp_iface) .fragment_out(0, Type::VEC4, "fragColor") - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") .sampler(0, ImageType::FLOAT_2D, "image") .vertex_source("gpu_shader_2D_image_vert.glsl"); diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_overlays_merge_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_overlays_merge_info.hh index c2c0e9fec78..d1a2a8f6ee7 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_overlays_merge_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_overlays_merge_info.hh @@ -29,9 +29,9 @@ GPU_SHADER_CREATE_INFO(gpu_shader_2D_image_overlays_merge) .vertex_in(1, Type::VEC2, "texCoord") .vertex_out(smooth_tex_coord_interp_iface) .fragment_out(0, Type::VEC4, "fragColor") - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") - .push_constant(16, Type::BOOL, "display_transform") - .push_constant(17, Type::BOOL, "overlay") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::BOOL, "display_transform") + .push_constant(Type::BOOL, "overlay") .sampler(0, ImageType::FLOAT_2D, "image_texture") .sampler(1, ImageType::FLOAT_2D, "overlays_texture") .vertex_source("gpu_shader_2D_image_vert.glsl") diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_overlays_stereo_merge_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_overlays_stereo_merge_info.hh index c1e6c3957d3..d099d95e4b6 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_overlays_stereo_merge_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_overlays_stereo_merge_info.hh @@ -29,8 +29,8 @@ GPU_SHADER_CREATE_INFO(gpu_shader_2D_image_overlays_stereo_merge) .fragment_out(1, Type::VEC4, "overlayColor") .sampler(0, ImageType::FLOAT_2D, "imageTexture") .sampler(1, ImageType::FLOAT_2D, "overlayTexture") - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") - .push_constant(16, Type::INT, "stereoDisplaySettings") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::INT, "stereoDisplaySettings") .vertex_source("gpu_shader_2D_vert.glsl") .fragment_source("gpu_shader_image_overlays_stereo_merge_frag.glsl") .do_static_compilation(true); diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_rect_color_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_rect_color_info.hh index 4e10b91ef39..9d5fb152561 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_rect_color_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_rect_color_info.hh @@ -27,10 +27,10 @@ GPU_SHADER_CREATE_INFO(gpu_shader_2D_image_rect_color) .vertex_out(smooth_tex_coord_interp_iface) .fragment_out(0, Type::VEC4, "fragColor") - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") - .push_constant(16, Type::VEC4, "color") - .push_constant(20, Type::VEC4, "rect_icon") - .push_constant(24, Type::VEC4, "rect_geom") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::VEC4, "color") + .push_constant(Type::VEC4, "rect_icon") + .push_constant(Type::VEC4, "rect_geom") .sampler(0, ImageType::FLOAT_2D, "image") .vertex_source("gpu_shader_2D_image_rect_vert.glsl") .fragment_source("gpu_shader_image_color_frag.glsl") diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_shuffle_color_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_shuffle_color_info.hh index 3663de0a98f..93950b37509 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_shuffle_color_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_shuffle_color_info.hh @@ -25,7 +25,7 @@ GPU_SHADER_CREATE_INFO(gpu_shader_2D_image_shuffle_color) .additional_info("gpu_shader_2D_image_common") - .push_constant(16, Type::VEC4, "color") - .push_constant(20, Type::VEC4, "shuffle") + .push_constant(Type::VEC4, "color") + .push_constant(Type::VEC4, "shuffle") .fragment_source("gpu_shader_image_shuffle_color_frag.glsl") .do_static_compilation(true); diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_line_dashed_uniform_color_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_line_dashed_uniform_color_info.hh index 371a35386a7..afac24e6241 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_2D_line_dashed_uniform_color_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_line_dashed_uniform_color_info.hh @@ -28,7 +28,7 @@ GPU_SHADER_CREATE_INFO(gpu_shader_2D_line_dashed_uniform_color) .vertex_in(0, Type::VEC3, "pos") .vertex_out(flat_color_iface) - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") .vertex_source("gpu_shader_2D_line_dashed_uniform_color_vert.glsl") .fragment_source("gpu_shader_2D_line_dashed_frag.glsl") .do_static_compilation(true); diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_nodelink_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_nodelink_info.hh index b15d7ba3ada..15451899d5d 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_2D_nodelink_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_nodelink_info.hh @@ -39,7 +39,7 @@ GPU_SHADER_CREATE_INFO(gpu_shader_2D_nodelink) .vertex_out(nodelink_iface) .fragment_out(0, Type::VEC4, "fragColor") .uniform_buf(0, "NodeLinkData", "node_link_data", Frequency::PASS) - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") .vertex_source("gpu_shader_2D_nodelink_vert.glsl") .fragment_source("gpu_shader_2D_nodelink_frag.glsl") .typedef_source("GPU_shader_shared.h") @@ -64,7 +64,7 @@ GPU_SHADER_CREATE_INFO(gpu_shader_2D_nodelink_inst) .vertex_out(nodelink_iface) .fragment_out(0, Type::VEC4, "fragColor") .uniform_buf(0, "NodeLinkInstanceData", "node_link_data", Frequency::PASS) - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") .vertex_source("gpu_shader_2D_nodelink_vert.glsl") .fragment_source("gpu_shader_2D_nodelink_frag.glsl") .typedef_source("GPU_shader_shared.h") diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_point_uniform_size_uniform_color_aa_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_point_uniform_size_uniform_color_aa_info.hh index d2753af8e9b..2a3d5698ba4 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_2D_point_uniform_size_uniform_color_aa_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_point_uniform_size_uniform_color_aa_info.hh @@ -28,9 +28,9 @@ GPU_SHADER_CREATE_INFO(gpu_shader_2D_point_uniform_size_uniform_color_aa) .vertex_in(0, Type::VEC2, "pos") .vertex_out(smooth_radii_iface) .fragment_out(0, Type::VEC4, "fragColor") - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") - .push_constant(16, Type::VEC4, "color") - .push_constant(20, Type::FLOAT, "size") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::VEC4, "color") + .push_constant(Type::FLOAT, "size") .vertex_source("gpu_shader_2D_point_uniform_size_aa_vert.glsl") .fragment_source("gpu_shader_point_uniform_color_aa_frag.glsl") .do_static_compilation(true); diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_point_uniform_size_uniform_color_outline_aa_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_point_uniform_size_uniform_color_outline_aa_info.hh index edc83534573..c7cc61e745b 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_2D_point_uniform_size_uniform_color_outline_aa_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_point_uniform_size_uniform_color_outline_aa_info.hh @@ -28,11 +28,11 @@ GPU_SHADER_CREATE_INFO(gpu_shader_2D_point_uniform_size_uniform_color_outline_aa .vertex_in(0, Type::VEC2, "pos") .vertex_out(smooth_radii_outline_iface) .fragment_out(0, Type::VEC4, "fragColor") - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") - .push_constant(20, Type::VEC4, "color") - .push_constant(24, Type::VEC4, "outlineColor") - .push_constant(28, Type::FLOAT, "size") - .push_constant(29, Type::FLOAT, "outlineWidth") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::VEC4, "color") + .push_constant(Type::VEC4, "outlineColor") + .push_constant(Type::FLOAT, "size") + .push_constant(Type::FLOAT, "outlineWidth") .vertex_source("gpu_shader_2D_point_uniform_size_outline_aa_vert.glsl") .fragment_source("gpu_shader_point_uniform_color_outline_aa_frag.glsl") .do_static_compilation(true); diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_point_varying_size_varying_color_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_point_varying_size_varying_color_info.hh index 4358e94f91f..38dddb4357e 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_2D_point_varying_size_varying_color_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_point_varying_size_varying_color_info.hh @@ -30,7 +30,7 @@ GPU_SHADER_CREATE_INFO(gpu_shader_2D_point_varying_size_varying_color) .vertex_in(2, Type::VEC4, "color") .vertex_out(smooth_color_iface) .fragment_out(0, Type::VEC4, "fragColor") - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") .vertex_source("gpu_shader_2D_point_varying_size_varying_color_vert.glsl") .fragment_source("gpu_shader_point_varying_color_frag.glsl") .do_static_compilation(true); diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_smooth_color_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_smooth_color_info.hh index 0029e8d2044..128be12a7d9 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_2D_smooth_color_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_smooth_color_info.hh @@ -29,7 +29,7 @@ GPU_SHADER_CREATE_INFO(gpu_shader_2D_smooth_color) .vertex_in(1, Type::VEC4, "color") .vertex_out(smooth_color_iface) .fragment_out(0, Type::VEC4, "fragColor") - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") .vertex_source("gpu_shader_2D_smooth_color_vert.glsl") .fragment_source("gpu_shader_2D_smooth_color_frag.glsl") .additional_info("gpu_srgb_to_framebuffer_space") diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_uniform_color_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_uniform_color_info.hh index 7e75b265711..3dab6d36753 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_2D_uniform_color_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_uniform_color_info.hh @@ -26,8 +26,8 @@ GPU_SHADER_CREATE_INFO(gpu_shader_2D_uniform_color) .vertex_in(0, Type::VEC2, "pos") .fragment_out(0, Type::VEC4, "fragColor") - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") - .push_constant(16, Type::VEC4, "color") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::VEC4, "color") .vertex_source("gpu_shader_2D_vert.glsl") .fragment_source("gpu_shader_uniform_color_frag.glsl") .additional_info("gpu_srgb_to_framebuffer_space") diff --git a/source/blender/gpu/shaders/infos/gpu_shader_3D_depth_only_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_3D_depth_only_info.hh index 3e7e4aeecda..63a4e679215 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_3D_depth_only_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_3D_depth_only_info.hh @@ -27,7 +27,7 @@ GPU_SHADER_CREATE_INFO(gpu_shader_3D_depth_only) .vertex_in(0, Type::VEC3, "pos") .vertex_out(flat_color_iface) - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") .vertex_source("gpu_shader_3D_vert.glsl") .fragment_source("gpu_shader_depth_only_frag.glsl") .do_static_compilation(true); diff --git a/source/blender/gpu/shaders/infos/gpu_shader_3D_flat_color_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_3D_flat_color_info.hh index 14a6986f478..4628f8bd6c4 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_3D_flat_color_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_3D_flat_color_info.hh @@ -29,7 +29,7 @@ GPU_SHADER_CREATE_INFO(gpu_shader_3D_flat_color) .vertex_in(1, Type::VEC4, "color") .vertex_out(flat_color_iface) .fragment_out(0, Type::VEC4, "fragColor") - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") .vertex_source("gpu_shader_3D_flat_color_vert.glsl") .fragment_source("gpu_shader_flat_color_frag.glsl") .additional_info("gpu_srgb_to_framebuffer_space") diff --git a/source/blender/gpu/shaders/infos/gpu_shader_3D_image_modulate_alpha_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_3D_image_modulate_alpha_info.hh index b829975448c..d47df129501 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_3D_image_modulate_alpha_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_3D_image_modulate_alpha_info.hh @@ -29,8 +29,8 @@ GPU_SHADER_CREATE_INFO(gpu_shader_3D_image_modulate_alpha) .vertex_in(1, Type::VEC2, "texCoord") .vertex_out(smooth_tex_coord_interp_iface) .fragment_out(0, Type::VEC4, "fragColor") - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") - .push_constant(16, Type::FLOAT, "alpha") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::FLOAT, "alpha") .sampler(0, ImageType::FLOAT_2D, "image", Frequency::PASS) .vertex_source("gpu_shader_3D_image_vert.glsl") .fragment_source("gpu_shader_image_modulate_alpha_frag.glsl") diff --git a/source/blender/gpu/shaders/infos/gpu_shader_3D_line_dashed_uniform_color_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_3D_line_dashed_uniform_color_info.hh index d43ea799420..62c05d4677c 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_3D_line_dashed_uniform_color_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_3D_line_dashed_uniform_color_info.hh @@ -28,7 +28,7 @@ GPU_SHADER_CREATE_INFO(gpu_shader_3D_line_dashed_uniform_color) .vertex_in(0, Type::VEC3, "pos") .vertex_out(flat_color_iface) - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") .vertex_source("gpu_shader_3D_line_dashed_uniform_color_vert.glsl") .fragment_source("gpu_shader_2D_line_dashed_frag.glsl") .do_static_compilation(true); diff --git a/source/blender/gpu/shaders/infos/gpu_shader_3D_point_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_3D_point_info.hh index 27357eef8c9..d7b6806acc6 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_3D_point_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_3D_point_info.hh @@ -28,7 +28,7 @@ GPU_SHADER_CREATE_INFO(gpu_shader_3D_point_fixed_size_varying_color) .vertex_in(1, Type::VEC4, "color") .vertex_out(smooth_color_iface) .fragment_out(0, Type::VEC4, "fragColor") - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") .vertex_source("gpu_shader_3D_point_fixed_size_varying_color_vert.glsl") .fragment_source("gpu_shader_point_varying_color_frag.glsl") .do_static_compilation(true); @@ -39,7 +39,7 @@ GPU_SHADER_CREATE_INFO(gpu_shader_3D_point_varying_size_varying_color) .vertex_in(2, Type::FLOAT, "size") .vertex_out(smooth_color_iface) .fragment_out(0, Type::VEC4, "fragColor") - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") .vertex_source("gpu_shader_3D_point_varying_size_varying_color_vert.glsl") .fragment_source("gpu_shader_point_varying_color_frag.glsl") .do_static_compilation(true); @@ -48,9 +48,9 @@ GPU_SHADER_CREATE_INFO(gpu_shader_3D_point_uniform_size_uniform_color_aa) .vertex_in(0, Type::VEC3, "pos") .vertex_out(smooth_radii_iface) .fragment_out(0, Type::VEC4, "fragColor") - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") - .push_constant(16, Type::VEC4, "color") - .push_constant(20, Type::FLOAT, "size") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::VEC4, "color") + .push_constant(Type::FLOAT, "size") .vertex_source("gpu_shader_3D_point_uniform_size_aa_vert.glsl") .fragment_source("gpu_shader_point_uniform_color_aa_frag.glsl") .do_static_compilation(true); diff --git a/source/blender/gpu/shaders/infos/gpu_shader_3D_smooth_color_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_3D_smooth_color_info.hh index c99d9ed199d..10f6e9a5b83 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_3D_smooth_color_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_3D_smooth_color_info.hh @@ -29,7 +29,7 @@ GPU_SHADER_CREATE_INFO(gpu_shader_3D_smooth_color) .vertex_in(1, Type::VEC4, "color") .vertex_out(smooth_color_iface) .fragment_out(0, Type::VEC4, "fragColor") - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") .vertex_source("gpu_shader_3D_smooth_color_vert.glsl") .fragment_source("gpu_shader_3D_smooth_color_frag.glsl") .additional_info("gpu_srgb_to_framebuffer_space") diff --git a/source/blender/gpu/shaders/infos/gpu_shader_3D_uniform_color_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_3D_uniform_color_info.hh index 5b8517310ea..e96ce8842f1 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_3D_uniform_color_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_3D_uniform_color_info.hh @@ -26,8 +26,8 @@ GPU_SHADER_CREATE_INFO(gpu_shader_3D_uniform_color) .vertex_in(0, Type::VEC3, "pos") .fragment_out(0, Type::VEC4, "fragColor") - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") - .push_constant(16, Type::VEC4, "color") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::VEC4, "color") .vertex_source("gpu_shader_3D_vert.glsl") .fragment_source("gpu_shader_uniform_color_frag.glsl") .additional_info("gpu_srgb_to_framebuffer_space") diff --git a/source/blender/gpu/shaders/infos/gpu_shader_gpencil_stroke_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_gpencil_stroke_info.hh index c337c399f59..460ef3f5acf 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_gpencil_stroke_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_gpencil_stroke_info.hh @@ -41,8 +41,8 @@ GPU_SHADER_CREATE_INFO(gpu_shader_gpencil_stroke) .uniform_buf(0, "GPencilStrokeData", "gpencil_stroke_data") - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") - .push_constant(16, Type::MAT4, "ProjectionMatrix") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::MAT4, "ProjectionMatrix") .vertex_source("gpu_shader_gpencil_stroke_vert.glsl") .geometry_source("gpu_shader_gpencil_stroke_geom.glsl") .fragment_source("gpu_shader_gpencil_stroke_frag.glsl") diff --git a/source/blender/gpu/shaders/infos/gpu_shader_instance_varying_color_varying_size_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_instance_varying_color_varying_size_info.hh index 98a1fcf5b37..418ec0bef2d 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_instance_varying_color_varying_size_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_instance_varying_color_varying_size_info.hh @@ -31,7 +31,7 @@ GPU_SHADER_CREATE_INFO(gpu_shader_instance_varying_color_varying_size) .vertex_in(3, Type::FLOAT, "size") .vertex_out(flat_color_iface) .fragment_out(0, Type::VEC4, "fragColor") - .push_constant(0, Type::MAT4, "ViewProjectionMatrix") + .push_constant(Type::MAT4, "ViewProjectionMatrix") .vertex_source("gpu_shader_instance_variying_size_variying_color_vert.glsl") .fragment_source("gpu_shader_flat_color_frag.glsl") .additional_info("gpu_srgb_to_framebuffer_space") diff --git a/source/blender/gpu/shaders/infos/gpu_shader_keyframe_shape_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_keyframe_shape_info.hh index f8cb94e52d0..bbd3b6a9f01 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_keyframe_shape_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_keyframe_shape_info.hh @@ -38,9 +38,9 @@ GPU_SHADER_CREATE_INFO(gpu_shader_keyframe_shape) .vertex_in(4, Type ::INT, "flags") .vertex_out(keyframe_shape_iface) .fragment_out(0, Type::VEC4, "fragColor") - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") - .push_constant(16, Type::VEC2, "ViewportSize") - .push_constant(24, Type::FLOAT, "outline_scale") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::VEC2, "ViewportSize") + .push_constant(Type::FLOAT, "outline_scale") .vertex_source("gpu_shader_keyframe_shape_vert.glsl") .fragment_source("gpu_shader_keyframe_shape_frag.glsl") .do_static_compilation(true); diff --git a/source/blender/gpu/shaders/infos/gpu_shader_simple_lighting_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_simple_lighting_info.hh index c3f86ed2b6f..8afa7d79f3f 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_simple_lighting_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_simple_lighting_info.hh @@ -32,8 +32,8 @@ GPU_SHADER_CREATE_INFO(gpu_shader_simple_lighting) .vertex_out(smooth_normal_iface) .fragment_out(0, Type::VEC4, "fragColor") .uniform_buf(0, "SimpleLightingData", "simple_lighting_data", Frequency::PASS) - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") - .push_constant(16, Type::MAT3, "NormalMatrix") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::MAT3, "NormalMatrix") .typedef_source("GPU_shader_shared.h") .vertex_source("gpu_shader_3D_normal_vert.glsl") .fragment_source("gpu_shader_simple_lighting_frag.glsl") diff --git a/source/blender/gpu/shaders/infos/gpu_shader_text_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_text_info.hh index 2c17a494d76..9429db66f90 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_text_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_text_info.hh @@ -37,7 +37,7 @@ GPU_SHADER_CREATE_INFO(gpu_shader_text) .vertex_in(3, Type ::INT, "offset") .vertex_out(text_iface) .fragment_out(0, Type::VEC4, "fragColor") - .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix") + .push_constant(Type::MAT4, "ModelViewProjectionMatrix") .sampler(0, ImageType::FLOAT_2D, "glyph", Frequency::PASS) .vertex_source("gpu_shader_text_vert.glsl") .fragment_source("gpu_shader_text_frag.glsl") |