diff options
author | wwylele <wwylele@gmail.com> | 2017-07-01 10:02:48 +0200 |
---|---|---|
committer | wwylele <wwylele@gmail.com> | 2017-07-01 10:02:48 +0200 |
commit | 8482933db8acaead8ff66e1457cd5453b02cccf4 (patch) | |
tree | ebd5e6b7aa59946b84fd742795bb0cdbc8d5f7de /src/video_core/renderer_opengl/gl_shader_gen.cpp | |
parent | Merge pull request #2793 from Subv/replyandreceive (diff) | |
download | yuzu-8482933db8acaead8ff66e1457cd5453b02cccf4.tar yuzu-8482933db8acaead8ff66e1457cd5453b02cccf4.tar.gz yuzu-8482933db8acaead8ff66e1457cd5453b02cccf4.tar.bz2 yuzu-8482933db8acaead8ff66e1457cd5453b02cccf4.tar.lz yuzu-8482933db8acaead8ff66e1457cd5453b02cccf4.tar.xz yuzu-8482933db8acaead8ff66e1457cd5453b02cccf4.tar.zst yuzu-8482933db8acaead8ff66e1457cd5453b02cccf4.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_shader_gen.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_gen.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp index c93b108fb..bb192affd 100644 --- a/src/video_core/renderer_opengl/gl_shader_gen.cpp +++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp @@ -886,12 +886,12 @@ void AppendProcTexSampler(std::string& out, const PicaShaderConfig& config) { // coord=1.0 is lut[127]+lut_diff[127]. For other indices, the result is interpolated using // value entries and difference entries. out += R"( -float ProcTexLookupLUT(sampler1D lut, float coord) { +float ProcTexLookupLUT(samplerBuffer lut, float coord) { coord *= 128; float index_i = clamp(floor(coord), 0.0, 127.0); float index_f = coord - index_i; // fract() cannot be used here because 128.0 needs to be // extracted as index_i = 127.0 and index_f = 1.0 - vec2 entry = texelFetch(lut, int(index_i), 0).rg; + vec2 entry = texelFetch(lut, int(index_i)).rg; return clamp(entry.r + entry.g * index_f, 0.0, 1.0); } )"; @@ -979,14 +979,14 @@ float ProcTexNoiseCoef(vec2 x) { out += "int lut_index_i = int(lut_coord) + " + std::to_string(config.state.proctex.lut_offset) + ";\n"; out += "float lut_index_f = fract(lut_coord);\n"; - out += "vec4 final_color = texelFetch(proctex_lut, lut_index_i, 0) + lut_index_f * " - "texelFetch(proctex_diff_lut, lut_index_i, 0);\n"; + out += "vec4 final_color = texelFetch(proctex_lut, lut_index_i) + lut_index_f * " + "texelFetch(proctex_diff_lut, lut_index_i);\n"; break; case ProcTexFilter::Nearest: case ProcTexFilter::NearestMipmapLinear: case ProcTexFilter::NearestMipmapNearest: out += "lut_coord += " + std::to_string(config.state.proctex.lut_offset) + ";\n"; - out += "vec4 final_color = texelFetch(proctex_lut, int(round(lut_coord)), 0);\n"; + out += "vec4 final_color = texelFetch(proctex_lut, int(round(lut_coord)));\n"; break; } @@ -1053,11 +1053,11 @@ layout (std140) uniform shader_data { uniform sampler2D tex[3]; uniform samplerBuffer lighting_lut; uniform samplerBuffer fog_lut; -uniform sampler1D proctex_noise_lut; -uniform sampler1D proctex_color_map; -uniform sampler1D proctex_alpha_map; -uniform sampler1D proctex_lut; -uniform sampler1D proctex_diff_lut; +uniform samplerBuffer proctex_noise_lut; +uniform samplerBuffer proctex_color_map; +uniform samplerBuffer proctex_alpha_map; +uniform samplerBuffer proctex_lut; +uniform samplerBuffer proctex_diff_lut; // Rotate the vector v by the quaternion q vec3 quaternion_rotate(vec4 q, vec3 v) { |