Commit 64be7c76 by Chris Forbes

Remove needless unique_ptr wrapping from inputs/outputs

Bug: b/124534397 Change-Id: Icfe0d83b0e8df648c90ba7f250924ad28dd06b55 Reviewed-on: https://swiftshader-review.googlesource.com/c/25108Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent e4ef5f77
......@@ -38,7 +38,7 @@ namespace sw
{
for (int i = 0; i < MAX_INTERFACE_COMPONENTS; i++)
{
(*routine.inputs)[i] = Float4(0.0f);
routine.inputs[i] = Float4(0.0f);
}
}
}
......@@ -148,14 +148,14 @@ namespace sw
{
if (input.Centroid)
{
(*routine.inputs)[interpolant] =
routine.inputs[interpolant] =
interpolateCentroid(XXXX, YYYY, rhwCentroid,
primitive + OFFSET(Primitive, V[interpolant]),
input.Flat, state.perspective);
}
else
{
(*routine.inputs)[interpolant] =
routine.inputs[interpolant] =
interpolate(xxxx, Dv[interpolant], rhw,
primitive + OFFSET(Primitive, V[interpolant]),
input.Flat, state.perspective, false);
......
......@@ -676,7 +676,7 @@ namespace sw
VisitInterface(resultId,
[&](Decorations const &d, AttribType type) {
auto scalarSlot = d.Location << 2 | d.Component;
dst[offset++] = (*routine->inputs)[scalarSlot];
dst[offset++] = routine->inputs[scalarSlot];
});
}
break;
......
......@@ -82,8 +82,8 @@ namespace sw
std::unordered_map<uint32_t, Intermediate> intermediates;
std::unique_ptr<Value> const inputs = std::unique_ptr<Value>(new Value(MAX_INTERFACE_COMPONENTS));
std::unique_ptr<Value> const outputs = std::unique_ptr<Value>(new Value(MAX_INTERFACE_COMPONENTS));
Value inputs = Value{MAX_INTERFACE_COMPONENTS};
Value outputs = Value{MAX_INTERFACE_COMPONENTS};
void createLvalue(uint32_t id, uint32_t size)
{
......
......@@ -92,10 +92,10 @@ namespace sw
UInt stride = *Pointer<UInt>(data + OFFSET(DrawData, stride) + sizeof(unsigned int) * i);
auto value = readStream(input, stride, state.input[i], index);
(*routine.inputs)[i] = value.x;
(*routine.inputs)[i+1] = value.y;
(*routine.inputs)[i+2] = value.z;
(*routine.inputs)[i+3] = value.w;
routine.inputs[i] = value.x;
routine.inputs[i+1] = value.y;
routine.inputs[i+2] = value.z;
routine.inputs[i+3] = value.w;
}
}
}
......@@ -615,10 +615,10 @@ namespace sw
spirvShader->outputs[i+2].Type != SpirvShader::ATTRIBTYPE_UNUSED ||
spirvShader->outputs[i+3].Type != SpirvShader::ATTRIBTYPE_UNUSED)
{
v.x = (*routine.outputs)[i];
v.y = (*routine.outputs)[i+1];
v.z = (*routine.outputs)[i+2];
v.w = (*routine.outputs)[i+3];
v.x = routine.outputs[i];
v.y = routine.outputs[i+1];
v.z = routine.outputs[i+2];
v.w = routine.outputs[i+3];
transpose4x4(v.x, v.y, v.z, v.w);
......
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