mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-26 00:32:48 +01:00
metal: set texture usage flags
This commit is contained in:
parent
f5830983be
commit
2f9fd5d69c
2 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue