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
This commit is contained in:
parent
b015fc4247
commit
7ff47f7a94
Notes:
blender-bot
2023-02-13 22:39:58 +01:00
Referenced by issue #96261, Metal Viewport
|
@ -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. */
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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};
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue