metal: set texture usage flags

Cette révision appartient à :
Samuliak 2024-04-09 19:59:27 +02:00
Parent f5830983be
révision 2f9fd5d69c
Signature inconnue de Forgejo
2 fichiers modifiés avec 3 ajouts et 1 suppressions

Voir le fichier

@ -63,6 +63,8 @@ Image::Image(TextureCacheRuntime& runtime_, const ImageInfo& info, GPUVAddr gpu_
texture_descriptor->setPixelFormat(MaxwellToMTL::GetPixelFormat(info.format));
texture_descriptor->setWidth(info.size.width);
texture_descriptor->setHeight(info.size.height);
texture_descriptor->setDepth(info.size.depth);
texture_descriptor->setUsage(MTL::TextureUsageShaderRead | MTL::TextureUsageRenderTarget);
// TODO: set other parameters
texture = runtime->device.GetDevice()->newTexture(texture_descriptor);

Voir le fichier

@ -122,7 +122,7 @@ void RendererMetal::CreateBlitPipelineState() {
pipeline_descriptor->setVertexFunction(vertex_function);
pipeline_descriptor->setFragmentFunction(fragment_function);
// TODO: get the pixel format from metal layer
pipeline_descriptor->colorAttachments()->object(0)->setPixelFormat(MTL::PixelFormatRGBA8Unorm);
pipeline_descriptor->colorAttachments()->object(0)->setPixelFormat(MTL::PixelFormatBGRA8Unorm);
error = nullptr;
blit_pipeline_state = device.GetDevice()->newRenderPipelineState(pipeline_descriptor, &error);