mirror of https://git.suyu.dev/suyu/suyu
metal: set texture usage flags
This commit is contained in:
parent
f5830983be
commit
2f9fd5d69c
|
@ -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 New Issue