Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2022-01-27 10:48:37 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-01-27 10:54:24 +0300
commit5abab0a41a02a0dbae0ea3ec355b7dfb6a778613 (patch)
treec18ed3a2395967c3aad146e316b26694ed746e4f /source/blender/gpu/opengl
parenta7f7b0b77e3ffce679c1b3a79bd7b9fd92779959 (diff)
GPUShaderCreateInfo: Remove push_constant indexing
This is too much impractical and offers no real benefit.
Diffstat (limited to 'source/blender/gpu/opengl')
-rw-r--r--source/blender/gpu/opengl/gl_shader.cc3
-rw-r--r--source/blender/gpu/opengl/gl_shader_interface.cc5
2 files changed, 1 insertions, 7 deletions
diff --git a/source/blender/gpu/opengl/gl_shader.cc b/source/blender/gpu/opengl/gl_shader.cc
index 1e6e2475665..d1ef6448791 100644
--- a/source/blender/gpu/opengl/gl_shader.cc
+++ b/source/blender/gpu/opengl/gl_shader.cc
@@ -409,9 +409,6 @@ std::string GLShader::resources_declare(const ShaderCreateInfo &info) const
}
ss << "\n/* Push Constants. */\n";
for (const ShaderCreateInfo::PushConst &uniform : info.push_constants_) {
- if (GLContext::explicit_location_support) {
- ss << "layout(location = " << uniform.index << ") ";
- }
ss << "uniform " << to_string(uniform.type) << " " << uniform.name;
if (uniform.array_size > 0) {
ss << "[" << uniform.array_size << "]";
diff --git a/source/blender/gpu/opengl/gl_shader_interface.cc b/source/blender/gpu/opengl/gl_shader_interface.cc
index 299ea150408..71b908665d3 100644
--- a/source/blender/gpu/opengl/gl_shader_interface.cc
+++ b/source/blender/gpu/opengl/gl_shader_interface.cc
@@ -437,10 +437,7 @@ GLShaderInterface::GLShaderInterface(GLuint program, const shader::ShaderCreateI
}
for (const ShaderCreateInfo::PushConst &uni : info.push_constants_) {
copy_input_name(input, uni.name, name_buffer_, name_buffer_offset);
- /* Until we make use of explicit uniform location. */
- if (true || !GLContext::explicit_location_support) {
- input->location = glGetUniformLocation(program, name_buffer_ + input->name_offset);
- }
+ input->location = glGetUniformLocation(program, name_buffer_ + input->name_offset);
input->binding = -1;
input++;
}