Code generation only works for PixelShader (Dx11) / Fragment Shader (OpenGL)

未关闭
#2,144 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
cpp

调研方向

首先定位 DirectX 和 OpenGL 后端中用于 1D 和 3D 查找纹理采样的生成着色器代码。将当前的采样表达式与所请求的显式 LOD 0 行为进行比较,然后验证生成的代码是否支持 compute 阶段和其他非像素阶段,且不会自动选择 mip。

由索引模型根据 Issue 内容生成。

描述

When performing lookup table sampling, OpenColorIO uses the following :

outColor.r = ocio_lut1d_0.Sample(ocio_lut1d_0Sampler, ocio_lut1d_0_computePos(outColor.r)).r;

This makes it impossible to use the generated code outside of a pixel shader, since in compute or other stages, we are not able to have automatic mip selection.

generated code should be :

outColor.r = ocio_lut1d_0.SampleLevel(ocio_lut1d_0Sampler, ocio_lut1d_0_computePos(outColor.r),0).r;

This is the same in OpenGL where we should enforce LOD = 0

This change should be for both 3d and 1d lookup textures.

I'm happy to make a PR if needed, if you prefer to avoid potential breaking changes, I'm also happy to make it as an Option in settings:

`shaderDesc->useLodSampling(true);

Thank
Julien

主要语言
C++
星标
2.1k
派生
508
平均合并
12 小时 24 分钟
30 天内合并 PR
2

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

AcademySoftwareFoundation/OpenColorIO 的其他 Issue

查看 AcademySoftwareFoundation/OpenColorIO 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。