Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8305838

Add appropriate null checks in Metal implementation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • internal
    • internal
    • javafx
    • generic
    • os_x

      Looks like Obj-C just ignores referencing with nil and program flow continues.
      For example:
      MetalContext->drawIndexedQuads()

      NSMutableDictionary* textures = [[self getCurrentShader] getTexutresDict];
          for (NSString *key in textures) {
              id<MTLTexture> tex = textures[key];
              CTX_LOG(@" Value: %@ for key: %@", tex, key);
              [renderEncoder useResource:tex usage:MTLResourceUsageRead];
          }

      In the above code even if getCurrentShader() returns null we dont throw any exception/error. In such scenarios we need to verify for null.

            jdv Jayathirth D V
            jdv Jayathirth D V
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: