profile.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include "common/common_types.h"
  5. namespace Shader {
  6. struct Profile {
  7. u32 supported_spirv{0x00010000};
  8. bool unified_descriptor_binding{};
  9. bool support_descriptor_aliasing{};
  10. bool support_int8{};
  11. bool support_int16{};
  12. bool support_int64{};
  13. bool support_vertex_instance_id{};
  14. bool support_float_controls{};
  15. bool support_separate_denorm_behavior{};
  16. bool support_separate_rounding_mode{};
  17. bool support_fp16_denorm_preserve{};
  18. bool support_fp32_denorm_preserve{};
  19. bool support_fp16_denorm_flush{};
  20. bool support_fp32_denorm_flush{};
  21. bool support_fp16_signed_zero_nan_preserve{};
  22. bool support_fp32_signed_zero_nan_preserve{};
  23. bool support_fp64_signed_zero_nan_preserve{};
  24. bool support_explicit_workgroup_layout{};
  25. bool support_vote{};
  26. bool support_viewport_index_layer_non_geometry{};
  27. bool support_viewport_mask{};
  28. bool support_typeless_image_loads{};
  29. bool support_demote_to_helper_invocation{};
  30. bool support_int64_atomics{};
  31. bool support_derivative_control{};
  32. bool support_geometry_shader_passthrough{};
  33. bool support_native_ndc{};
  34. bool support_gl_nv_gpu_shader_5{};
  35. bool support_gl_amd_gpu_shader_half_float{};
  36. bool support_gl_texture_shadow_lod{};
  37. bool support_gl_warp_intrinsics{};
  38. bool support_gl_variable_aoffi{};
  39. bool support_gl_sparse_textures{};
  40. bool support_gl_derivative_control{};
  41. bool support_scaled_attributes{};
  42. bool support_multi_viewport{};
  43. bool warp_size_potentially_larger_than_guest{};
  44. bool lower_left_origin_mode{};
  45. /// Fragment outputs have to be declared even if they are not written to avoid undefined values.
  46. /// See Ori and the Blind Forest's main menu for reference.
  47. bool need_declared_frag_colors{};
  48. /// Prevents fast math optimizations that may cause inaccuracies
  49. bool need_fastmath_off{};
  50. /// Some GPU vendors use a different rounding precision when calculating texture pixel
  51. /// coordinates with the 16.8 format in the ImageGather instruction than the Maxwell
  52. /// architecture. Applying an offset does fix this mismatching rounding behaviour.
  53. bool need_gather_subpixel_offset{};
  54. /// OpFClamp is broken and OpFMax + OpFMin should be used instead
  55. bool has_broken_spirv_clamp{};
  56. /// The Position builtin needs to be wrapped in a struct when used as an input
  57. bool has_broken_spirv_position_input{};
  58. /// Offset image operands with an unsigned type do not work
  59. bool has_broken_unsigned_image_offsets{};
  60. /// Signed instructions with unsigned data types are misinterpreted
  61. bool has_broken_signed_operations{};
  62. /// Float controls break when fp16 is enabled
  63. bool has_broken_fp16_float_controls{};
  64. /// Dynamic vec4 indexing is broken on some OpenGL drivers
  65. bool has_gl_component_indexing_bug{};
  66. /// The precise type qualifier is broken in the fragment stage of some drivers
  67. bool has_gl_precise_bug{};
  68. /// Some drivers do not properly support floatBitsToUint when used on cbufs
  69. bool has_gl_cbuf_ftou_bug{};
  70. /// Some drivers poorly optimize boolean variable references
  71. bool has_gl_bool_ref_bug{};
  72. /// Ignores SPIR-V ordered vs unordered using GLSL semantics
  73. bool ignore_nan_fp_comparisons{};
  74. /// Some drivers have broken support for OpVectorExtractDynamic on subgroup mask inputs
  75. bool has_broken_spirv_subgroup_mask_vector_extract_dynamic{};
  76. u32 gl_max_compute_smem_size{};
  77. /// Maxwell and earlier nVidia architectures have broken robust support
  78. bool has_broken_robust{};
  79. };
  80. } // namespace Shader