GPencil: Use global viewport size instead of DRWView one
This is part of the effor to simplify the View struct in order to implement multiview rendering.
This commit is contained in:
@@ -459,6 +459,7 @@ static void gpencil_layer_cache_populate(bGPDlayer *gpl,
|
||||
DRW_shgroup_uniform_texture(grp, "gpStrokeTexture", iter->tex_stroke);
|
||||
DRW_shgroup_uniform_int_copy(grp, "gpMaterialOffset", iter->mat_ofs);
|
||||
DRW_shgroup_uniform_float_copy(grp, "gpStrokeIndexOffset", iter->stroke_index_offset);
|
||||
DRW_shgroup_uniform_vec2_copy(grp, "viewportSize", DRW_viewport_size_get());
|
||||
}
|
||||
|
||||
static void gpencil_stroke_cache_populate(bGPDlayer *gpl,
|
||||
|
||||
@@ -47,7 +47,7 @@ void main()
|
||||
col1,
|
||||
col2,
|
||||
fcol1,
|
||||
vec4(drw_view.viewport_size, drw_view.viewport_size_inverse),
|
||||
vec4(viewportSize, 1.0 / viewportSize),
|
||||
gp_flag,
|
||||
gp_mat._alignment_rot,
|
||||
gp_interp.pos,
|
||||
|
||||
@@ -28,6 +28,7 @@ GPU_SHADER_CREATE_INFO(gpencil_geometry)
|
||||
.sampler(3, ImageType::FLOAT_2D, "gpMaskTexture")
|
||||
.uniform_buf(4, "gpMaterial", "materials[GPENCIL_MATERIAL_BUFFER_LEN]", Frequency::BATCH)
|
||||
.uniform_buf(3, "gpLight", "lights[GPENCIL_LIGHT_BUFFER_LEN]", Frequency::BATCH)
|
||||
.push_constant(Type::VEC2, "viewportSize")
|
||||
/* Per Object */
|
||||
.push_constant(Type::VEC3, "gpNormal")
|
||||
.push_constant(Type::BOOL, "gpStrokeOrder3d")
|
||||
|
||||
Reference in New Issue
Block a user