rmordechay / glsl-plugin-idea

GLSL support for JetBrains IDE's
Apache License 2.0
35 stars 11 forks source link

Explicit Arithmetic Types Errors #40

Open Karpov-Ruslan opened 3 months ago

Karpov-Ruslan commented 3 months ago
  1. Can you add integer and float suffixes according to GL_EXT_shader_explicit_arithmetic_types extension:

    • Integer suffixes (299 line):

      Change "integer-suffix" definition:
      
       "integer-suffix:
           unsigned-suffix long-suffixopt
           unsigned-suffix short-suffixopt
           long-suffix
           short-suffix
      
        unsigned-suffix: one of
            u U
        long-suffix: one of
            l L
        short-suffix: one of
            s S"
    • Float suffixes (354 line):

      Modify the second paragraph to say:
       "floating-suffix:
            half-suffix single-suffix
            double-suffix single-suffix
            single-suffix
      
        single-suffix: one of
            f F
        half-suffix: one of
            h H
        double-suffix: one of
            L L"

    The list of additional suffixes (I use only uppercase letters, but lowercase options need to be considered):

    • L, S, UL, US for integer types.
    • HF for float types.
  2. float32_t var = 1.0F; - an error occurs: "Incompatible types in initialization (and no available implicit conversion).", but float32_t var = 1.0LF; code line does not cause any errors. However, LF suffix relates to float64_t/double types.

Karpov-Ruslan commented 3 months ago
  1. Also, can you allow implicit conversion:

    • int <-> int32_t
    • uint <-> uint32_t
    • float <-> float32_t
    • double <-> float64_t

    and derivative vec cases:

    • ivecn <-> i32vecn
    • uvecn <-> u32vecn
    • vecn <-> f32vecn
    • dvecn <-> f64vecn
rmordechay commented 6 days ago

Hi @Karpov-Ruslan Sorry for the late replay. I'm sure about implementing extensions. I didn't get into it but it's not straightforward at all.