Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Inconsistent run-time library usage for locale handling breaks GPU code generation on some systems.

Đang mở Phù hợp với người mới
#2,351 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
86/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cpp
Lĩnh vực
computer-graphics

Hướng nghiên cứu

Bắt đầu với 12 vị trí gọi std::to_string được liệt kê trong ops/fixedfunction/FixedFunctionOpGPU.cpp và ops/gradingtone/GradingToneOpGPU.cpp, sau đó đọc các helper hiện có getFloatString() và FloatToString() trong ParseUtils.cpp. Xác minh các đường dẫn GPU bị ảnh hưởng trong các locale sử dụng dấu phẩy làm dấu thập phân và xác nhận rằng GLSL/HLSL được tạo ra sử dụng các literal thập phân hợp lệ, nhất quán.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Several GPU code paths format float constants with std::to_string(), which follows the C runtime locale (LC_NUMERIC). All other float formatting in OCIO follows the C++ global locale, for example via std::ostringstream. These are independent settings, so on comma-decimal systems (e.g. fr_FR, sv_SE) the two mechanisms can produce different decimal separators in the same shader. The affected call sites emit literals such as 100 000000 instead of 100.0, while neighboring constants from getFloatString() remain correct. The resulting GLSL/HLSL fails to compile or produces incorrect output.

This is most visible with ACES 2.x fixed-function GPU paths (gamut compress / tone scale), but the same pattern exists in grading-tone GPU code.

Affected call sites (12 float std::to_string calls across 7 lines, 2 files):

ops/fixedfunction/FixedFunctionOpGPU.cpp

  • _Add_Focus_Gain_func (line 947)
  • _Add_Compress_Gamut_func (line 1187)
  • _Add_Gamut_Compress_Inv_Shader (line 1269)

ops/gradingtone/GradingToneOpGPU.cpp

  • Add_MidsPre_Shader (line 304)
  • Add_SContrastTopPre_Shader (lines 1249, 1260)
  • Add_SContrastBottomPre_Shader (line 1300)

Suggested fix: Replace std::to_string(float) with getFloatString(), or route through the existing FloatToString() helpers in ParseUtils.cpp.

Ngôn ngữ chính
C++
Star
2.1k
Fork
502
Merge trung bình
6 ngày 3 giờ
Pull request đã merge (30 ngày)
6

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của AcademySoftwareFoundation/OpenColorIO

Tất cả issue của AcademySoftwareFoundation/OpenColorIO

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.