Commit 816132a3 by Courtney Goeltzenleuchter Committed by Commit Bot

Do not send attribute data for built-ins

Built-ins (e.g. gl_VertexID or gl_InstanceID) were settings dirty bits in the driver's ActiveAttribLocationsMask which would later cause the Vulkan back-end to issue bind commands on these built-in attributes that don't have / need anything bound. Test: angle_deqp_khr_gles31_tests --use-angle=swiftshader --gtest_filter=dEQP.KHR_GLES31/core_shader_storage_buffer_object_advancedswitchBuffersvs Bug: angleproject:4107 Change-Id: Id1f1c6699d512d0726b22d9bb0c16abad179950d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1972200Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com> Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com>
parent 7f2930fc
...@@ -3655,7 +3655,7 @@ bool Program::linkAtomicCounterBuffers() ...@@ -3655,7 +3655,7 @@ bool Program::linkAtomicCounterBuffers()
return true; return true;
} }
// Assigns locations to all attributes from the bindings and program locations. // Assigns locations to all attributes (except built-ins) from the bindings and program locations.
bool Program::linkAttributes(const Context *context, InfoLog &infoLog) bool Program::linkAttributes(const Context *context, InfoLog &infoLog)
{ {
const Caps &caps = context->getCaps(); const Caps &caps = context->getCaps();
...@@ -3791,21 +3791,23 @@ bool Program::linkAttributes(const Context *context, InfoLog &infoLog) ...@@ -3791,21 +3791,23 @@ bool Program::linkAttributes(const Context *context, InfoLog &infoLog)
ASSERT(attribute.location != -1); ASSERT(attribute.location != -1);
unsigned int regs = static_cast<unsigned int>(VariableRegisterCount(attribute.type)); unsigned int regs = static_cast<unsigned int>(VariableRegisterCount(attribute.type));
unsigned int location = static_cast<unsigned int>(attribute.location);
for (unsigned int r = 0; r < regs; r++) for (unsigned int r = 0; r < regs; r++)
{ {
unsigned int location = static_cast<unsigned int>(attribute.location) + r; // Built-in active program inputs don't have a bound attribute.
mState.mActiveAttribLocationsMask.set(location);
mState.mMaxActiveAttribLocation =
std::max(mState.mMaxActiveAttribLocation, location + 1);
// gl_VertexID and gl_InstanceID are active attributes but don't have a bound attribute.
if (!attribute.isBuiltIn()) if (!attribute.isBuiltIn())
{ {
mState.mActiveAttribLocationsMask.set(location);
mState.mMaxActiveAttribLocation =
std::max(mState.mMaxActiveAttribLocation, location + 1);
ComponentType componentType = ComponentType componentType =
GLenumToComponentType(VariableComponentType(attribute.type)); GLenumToComponentType(VariableComponentType(attribute.type));
SetComponentTypeMask(componentType, location, &mState.mAttributesTypeMask); SetComponentTypeMask(componentType, location, &mState.mAttributesTypeMask);
mState.mAttributesMask.set(location); mState.mAttributesMask.set(location);
location++;
} }
} }
} }
......
...@@ -194,8 +194,6 @@ std::string DynamicHLSL::generateVertexShaderForInputLayout( ...@@ -194,8 +194,6 @@ std::string DynamicHLSL::generateVertexShaderForInputLayout(
} }
else else
{ {
GLenum componentType = mRenderer->getVertexComponentType(vertexFormatID);
if (shaderAttribute.name == "gl_InstanceID" || if (shaderAttribute.name == "gl_InstanceID" ||
shaderAttribute.name == "gl_VertexID") shaderAttribute.name == "gl_VertexID")
{ {
...@@ -205,6 +203,8 @@ std::string DynamicHLSL::generateVertexShaderForInputLayout( ...@@ -205,6 +203,8 @@ std::string DynamicHLSL::generateVertexShaderForInputLayout(
} }
else else
{ {
GLenum componentType = mRenderer->getVertexComponentType(vertexFormatID);
structStream << " "; structStream << " ";
HLSLComponentTypeString(structStream, componentType, HLSLComponentTypeString(structStream, componentType,
VariableComponentCount(shaderAttribute.type)); VariableComponentCount(shaderAttribute.type));
......
...@@ -123,8 +123,6 @@ ...@@ -123,8 +123,6 @@
3520 VULKAN ANDROID : KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength* = SKIP 3520 VULKAN ANDROID : KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength* = SKIP
// OpenGL ES 3.1 conformance failures // OpenGL ES 3.1 conformance failures
4107 SWIFTSHADER : KHR-GLES31.core.shader_storage_buffer_object.advanced-switchBuffers-vs = FAIL
4106 SWIFTSHADER : KHR-GLES31.core.layout_binding.sampler*_layout_binding_texture_* = FAIL 4106 SWIFTSHADER : KHR-GLES31.core.layout_binding.sampler*_layout_binding_texture_* = FAIL
4108 SWIFTSHADER : KHR-GLES31.core.shader_image_size.*-nonMS-* = SKIP 4108 SWIFTSHADER : KHR-GLES31.core.shader_image_size.*-nonMS-* = SKIP
......
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