diff options
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 65 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.h | 5 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_gen.cpp | 20 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_state.cpp | 50 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_state.h | 10 |
5 files changed, 80 insertions, 70 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index ff3f69ba3..1c6c15a58 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -117,48 +117,53 @@ RasterizerOpenGL::RasterizerOpenGL() : shader_dirty(true) { | |||
| 117 | 117 | ||
| 118 | // Setup the noise LUT for proctex | 118 | // Setup the noise LUT for proctex |
| 119 | proctex_noise_lut.Create(); | 119 | proctex_noise_lut.Create(); |
| 120 | state.proctex_noise_lut.texture_1d = proctex_noise_lut.handle; | 120 | state.proctex_noise_lut.texture_buffer = proctex_noise_lut.handle; |
| 121 | state.Apply(); | 121 | state.Apply(); |
| 122 | proctex_noise_lut_buffer.Create(); | ||
| 123 | glBindBuffer(GL_TEXTURE_BUFFER, proctex_noise_lut_buffer.handle); | ||
| 124 | glBufferData(GL_TEXTURE_BUFFER, sizeof(GLfloat) * 2 * 128, nullptr, GL_DYNAMIC_DRAW); | ||
| 122 | glActiveTexture(TextureUnits::ProcTexNoiseLUT.Enum()); | 125 | glActiveTexture(TextureUnits::ProcTexNoiseLUT.Enum()); |
| 123 | glTexImage1D(GL_TEXTURE_1D, 0, GL_RG32F, 128, 0, GL_RG, GL_FLOAT, nullptr); | 126 | glTexBuffer(GL_TEXTURE_BUFFER, GL_RG32F, proctex_noise_lut_buffer.handle); |
| 124 | glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); | ||
| 125 | glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); | ||
| 126 | 127 | ||
| 127 | // Setup the color map for proctex | 128 | // Setup the color map for proctex |
| 128 | proctex_color_map.Create(); | 129 | proctex_color_map.Create(); |
| 129 | state.proctex_color_map.texture_1d = proctex_color_map.handle; | 130 | state.proctex_color_map.texture_buffer = proctex_color_map.handle; |
| 130 | state.Apply(); | 131 | state.Apply(); |
| 132 | proctex_color_map_buffer.Create(); | ||
| 133 | glBindBuffer(GL_TEXTURE_BUFFER, proctex_color_map_buffer.handle); | ||
| 134 | glBufferData(GL_TEXTURE_BUFFER, sizeof(GLfloat) * 2 * 128, nullptr, GL_DYNAMIC_DRAW); | ||
| 131 | glActiveTexture(TextureUnits::ProcTexColorMap.Enum()); | 135 | glActiveTexture(TextureUnits::ProcTexColorMap.Enum()); |
| 132 | glTexImage1D(GL_TEXTURE_1D, 0, GL_RG32F, 128, 0, GL_RG, GL_FLOAT, nullptr); | 136 | glTexBuffer(GL_TEXTURE_BUFFER, GL_RG32F, proctex_color_map_buffer.handle); |
| 133 | glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); | ||
| 134 | glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); | ||
| 135 | 137 | ||
| 136 | // Setup the alpha map for proctex | 138 | // Setup the alpha map for proctex |
| 137 | proctex_alpha_map.Create(); | 139 | proctex_alpha_map.Create(); |
| 138 | state.proctex_alpha_map.texture_1d = proctex_alpha_map.handle; | 140 | state.proctex_alpha_map.texture_buffer = proctex_alpha_map.handle; |
| 139 | state.Apply(); | 141 | state.Apply(); |
| 142 | proctex_alpha_map_buffer.Create(); | ||
| 143 | glBindBuffer(GL_TEXTURE_BUFFER, proctex_alpha_map_buffer.handle); | ||
| 144 | glBufferData(GL_TEXTURE_BUFFER, sizeof(GLfloat) * 2 * 128, nullptr, GL_DYNAMIC_DRAW); | ||
| 140 | glActiveTexture(TextureUnits::ProcTexAlphaMap.Enum()); | 145 | glActiveTexture(TextureUnits::ProcTexAlphaMap.Enum()); |
| 141 | glTexImage1D(GL_TEXTURE_1D, 0, GL_RG32F, 128, 0, GL_RG, GL_FLOAT, nullptr); | 146 | glTexBuffer(GL_TEXTURE_BUFFER, GL_RG32F, proctex_alpha_map_buffer.handle); |
| 142 | glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); | ||
| 143 | glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); | ||
| 144 | 147 | ||
| 145 | // Setup the LUT for proctex | 148 | // Setup the LUT for proctex |
| 146 | proctex_lut.Create(); | 149 | proctex_lut.Create(); |
| 147 | state.proctex_lut.texture_1d = proctex_lut.handle; | 150 | state.proctex_lut.texture_buffer = proctex_lut.handle; |
| 148 | state.Apply(); | 151 | state.Apply(); |
| 152 | proctex_lut_buffer.Create(); | ||
| 153 | glBindBuffer(GL_TEXTURE_BUFFER, proctex_lut_buffer.handle); | ||
| 154 | glBufferData(GL_TEXTURE_BUFFER, sizeof(GLfloat) * 4 * 256, nullptr, GL_DYNAMIC_DRAW); | ||
| 149 | glActiveTexture(TextureUnits::ProcTexLUT.Enum()); | 155 | glActiveTexture(TextureUnits::ProcTexLUT.Enum()); |
| 150 | glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA32F, 256, 0, GL_RGBA, GL_FLOAT, nullptr); | 156 | glTexBuffer(GL_TEXTURE_BUFFER, GL_RGBA32F, proctex_lut_buffer.handle); |
| 151 | glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); | ||
| 152 | glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); | ||
| 153 | 157 | ||
| 154 | // Setup the difference LUT for proctex | 158 | // Setup the difference LUT for proctex |
| 155 | proctex_diff_lut.Create(); | 159 | proctex_diff_lut.Create(); |
| 156 | state.proctex_diff_lut.texture_1d = proctex_diff_lut.handle; | 160 | state.proctex_diff_lut.texture_buffer = proctex_diff_lut.handle; |
| 157 | state.Apply(); | 161 | state.Apply(); |
| 162 | proctex_diff_lut_buffer.Create(); | ||
| 163 | glBindBuffer(GL_TEXTURE_BUFFER, proctex_diff_lut_buffer.handle); | ||
| 164 | glBufferData(GL_TEXTURE_BUFFER, sizeof(GLfloat) * 4 * 256, nullptr, GL_DYNAMIC_DRAW); | ||
| 158 | glActiveTexture(TextureUnits::ProcTexDiffLUT.Enum()); | 165 | glActiveTexture(TextureUnits::ProcTexDiffLUT.Enum()); |
| 159 | glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA32F, 256, 0, GL_RGBA, GL_FLOAT, nullptr); | 166 | glTexBuffer(GL_TEXTURE_BUFFER, GL_RGBA32F, proctex_diff_lut_buffer.handle); |
| 160 | glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); | ||
| 161 | glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); | ||
| 162 | 167 | ||
| 163 | // Sync fixed function OpenGL state | 168 | // Sync fixed function OpenGL state |
| 164 | SyncCullMode(); | 169 | SyncCullMode(); |
| @@ -1387,7 +1392,7 @@ void RasterizerOpenGL::SyncProcTexNoise() { | |||
| 1387 | 1392 | ||
| 1388 | // helper function for SyncProcTexNoiseLUT/ColorMap/AlphaMap | 1393 | // helper function for SyncProcTexNoiseLUT/ColorMap/AlphaMap |
| 1389 | static void SyncProcTexValueLUT(const std::array<Pica::State::ProcTex::ValueEntry, 128>& lut, | 1394 | static void SyncProcTexValueLUT(const std::array<Pica::State::ProcTex::ValueEntry, 128>& lut, |
| 1390 | std::array<GLvec2, 128>& lut_data, GLenum texture) { | 1395 | std::array<GLvec2, 128>& lut_data, GLuint buffer) { |
| 1391 | std::array<GLvec2, 128> new_data; | 1396 | std::array<GLvec2, 128> new_data; |
| 1392 | std::transform(lut.begin(), lut.end(), new_data.begin(), [](const auto& entry) { | 1397 | std::transform(lut.begin(), lut.end(), new_data.begin(), [](const auto& entry) { |
| 1393 | return GLvec2{entry.ToFloat(), entry.DiffToFloat()}; | 1398 | return GLvec2{entry.ToFloat(), entry.DiffToFloat()}; |
| @@ -1395,24 +1400,24 @@ static void SyncProcTexValueLUT(const std::array<Pica::State::ProcTex::ValueEntr | |||
| 1395 | 1400 | ||
| 1396 | if (new_data != lut_data) { | 1401 | if (new_data != lut_data) { |
| 1397 | lut_data = new_data; | 1402 | lut_data = new_data; |
| 1398 | glActiveTexture(texture); | 1403 | glBindBuffer(GL_TEXTURE_BUFFER, buffer); |
| 1399 | glTexSubImage1D(GL_TEXTURE_1D, 0, 0, 128, GL_RG, GL_FLOAT, lut_data.data()); | 1404 | glBufferSubData(GL_TEXTURE_BUFFER, 0, new_data.size() * sizeof(GLvec2), new_data.data()); |
| 1400 | } | 1405 | } |
| 1401 | } | 1406 | } |
| 1402 | 1407 | ||
| 1403 | void RasterizerOpenGL::SyncProcTexNoiseLUT() { | 1408 | void RasterizerOpenGL::SyncProcTexNoiseLUT() { |
| 1404 | SyncProcTexValueLUT(Pica::g_state.proctex.noise_table, proctex_noise_lut_data, | 1409 | SyncProcTexValueLUT(Pica::g_state.proctex.noise_table, proctex_noise_lut_data, |
| 1405 | TextureUnits::ProcTexNoiseLUT.Enum()); | 1410 | proctex_noise_lut_buffer.handle); |
| 1406 | } | 1411 | } |
| 1407 | 1412 | ||
| 1408 | void RasterizerOpenGL::SyncProcTexColorMap() { | 1413 | void RasterizerOpenGL::SyncProcTexColorMap() { |
| 1409 | SyncProcTexValueLUT(Pica::g_state.proctex.color_map_table, proctex_color_map_data, | 1414 | SyncProcTexValueLUT(Pica::g_state.proctex.color_map_table, proctex_color_map_data, |
| 1410 | TextureUnits::ProcTexColorMap.Enum()); | 1415 | proctex_color_map_buffer.handle); |
| 1411 | } | 1416 | } |
| 1412 | 1417 | ||
| 1413 | void RasterizerOpenGL::SyncProcTexAlphaMap() { | 1418 | void RasterizerOpenGL::SyncProcTexAlphaMap() { |
| 1414 | SyncProcTexValueLUT(Pica::g_state.proctex.alpha_map_table, proctex_alpha_map_data, | 1419 | SyncProcTexValueLUT(Pica::g_state.proctex.alpha_map_table, proctex_alpha_map_data, |
| 1415 | TextureUnits::ProcTexAlphaMap.Enum()); | 1420 | proctex_alpha_map_buffer.handle); |
| 1416 | } | 1421 | } |
| 1417 | 1422 | ||
| 1418 | void RasterizerOpenGL::SyncProcTexLUT() { | 1423 | void RasterizerOpenGL::SyncProcTexLUT() { |
| @@ -1427,8 +1432,8 @@ void RasterizerOpenGL::SyncProcTexLUT() { | |||
| 1427 | 1432 | ||
| 1428 | if (new_data != proctex_lut_data) { | 1433 | if (new_data != proctex_lut_data) { |
| 1429 | proctex_lut_data = new_data; | 1434 | proctex_lut_data = new_data; |
| 1430 | glActiveTexture(TextureUnits::ProcTexLUT.Enum()); | 1435 | glBindBuffer(GL_TEXTURE_BUFFER, proctex_lut_buffer.handle); |
| 1431 | glTexSubImage1D(GL_TEXTURE_1D, 0, 0, 256, GL_RGBA, GL_FLOAT, proctex_lut_data.data()); | 1436 | glBufferSubData(GL_TEXTURE_BUFFER, 0, new_data.size() * sizeof(GLvec4), new_data.data()); |
| 1432 | } | 1437 | } |
| 1433 | } | 1438 | } |
| 1434 | 1439 | ||
| @@ -1444,8 +1449,8 @@ void RasterizerOpenGL::SyncProcTexDiffLUT() { | |||
| 1444 | 1449 | ||
| 1445 | if (new_data != proctex_diff_lut_data) { | 1450 | if (new_data != proctex_diff_lut_data) { |
| 1446 | proctex_diff_lut_data = new_data; | 1451 | proctex_diff_lut_data = new_data; |
| 1447 | glActiveTexture(TextureUnits::ProcTexDiffLUT.Enum()); | 1452 | glBindBuffer(GL_TEXTURE_BUFFER, proctex_diff_lut_buffer.handle); |
| 1448 | glTexSubImage1D(GL_TEXTURE_1D, 0, 0, 256, GL_RGBA, GL_FLOAT, proctex_diff_lut_data.data()); | 1453 | glBufferSubData(GL_TEXTURE_BUFFER, 0, new_data.size() * sizeof(GLvec4), new_data.data()); |
| 1449 | } | 1454 | } |
| 1450 | } | 1455 | } |
| 1451 | 1456 | ||
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index a433c1d4a..78e218efe 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h | |||
| @@ -287,18 +287,23 @@ private: | |||
| 287 | OGLTexture fog_lut; | 287 | OGLTexture fog_lut; |
| 288 | std::array<GLvec2, 128> fog_lut_data{}; | 288 | std::array<GLvec2, 128> fog_lut_data{}; |
| 289 | 289 | ||
| 290 | OGLBuffer proctex_noise_lut_buffer; | ||
| 290 | OGLTexture proctex_noise_lut; | 291 | OGLTexture proctex_noise_lut; |
| 291 | std::array<GLvec2, 128> proctex_noise_lut_data{}; | 292 | std::array<GLvec2, 128> proctex_noise_lut_data{}; |
| 292 | 293 | ||
| 294 | OGLBuffer proctex_color_map_buffer; | ||
| 293 | OGLTexture proctex_color_map; | 295 | OGLTexture proctex_color_map; |
| 294 | std::array<GLvec2, 128> proctex_color_map_data{}; | 296 | std::array<GLvec2, 128> proctex_color_map_data{}; |
| 295 | 297 | ||
| 298 | OGLBuffer proctex_alpha_map_buffer; | ||
| 296 | OGLTexture proctex_alpha_map; | 299 | OGLTexture proctex_alpha_map; |
| 297 | std::array<GLvec2, 128> proctex_alpha_map_data{}; | 300 | std::array<GLvec2, 128> proctex_alpha_map_data{}; |
| 298 | 301 | ||
| 302 | OGLBuffer proctex_lut_buffer; | ||
| 299 | OGLTexture proctex_lut; | 303 | OGLTexture proctex_lut; |
| 300 | std::array<GLvec4, 256> proctex_lut_data{}; | 304 | std::array<GLvec4, 256> proctex_lut_data{}; |
| 301 | 305 | ||
| 306 | OGLBuffer proctex_diff_lut_buffer; | ||
| 302 | OGLTexture proctex_diff_lut; | 307 | OGLTexture proctex_diff_lut; |
| 303 | std::array<GLvec4, 256> proctex_diff_lut_data{}; | 308 | std::array<GLvec4, 256> proctex_diff_lut_data{}; |
| 304 | }; | 309 | }; |
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) { | |||
| 886 | // coord=1.0 is lut[127]+lut_diff[127]. For other indices, the result is interpolated using | 886 | // coord=1.0 is lut[127]+lut_diff[127]. For other indices, the result is interpolated using |
| 887 | // value entries and difference entries. | 887 | // value entries and difference entries. |
| 888 | out += R"( | 888 | out += R"( |
| 889 | float ProcTexLookupLUT(sampler1D lut, float coord) { | 889 | float ProcTexLookupLUT(samplerBuffer lut, float coord) { |
| 890 | coord *= 128; | 890 | coord *= 128; |
| 891 | float index_i = clamp(floor(coord), 0.0, 127.0); | 891 | float index_i = clamp(floor(coord), 0.0, 127.0); |
| 892 | float index_f = coord - index_i; // fract() cannot be used here because 128.0 needs to be | 892 | float index_f = coord - index_i; // fract() cannot be used here because 128.0 needs to be |
| 893 | // extracted as index_i = 127.0 and index_f = 1.0 | 893 | // extracted as index_i = 127.0 and index_f = 1.0 |
| 894 | vec2 entry = texelFetch(lut, int(index_i), 0).rg; | 894 | vec2 entry = texelFetch(lut, int(index_i)).rg; |
| 895 | return clamp(entry.r + entry.g * index_f, 0.0, 1.0); | 895 | return clamp(entry.r + entry.g * index_f, 0.0, 1.0); |
| 896 | } | 896 | } |
| 897 | )"; | 897 | )"; |
| @@ -979,14 +979,14 @@ float ProcTexNoiseCoef(vec2 x) { | |||
| 979 | out += "int lut_index_i = int(lut_coord) + " + | 979 | out += "int lut_index_i = int(lut_coord) + " + |
| 980 | std::to_string(config.state.proctex.lut_offset) + ";\n"; | 980 | std::to_string(config.state.proctex.lut_offset) + ";\n"; |
| 981 | out += "float lut_index_f = fract(lut_coord);\n"; | 981 | out += "float lut_index_f = fract(lut_coord);\n"; |
| 982 | out += "vec4 final_color = texelFetch(proctex_lut, lut_index_i, 0) + lut_index_f * " | 982 | out += "vec4 final_color = texelFetch(proctex_lut, lut_index_i) + lut_index_f * " |
| 983 | "texelFetch(proctex_diff_lut, lut_index_i, 0);\n"; | 983 | "texelFetch(proctex_diff_lut, lut_index_i);\n"; |
| 984 | break; | 984 | break; |
| 985 | case ProcTexFilter::Nearest: | 985 | case ProcTexFilter::Nearest: |
| 986 | case ProcTexFilter::NearestMipmapLinear: | 986 | case ProcTexFilter::NearestMipmapLinear: |
| 987 | case ProcTexFilter::NearestMipmapNearest: | 987 | case ProcTexFilter::NearestMipmapNearest: |
| 988 | out += "lut_coord += " + std::to_string(config.state.proctex.lut_offset) + ";\n"; | 988 | out += "lut_coord += " + std::to_string(config.state.proctex.lut_offset) + ";\n"; |
| 989 | out += "vec4 final_color = texelFetch(proctex_lut, int(round(lut_coord)), 0);\n"; | 989 | out += "vec4 final_color = texelFetch(proctex_lut, int(round(lut_coord)));\n"; |
| 990 | break; | 990 | break; |
| 991 | } | 991 | } |
| 992 | 992 | ||
| @@ -1053,11 +1053,11 @@ layout (std140) uniform shader_data { | |||
| 1053 | uniform sampler2D tex[3]; | 1053 | uniform sampler2D tex[3]; |
| 1054 | uniform samplerBuffer lighting_lut; | 1054 | uniform samplerBuffer lighting_lut; |
| 1055 | uniform samplerBuffer fog_lut; | 1055 | uniform samplerBuffer fog_lut; |
| 1056 | uniform sampler1D proctex_noise_lut; | 1056 | uniform samplerBuffer proctex_noise_lut; |
| 1057 | uniform sampler1D proctex_color_map; | 1057 | uniform samplerBuffer proctex_color_map; |
| 1058 | uniform sampler1D proctex_alpha_map; | 1058 | uniform samplerBuffer proctex_alpha_map; |
| 1059 | uniform sampler1D proctex_lut; | 1059 | uniform samplerBuffer proctex_lut; |
| 1060 | uniform sampler1D proctex_diff_lut; | 1060 | uniform samplerBuffer proctex_diff_lut; |
| 1061 | 1061 | ||
| 1062 | // Rotate the vector v by the quaternion q | 1062 | // Rotate the vector v by the quaternion q |
| 1063 | vec3 quaternion_rotate(vec4 q, vec3 v) { | 1063 | vec3 quaternion_rotate(vec4 q, vec3 v) { |
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp index eface2dea..bc9d34b84 100644 --- a/src/video_core/renderer_opengl/gl_state.cpp +++ b/src/video_core/renderer_opengl/gl_state.cpp | |||
| @@ -56,11 +56,11 @@ OpenGLState::OpenGLState() { | |||
| 56 | 56 | ||
| 57 | fog_lut.texture_buffer = 0; | 57 | fog_lut.texture_buffer = 0; |
| 58 | 58 | ||
| 59 | proctex_lut.texture_1d = 0; | 59 | proctex_lut.texture_buffer = 0; |
| 60 | proctex_diff_lut.texture_1d = 0; | 60 | proctex_diff_lut.texture_buffer = 0; |
| 61 | proctex_color_map.texture_1d = 0; | 61 | proctex_color_map.texture_buffer = 0; |
| 62 | proctex_alpha_map.texture_1d = 0; | 62 | proctex_alpha_map.texture_buffer = 0; |
| 63 | proctex_noise_lut.texture_1d = 0; | 63 | proctex_noise_lut.texture_buffer = 0; |
| 64 | 64 | ||
| 65 | draw.read_framebuffer = 0; | 65 | draw.read_framebuffer = 0; |
| 66 | draw.draw_framebuffer = 0; | 66 | draw.draw_framebuffer = 0; |
| @@ -204,33 +204,33 @@ void OpenGLState::Apply() const { | |||
| 204 | } | 204 | } |
| 205 | 205 | ||
| 206 | // ProcTex Noise LUT | 206 | // ProcTex Noise LUT |
| 207 | if (proctex_noise_lut.texture_1d != cur_state.proctex_noise_lut.texture_1d) { | 207 | if (proctex_noise_lut.texture_buffer != cur_state.proctex_noise_lut.texture_buffer) { |
| 208 | glActiveTexture(TextureUnits::ProcTexNoiseLUT.Enum()); | 208 | glActiveTexture(TextureUnits::ProcTexNoiseLUT.Enum()); |
| 209 | glBindTexture(GL_TEXTURE_1D, proctex_noise_lut.texture_1d); | 209 | glBindTexture(GL_TEXTURE_BUFFER, proctex_noise_lut.texture_buffer); |
| 210 | } | 210 | } |
| 211 | 211 | ||
| 212 | // ProcTex Color Map | 212 | // ProcTex Color Map |
| 213 | if (proctex_color_map.texture_1d != cur_state.proctex_color_map.texture_1d) { | 213 | if (proctex_color_map.texture_buffer != cur_state.proctex_color_map.texture_buffer) { |
| 214 | glActiveTexture(TextureUnits::ProcTexColorMap.Enum()); | 214 | glActiveTexture(TextureUnits::ProcTexColorMap.Enum()); |
| 215 | glBindTexture(GL_TEXTURE_1D, proctex_color_map.texture_1d); | 215 | glBindTexture(GL_TEXTURE_BUFFER, proctex_color_map.texture_buffer); |
| 216 | } | 216 | } |
| 217 | 217 | ||
| 218 | // ProcTex Alpha Map | 218 | // ProcTex Alpha Map |
| 219 | if (proctex_alpha_map.texture_1d != cur_state.proctex_alpha_map.texture_1d) { | 219 | if (proctex_alpha_map.texture_buffer != cur_state.proctex_alpha_map.texture_buffer) { |
| 220 | glActiveTexture(TextureUnits::ProcTexAlphaMap.Enum()); | 220 | glActiveTexture(TextureUnits::ProcTexAlphaMap.Enum()); |
| 221 | glBindTexture(GL_TEXTURE_1D, proctex_alpha_map.texture_1d); | 221 | glBindTexture(GL_TEXTURE_BUFFER, proctex_alpha_map.texture_buffer); |
| 222 | } | 222 | } |
| 223 | 223 | ||
| 224 | // ProcTex LUT | 224 | // ProcTex LUT |
| 225 | if (proctex_lut.texture_1d != cur_state.proctex_lut.texture_1d) { | 225 | if (proctex_lut.texture_buffer != cur_state.proctex_lut.texture_buffer) { |
| 226 | glActiveTexture(TextureUnits::ProcTexLUT.Enum()); | 226 | glActiveTexture(TextureUnits::ProcTexLUT.Enum()); |
| 227 | glBindTexture(GL_TEXTURE_1D, proctex_lut.texture_1d); | 227 | glBindTexture(GL_TEXTURE_BUFFER, proctex_lut.texture_buffer); |
| 228 | } | 228 | } |
| 229 | 229 | ||
| 230 | // ProcTex Diff LUT | 230 | // ProcTex Diff LUT |
| 231 | if (proctex_diff_lut.texture_1d != cur_state.proctex_diff_lut.texture_1d) { | 231 | if (proctex_diff_lut.texture_buffer != cur_state.proctex_diff_lut.texture_buffer) { |
| 232 | glActiveTexture(TextureUnits::ProcTexDiffLUT.Enum()); | 232 | glActiveTexture(TextureUnits::ProcTexDiffLUT.Enum()); |
| 233 | glBindTexture(GL_TEXTURE_1D, proctex_diff_lut.texture_1d); | 233 | glBindTexture(GL_TEXTURE_BUFFER, proctex_diff_lut.texture_buffer); |
| 234 | } | 234 | } |
| 235 | 235 | ||
| 236 | // Framebuffer | 236 | // Framebuffer |
| @@ -274,16 +274,16 @@ void OpenGLState::ResetTexture(GLuint handle) { | |||
| 274 | cur_state.lighting_lut.texture_buffer = 0; | 274 | cur_state.lighting_lut.texture_buffer = 0; |
| 275 | if (cur_state.fog_lut.texture_buffer == handle) | 275 | if (cur_state.fog_lut.texture_buffer == handle) |
| 276 | cur_state.fog_lut.texture_buffer = 0; | 276 | cur_state.fog_lut.texture_buffer = 0; |
| 277 | if (cur_state.proctex_noise_lut.texture_1d == handle) | 277 | if (cur_state.proctex_noise_lut.texture_buffer == handle) |
| 278 | cur_state.proctex_noise_lut.texture_1d = 0; | 278 | cur_state.proctex_noise_lut.texture_buffer = 0; |
| 279 | if (cur_state.proctex_color_map.texture_1d == handle) | 279 | if (cur_state.proctex_color_map.texture_buffer == handle) |
| 280 | cur_state.proctex_color_map.texture_1d = 0; | 280 | cur_state.proctex_color_map.texture_buffer = 0; |
| 281 | if (cur_state.proctex_alpha_map.texture_1d == handle) | 281 | if (cur_state.proctex_alpha_map.texture_buffer == handle) |
| 282 | cur_state.proctex_alpha_map.texture_1d = 0; | 282 | cur_state.proctex_alpha_map.texture_buffer = 0; |
| 283 | if (cur_state.proctex_lut.texture_1d == handle) | 283 | if (cur_state.proctex_lut.texture_buffer == handle) |
| 284 | cur_state.proctex_lut.texture_1d = 0; | 284 | cur_state.proctex_lut.texture_buffer = 0; |
| 285 | if (cur_state.proctex_diff_lut.texture_1d == handle) | 285 | if (cur_state.proctex_diff_lut.texture_buffer == handle) |
| 286 | cur_state.proctex_diff_lut.texture_1d = 0; | 286 | cur_state.proctex_diff_lut.texture_buffer = 0; |
| 287 | } | 287 | } |
| 288 | 288 | ||
| 289 | void OpenGLState::ResetSampler(GLuint handle) { | 289 | void OpenGLState::ResetSampler(GLuint handle) { |
diff --git a/src/video_core/renderer_opengl/gl_state.h b/src/video_core/renderer_opengl/gl_state.h index 1efcf0811..745a74479 100644 --- a/src/video_core/renderer_opengl/gl_state.h +++ b/src/video_core/renderer_opengl/gl_state.h | |||
| @@ -95,23 +95,23 @@ public: | |||
| 95 | } fog_lut; | 95 | } fog_lut; |
| 96 | 96 | ||
| 97 | struct { | 97 | struct { |
| 98 | GLuint texture_1d; // GL_TEXTURE_BINDING_1D | 98 | GLuint texture_buffer; // GL_TEXTURE_BINDING_BUFFER |
| 99 | } proctex_noise_lut; | 99 | } proctex_noise_lut; |
| 100 | 100 | ||
| 101 | struct { | 101 | struct { |
| 102 | GLuint texture_1d; // GL_TEXTURE_BINDING_1D | 102 | GLuint texture_buffer; // GL_TEXTURE_BINDING_BUFFER |
| 103 | } proctex_color_map; | 103 | } proctex_color_map; |
| 104 | 104 | ||
| 105 | struct { | 105 | struct { |
| 106 | GLuint texture_1d; // GL_TEXTURE_BINDING_1D | 106 | GLuint texture_buffer; // GL_TEXTURE_BINDING_BUFFER |
| 107 | } proctex_alpha_map; | 107 | } proctex_alpha_map; |
| 108 | 108 | ||
| 109 | struct { | 109 | struct { |
| 110 | GLuint texture_1d; // GL_TEXTURE_BINDING_1D | 110 | GLuint texture_buffer; // GL_TEXTURE_BINDING_BUFFER |
| 111 | } proctex_lut; | 111 | } proctex_lut; |
| 112 | 112 | ||
| 113 | struct { | 113 | struct { |
| 114 | GLuint texture_1d; // GL_TEXTURE_BINDING_1D | 114 | GLuint texture_buffer; // GL_TEXTURE_BINDING_BUFFER |
| 115 | } proctex_diff_lut; | 115 | } proctex_diff_lut; |
| 116 | 116 | ||
| 117 | struct { | 117 | struct { |