Commit ac3a67cf by Chris Forbes

gles: Only clamp default block uniform indexes

UBOs can be significantly larger than our constant register file. Don't clamp indexes into them. We *should* catch accesses outside the bound region of the UBO as well, but that's a preexisting bug (consider a UBO region smaller than the constant register file), and we don't have the limit available here. Bug: b/145227408 Change-Id: I67aae6ba9a10290c1b69587808e274c481925078 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/38708 Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Tested-by: 's avatarChris Forbes <chrisforbes@google.com>
parent 663dcefa
......@@ -1110,7 +1110,10 @@ namespace sw
Int4 index = Int4(i) + As<Int4>(a) * Int4(src.rel.scale);
index = Min(As<UInt4>(index), UInt4(VERTEX_UNIFORM_VECTORS)); // Clamp to constant register range, c[VERTEX_UNIFORM_VECTORS] = {0, 0, 0, 0}
if (src.bufferIndex == -1)
{
index = Min(As<UInt4>(index), UInt4(VERTEX_UNIFORM_VECTORS)); // Clamp to constant register range, c[VERTEX_UNIFORM_VECTORS] = {0, 0, 0, 0}
}
Int index0 = Extract(index, 0);
Int index1 = Extract(index, 1);
......
......@@ -911,7 +911,10 @@ namespace sw
Int4 index = Int4(i) + As<Int4>(a) * Int4(src.rel.scale);
index = Min(As<UInt4>(index), UInt4(VERTEX_UNIFORM_VECTORS)); // Clamp to constant register range, c[VERTEX_UNIFORM_VECTORS] = {0, 0, 0, 0}
if (src.bufferIndex == -1)
{
index = Min(As<UInt4>(index), UInt4(VERTEX_UNIFORM_VECTORS)); // Clamp to constant register range, c[VERTEX_UNIFORM_VECTORS] = {0, 0, 0, 0}
}
Int index0 = Extract(index, 0);
Int index1 = Extract(index, 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment