profile.h 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 warp_size_potentially_larger_than_guest{};
  43. bool lower_left_origin_mode{};
  44. /// Fragment outputs have to be declared even if they are not written to avoid undefined values.
  45. /// See Ori and the Blind Forest's main menu for reference.
  46. bool need_declared_frag_colors{};
  47. /// Prevents fast math optimizations that may cause inaccuracies
  48. bool need_fastmath_off{};
  49. /// Some GPU vendors use a different rounding precision when calculating texture pixel
  50. /// coordinates with the 16.8 format in the ImageGather instruction than the Maxwell
  51. /// architecture. Applying an offset does fix this mismatching rounding behaviour.
  52. bool need_gather_subpixel_offset{};
  53. /// OpFClamp is broken and OpFMax + OpFMin should be used instead
  54. bool has_broken_spirv_clamp{};
  55. /// The Position builtin needs to be wrapped in a struct when used as an input
  56. bool has_broken_spirv_position_input{};
  57. /// Offset image operands with an unsigned type do not work
  58. bool has_broken_unsigned_image_offsets{};
  59. /// Signed instructions with unsigned data types are misinterpreted
  60. bool has_broken_signed_operations{};
  61. /// Float controls break when fp16 is enabled
  62. bool has_broken_fp16_float_controls{};
  63. /// Dynamic vec4 indexing is broken on some OpenGL drivers
  64. bool has_gl_component_indexing_bug{};
  65. /// The precise type qualifier is broken in the fragment stage of some drivers
  66. bool has_gl_precise_bug{};
  67. /// Some drivers do not properly support floatBitsToUint when used on cbufs
  68. bool has_gl_cbuf_ftou_bug{};
  69. /// Some drivers poorly optimize boolean variable references
  70. bool has_gl_bool_ref_bug{};
  71. /// Ignores SPIR-V ordered vs unordered using GLSL semantics
  72. bool ignore_nan_fp_comparisons{};
  73. u32 gl_max_compute_smem_size{};
  74. };
  75. } // namespace Shader