Commit: 7ff47f7a944cb3107af127cf0545d3c0f04b3555 Author: Jason Fielder Date: Wed Dec 21 14:07:19 2022 +0100 Branches: master https://developer.blender.org/rB7ff47f7a944cb3107af127cf0545d3c0f04b3555
Metal: Add missing MIP_SWIZZLE texture usage flags. Fix compilation warnings. Authored by Apple: Michael Parkin-White Ref T96261 Maniphest Tasks: T96261 Differential Revision: https://developer.blender.org/D16824 =================================================================== M source/blender/draw/intern/draw_cache_impl_volume.cc M source/blender/draw/intern/draw_fluid.c M source/blender/editors/sculpt_paint/paint_cursor.cc M source/blender/gpu/metal/mtl_context.hh M source/blender/windowmanager/intern/wm_operators.c =================================================================== diff --git a/source/blender/draw/intern/draw_cache_impl_volume.cc b/source/blender/draw/intern/draw_cache_impl_volume.cc index b22831bf94b..dd89e84ed71 100644 --- a/source/blender/draw/intern/draw_cache_impl_volume.cc +++ b/source/blender/draw/intern/draw_cache_impl_volume.cc @@ -312,7 +312,8 @@ static DRWVolumeGrid *volume_grid_cache_get(const Volume *volume, 1, format, GPU_DATA_FLOAT, - GPU_TEXTURE_USAGE_SHADER_READ, + GPU_TEXTURE_USAGE_SHADER_READ | + GPU_TEXTURE_USAGE_MIP_SWIZZLE_VIEW, dense_grid.voxels); /* The texture can be null if the resolution along one axis is larger than * GL_MAX_3D_TEXTURE_SIZE. */ diff --git a/source/blender/draw/intern/draw_fluid.c b/source/blender/draw/intern/draw_fluid.c index 8975e955530..8fbdb7eec13 100644 --- a/source/blender/draw/intern/draw_fluid.c +++ b/source/blender/draw/intern/draw_fluid.c @@ -184,7 +184,8 @@ static GPUTexture *create_volume_texture(const int dim[3], 1, texture_format, data_format, - GPU_TEXTURE_USAGE_SHADER_READ, + GPU_TEXTURE_USAGE_SHADER_READ | + GPU_TEXTURE_USAGE_MIP_SWIZZLE_VIEW, NULL); if (tex != NULL) { diff --git a/source/blender/editors/sculpt_paint/paint_cursor.cc b/source/blender/editors/sculpt_paint/paint_cursor.cc index d3cea0e5573..43e59aaf4f7 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.cc +++ b/source/blender/editors/sculpt_paint/paint_cursor.cc @@ -334,7 +334,8 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima if (!target->overlay_texture) { eGPUTextureFormat format = col ? GPU_RGBA8 : GPU_R8; - eGPUTextureUsage usage = GPU_TEXTURE_USAGE_SHADER_READ | GPU_TEXTURE_USAGE_ATTACHMENT; + eGPUTextureUsage usage = GPU_TEXTURE_USAGE_SHADER_READ | GPU_TEXTURE_USAGE_ATTACHMENT | + GPU_TEXTURE_USAGE_MIP_SWIZZLE_VIEW; target->overlay_texture = GPU_texture_create_2d_ex( "paint_cursor_overlay", size, size, 1, format, usage, nullptr); GPU_texture_update(target->overlay_texture, GPU_DATA_UBYTE, buffer); @@ -453,7 +454,8 @@ static int load_tex_cursor(Brush *br, ViewContext *vc, float zoom) BLI_task_parallel_range(0, size, &data, load_tex_cursor_task_cb, &settings); if (!cursor_snap.overlay_texture) { - eGPUTextureUsage usage = GPU_TEXTURE_USAGE_SHADER_READ | GPU_TEXTURE_USAGE_ATTACHMENT; + eGPUTextureUsage usage = GPU_TEXTURE_USAGE_SHADER_READ | GPU_TEXTURE_USAGE_ATTACHMENT | + GPU_TEXTURE_USAGE_MIP_SWIZZLE_VIEW; cursor_snap.overlay_texture = GPU_texture_create_2d_ex( "cursor_snap_overaly", size, size, 1, GPU_R8, usage, nullptr); GPU_texture_update(cursor_snap.overlay_texture, GPU_DATA_UBYTE, buffer); diff --git a/source/blender/gpu/metal/mtl_context.hh b/source/blender/gpu/metal/mtl_context.hh index a26e31aadde..e2789dbf9a7 100644 --- a/source/blender/gpu/metal/mtl_context.hh +++ b/source/blender/gpu/metal/mtl_context.hh @@ -658,7 +658,7 @@ class MTLContext : public Context { /** Dummy Resources */ /* Maximum of 32 texture types. Though most combinations invalid. */ - gpu::MTLTexture *dummy_textures_[GPU_SAMPLER_TYPE_MAX][GPU_TEXTURE_BUFFER] = {nullptr}; + gpu::MTLTexture *dummy_textures_[GPU_SAMPLER_TYPE_MAX][GPU_TEXTURE_BUFFER] = {{nullptr}}; GPUVertFormat dummy_vertformat_[GPU_SAMPLER_TYPE_MAX]; GPUVertBuf *dummy_verts_[GPU_SAMPLER_TYPE_MAX] = {nullptr}; diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 8fbf528b8bb..f43b6722550 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -2300,7 +2300,8 @@ static void radial_control_set_tex(RadialControl *rc) ibuf->y, 1, GPU_R8, - GPU_TEXTURE_USAGE_SHADER_READ, + GPU_TEXTURE_USAGE_SHADER_READ | + GPU_TEXTURE_USAGE_MIP_SWIZZLE_VIEW, ibuf->rect_float); GPU_texture_filter_mode(rc->texture, true); _______________________________________________ Bf-blender-cvs mailing list [email protected] List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
