mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 17:30:12 +01:00
glsl: teach std140_base_alignment about samplers
These functions are about to be used more aggressively for determining uniform layout. Samplers may be inside of structs, and it's easier to reuse the existing base alignment logic. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
fe23bb85ba
commit
1ec715ce8b
1 changed files with 9 additions and 0 deletions
|
|
@ -1077,6 +1077,15 @@ glsl_type::std140_base_alignment(bool row_major) const
|
|||
return base_alignment;
|
||||
}
|
||||
|
||||
/* A sampler may never occur in a UBO (without bindless of some sort),
|
||||
* however it is convenient to use this alignment function even with
|
||||
* regular uniforms. This allows use of this function on uniform structs
|
||||
* that contain samplers.
|
||||
*/
|
||||
if (this->is_sampler()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
assert(!"not reached");
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue