Skip to content

Deprecating GLSLstd450Radians and GLSLstd450Degrees?Β #556

@alister-chowdhury

Description

@alister-chowdhury

Given the definition from the spec:

Radians

Converts degrees to radians, i.e., degrees * πœ‹ / 180.
The operand degrees must be a scalar or vector whose component type is 16-bit or 32-bit floating-point.
Result Type and the type of degrees must be the same type. Results are computed per component.

Degrees

Converts radians to degrees, i.e., radians * 180 / πœ‹.
The operand radians must be a scalar or vector whose component type is 16-bit or 32-bit floating-point.
Result Type and the type of radians must be the same type. Results are computed per component.

Both of these instruction are simply short hand for a OpFMul or OpVectorTimesScalar, with the extra caveat of being limited to only 16bit or 32bit floats.
This certainly doesn't seem like something that needs its own instruction?
Additionally any use of it would currently not get folded by spirv-opt, (although a rule could be added to convert it so things like reassociation can happen later).

Many thanks,
Alister

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions