diff options
author | Marek Olšák <[email protected]> | 2017-11-16 01:10:27 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-02-13 01:00:45 +0100 |
commit | 65ed98839b612ada9b5a3da3bedff135798bdb74 (patch) | |
tree | 78509b88011c5da8b0c2c19b1c677acf0267a792 /src/compiler/glsl/link_uniforms.cpp | |
parent | 78f1decc95edee0c774098e29582d5bb9dec39a4 (diff) |
mesa: reduce the size of gl_program
gl_program: 1456 -> 976 bytes
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/compiler/glsl/link_uniforms.cpp')
-rw-r--r-- | src/compiler/glsl/link_uniforms.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp index 15813cb0aed..a73dcd47275 100644 --- a/src/compiler/glsl/link_uniforms.cpp +++ b/src/compiler/glsl/link_uniforms.cpp @@ -1423,11 +1423,10 @@ link_assign_uniform_storage(struct gl_context *ctx, } } - STATIC_ASSERT(sizeof(shader->Program->sh.SamplerTargets) == - sizeof(parcel.targets)); - memcpy(shader->Program->sh.SamplerTargets, - parcel.targets, - sizeof(shader->Program->sh.SamplerTargets)); + STATIC_ASSERT(ARRAY_SIZE(shader->Program->sh.SamplerTargets) == + ARRAY_SIZE(parcel.targets)); + for (unsigned j = 0; j < ARRAY_SIZE(parcel.targets); j++) + shader->Program->sh.SamplerTargets[j] = parcel.targets[j]; } #ifndef NDEBUG |