Skip to content

Commit

Permalink
Minimize the Adreno shader compiler bug repro test
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Jan 30, 2021
1 parent c18142b commit c251d69
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
5 changes: 3 additions & 2 deletions Common/GPU/Vulkan/thin3d_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ bool VKShaderModule::Compile(VulkanContext *vulkan, ShaderLanguage language, con
std::vector<uint32_t> spirv;
std::string errorMessage;
if (!GLSLtoSPV(vkstage_, source_.c_str(), GLSLVariant::VULKAN, spirv, &errorMessage)) {
INFO_LOG(G3D, "Shader compile to module failed: %s", errorMessage.c_str());
WARN_LOG(G3D, "Shader compile to module failed: %s", errorMessage.c_str());
return false;
}

Expand All @@ -231,6 +231,7 @@ bool VKShaderModule::Compile(VulkanContext *vulkan, ShaderLanguage language, con
if (vulkan->CreateShaderModule(spirv, &module_)) {
ok_ = true;
} else {
WARN_LOG(G3D, "vkCreateShaderModule failed");
ok_ = false;
}
return ok_;
Expand Down Expand Up @@ -1281,7 +1282,7 @@ ShaderModule *VKContext::CreateShaderModule(ShaderStage stage, ShaderLanguage la
if (shader->Compile(vulkan_, language, data, size)) {
return shader;
} else {
ERROR_LOG(G3D, "Failed to compile shader: %s", (const char *)data);
ERROR_LOG(G3D, "Failed to compile shader:\n%s", (const char *)data);
shader->Release();
return nullptr;
}
Expand Down
10 changes: 3 additions & 7 deletions UI/GPUDriverTestScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,12 @@ static const std::vector<Draw::ShaderSource> fsAdrenoLogicTest = {
R"(#version 450
#extension GL_ARB_separate_shader_objects : enable
#extension GL_ARB_shading_language_420pack : enable
precision lowp float;
layout(location = 0) flat in lowp vec4 oColor0;
layout(location = 0) in vec4 oColor0;
layout(location = 1) in highp vec2 oTexCoord0;
layout(location = 0) out vec4 fragColor0;
layout(set = 0, binding = 1) uniform sampler2D Sampler0;
void main() {
vec4 t = texture(Sampler0, oTexCoord0).aaaa;
vec4 p = oColor0;
vec4 v = p * t;
v.rgb = clamp(v.rgb * 2.0, 0.0, 1.0);
vec4 v = texture(Sampler0, oTexCoord0).aaaa * oColor0;
if (v.r < 0.2 && v.g < 0.2 && v.b < 0.2) discard;
fragColor0 = vec4(0.0, 1.0, 0.0, 1.0);
})"
Expand Down Expand Up @@ -126,7 +122,7 @@ static const std::vector<Draw::ShaderSource> vsAdrenoLogicTest = {
"layout (location = 0) in vec4 pos;\n"
"layout (location = 1) in vec4 inColor;\n"
"layout (location = 2) in vec2 inTexCoord;\n"
"layout (location = 0) out lowp vec4 outColor;\n"
"layout (location = 0) out vec4 outColor;\n"
"layout (location = 1) out highp vec2 outTexCoord;\n"
"out gl_PerVertex { vec4 gl_Position; };\n"
"void main() {\n"
Expand Down

0 comments on commit c251d69

Please sign in to comment.