Commit 08afdde7 by Alexis Hetu Committed by Alexis Hétu

Also use out of bound detection for image stores

Followup to: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43950 Fixes dEQP.KHR_GLES31/core_compute_shader_copyimage. This dEQP test was passing by chance, because load and store were paired properly together, being equally incorrect with regards to the OpenGL ES specs, which mentions: GLES 3.1 spec, section 8.22: If the individual texel identified for an image load or store operation doesn’t exist, the access is treated as invalid. Invalid image loads will return a vector where the value of R, G, and B components is 0 and the value of the A component is undefined. Invalid image stores will have no effect. Bug: b/150464740 Change-Id: I5aa508ed7f08e234387478d3a6faee958ca9dd97 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/44868 Presubmit-Ready: Alexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarAlexis Hétu <sugoi@google.com>
parent 8d1f8716
......@@ -1017,7 +1017,10 @@ SpirvShader::EmitResult SpirvShader::EmitImageWrite(InsnIterator insn, EmitState
}
// SPIR-V 1.4: "If the coordinates are outside the image, the memory location that is accessed is undefined."
auto robustness = OutOfBoundsBehavior::UndefinedValue;
// Emulating the glsl function imageStore() requires that this function is noop when used with out of bounds
// coordinates, so we have to use OutOfBoundsBehavior::Nullify in that case.
auto robustness = OutOfBoundsBehavior::Nullify;
auto basePtr = SIMD::Pointer(imageBase, imageSizeInBytes);
auto texelPtr = GetTexelAddress(state, basePtr, coordinate, imageType, binding, texelSize, 0, false, robustness);
......
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