mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-09 01:00:51 +00:00
Set MTL::TextureUsageShaderRead during capture
To be consistent with replay created textures set MTL::TextureUsageShaderRead on textures created during capture. This override is not serialized. PR Feedback
This commit is contained in:
committed by
Baldur Karlsson
parent
ce51361c83
commit
08d07ddc0d
@@ -652,6 +652,12 @@ WrappedMTLTexture *WrappedMTLDevice::Common_NewTexture(RDMTL::TextureDescriptor
|
||||
{
|
||||
MTL::Texture *realMTLTexture;
|
||||
MTL::TextureDescriptor *realDescriptor(descriptor);
|
||||
// Ensure the created textures can be read by a shader
|
||||
// Metal driver will treat TextureUsageUnknown as all options
|
||||
MTL::TextureUsage usage = realDescriptor->usage();
|
||||
if(usage != MTL::TextureUsageUnknown)
|
||||
realDescriptor->setUsage((MTL::TextureUsage)(usage | MTL::TextureUsageShaderRead));
|
||||
|
||||
SERIALISE_TIME_CALL(realMTLTexture = !ioSurfaceTexture ? Unwrap(this)->newTexture(realDescriptor)
|
||||
: Unwrap(this)->newTexture(
|
||||
realDescriptor, iosurface, plane));
|
||||
|
||||
Reference in New Issue
Block a user