Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide texture formats and texture compressions from *.textures_profiles that are currently not supported. #8531

Merged
merged 1 commit into from Feb 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 21 additions & 3 deletions editor/src/clj/editor/protobuf_forms.clj
Expand Up @@ -212,14 +212,32 @@
:texture-format-r16f
:texture-format-rg16f
:texture-format-r32f
:texture-format-rg32f})
:texture-format-rg32f
:texture-format-r-bc4
:texture-format-rg-bc5
:texture-format-rgb-bc1
:texture-format-rgb-etc1
:texture-format-rgba-pvrtc-2bppv1
:texture-format-rgba-pvrtc-4bppv1
:texture-format-rgb-pvrtc-2bppv1
:texture-format-rgb-pvrtc-4bppv1
:texture-format-rgba-bc3
:texture-format-rgba-bc7
:texture-format-rgba-etc2
:texture-format-rgba-astc-4x4})

(def texture-profiles-unsupported-compressions
#{:compression-type-webp
:compression-type-webp-lossy
:compression-type-basis-etc1s})

(defmethod protobuf-form-data Graphics$TextureProfiles [_node-id pb _def]
(let [os-values (protobuf/enum-values Graphics$PlatformProfile$OS)
format-values (protobuf/enum-values Graphics$TextureImage$TextureFormat)
format-values-filtered (filterv (fn [fmt] (not (contains? texture-profiles-unsupported-formats (first fmt)))) format-values)
compression-values (protobuf/enum-values Graphics$TextureFormatAlternative$CompressionLevel)
compression-types (protobuf/enum-values Graphics$TextureImage$CompressionType)
compression-types-filtered (filterv (fn [fmt] (not (contains? texture-profiles-unsupported-compressions (first fmt)))) compression-types)
profile-options (mapv #(do [% %]) (map :name (:profiles pb)))]
{:navigation false
:sections
Expand Down Expand Up @@ -270,8 +288,8 @@
{:path [:compression-type]
:label "Type"
:type :choicebox
:options (make-options compression-types) ; Unsorted.
:default (ffirst compression-types)}]}
:options (make-options compression-types-filtered) ; Unsorted.
:default (ffirst compression-types-filtered)}]}
{:path [:mipmaps]
:type :boolean
:label "Mipmaps"}
Expand Down