AcademySoftwareFoundation / AcademySoftwareFoundation/OpenColorIO
greaterThan() error with GPU_LANGUAGE_CG
- 主要言語
- C++
- スター
- 2.1k
- フォーク
- 503
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
When using the new ACES 1.3 ocio config, I'm getting the following error:
```
(283) : error C1101: ambiguous overloaded function reference "greaterThan(half4, half4)"
(0) : bool4 greaterThan(unsigned long4, unsigned long4)
(0) : bool4 greaterThan(long4, long4)
(0) : bool4 greaterThan(double4, double4)
(0) : bool4 greaterThan(unsigned int4, unsigned int4)
(0) : bool4 greaterThan(int4, int4)
(0) : bool4 greaterThan(float4, float4)
```
I'm using GPU_LANGUAGE_CG and the OpenColorIO generated shader uses `half` vectors as per the `getVecKeyword()` method in GpuShaderUtils.cpp. The GLSL method `greaterThan()` ([which does component-wise greater-than comparison of two vectors](https://registry.khronos.org/OpenGL-Refpages/gl4/html/greaterThan.xhtml)) doesn't support `half4` so I'm proposing the change below:
```
diff --git a/src/OpenColorIO/GpuShaderUtils.cpp b/src/OpenColorIO/GpuShaderUtils.cpp
index 711bde89..418f27df 100644
--- a/src/OpenColorIO/GpuShaderUtils.cpp
+++ b/src/OpenColorIO/GpuShaderUtils.cpp
@@ -985,11 +985,11 @@ std::string GpuShaderText::float3GreaterThan(const std::string & a,
case GPU_LANGUAGE_GLSL_4_0:
case GPU_LANGUAGE_GLSL_ES_1_0:
case GPU_LANGUAGE_GLSL_ES_3_0:
- case GPU_LANGUAGE_CG:
{
kw << float3Keyword() << "(greaterThan( " << a << ", " << b << "))";
break;
}
+ case GPU_LANGUAGE_CG:
case LANGUAGE_OSL_1:
case GPU_LANGUAGE_MSL_2_0:
case GPU_LANGUAGE_HLSL_DX11:
@@ -1020,13 +1020,13 @@ std::string GpuShaderText::float4GreaterThan(const std::string & a,
case GPU_LANGUAGE_GLSL_4_0:
case GPU_LANGUAGE_GLSL_ES_1_0:
case GPU_LANGUAGE_GLSL_ES_3_0:
- case GPU_LANGUAGE_CG:
{
kw << float4Keyword() << "(greaterThan( " << a << ", " << b << "))";
break;
}
case GPU_LANGUAGE_MSL_2_0:
case GPU_LANGUAGE_HLSL_DX11:
+ case GPU_LANGUAGE_CG:
{
kw << float4Keyword() << "("
<< "(" << a << "[0] > " << b << "[0]) ? 1.0 : 0.0, "
```
コントリビューションガイド
調査の方向性
src/OpenColorIO/GpuShaderUtils.cpp から始め、float3GreaterThan と float4GreaterThan、および GPU_LANGUAGE_CG ブランチを読みます。CG 用の ACES 1.3 GPU シェーダーを生成または調査し、その greater-than 式を報告されたコンパイラーエラーと比較します。CG 出力が曖昧な greaterThan(half4, half4) 参照を生成しなくなれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- cpp
- 領域
- computer-graphics
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 45/100