3 Коміти 04d8a654d8 ... cbe3fbe9f3

Автор SHA1 Опис Дата
  Evan Hemsley cbe3fbe9f3 GPU: Validate that 2D textures don't have layers (#15535) 3 днів тому
  SDL Wiki Bot 8efa8014df Sync SDL3 wiki -> header 3 днів тому
  Evan Hemsley d08ef12b12 GPU: Allow depth texture arrays (#15534) 3 днів тому
2 змінених файлів з 6 додано та 5 видалено
  1. 1 1
      docs/README-android.md
  2. 5 4
      src/gpu/SDL_gpu.c

+ 1 - 1
docs/README-android.md

@@ -254,7 +254,7 @@ e.g.
             */
             return false;
         case SDL_EVENT_LOW_MEMORY:
-            /* You will get this when your app is paused and iOS wants more memory.
+            /* You will get this when your app is paused and Android wants more memory.
                Release as much memory as possible.
             */
             return false;

+ 5 - 4
src/gpu/SDL_gpu.c

@@ -1277,6 +1277,11 @@ SDL_GPUTexture *SDL_CreateGPUTexture(
             SDL_assert_release(!"For any texture: num_levels must be >= 1");
             failed = true;
         }
+        if (createinfo->type == SDL_GPU_TEXTURETYPE_2D && createinfo->layer_count_or_depth != 1)
+        {
+            SDL_assert_release(!"2D textures must have a layer count of 1");
+            failed = true;
+        }
         if ((createinfo->usage & SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ) && (createinfo->usage & SDL_GPU_TEXTUREUSAGE_SAMPLER)) {
             SDL_assert_release(!"For any texture: usage cannot contain both GRAPHICS_STORAGE_READ and SAMPLER");
             failed = true;
@@ -1363,10 +1368,6 @@ SDL_GPUTexture *SDL_CreateGPUTexture(
         } else {
             if (createinfo->type == SDL_GPU_TEXTURETYPE_2D_ARRAY) {
                 // Array Texture Validation
-                if (createinfo->usage & SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET) {
-                    SDL_assert_release(!"For array textures: usage must not contain DEPTH_STENCIL_TARGET");
-                    failed = true;
-                }
                 if (createinfo->sample_count > SDL_GPU_SAMPLECOUNT_1) {
                     SDL_assert_release(!"For array textures: sample_count must be SDL_GPU_SAMPLECOUNT_1");
                     failed = true;