From b6fb5f3149fd2d27da285a2d6d0954683c465511 Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Tue, 29 Aug 2017 13:37:45 -0400 Subject: [PATCH] Roll shaderc --- examples/Animometer.cpp | 5 ++--- examples/CHelloTriangle.cpp | 2 +- examples/ComputeBoids.cpp | 2 +- examples/HelloCompute.cpp | 8 ++++---- examples/HelloDepthStencil.cpp | 13 ++++++------- examples/HelloIndices.cpp | 5 ++--- examples/HelloInstancing.cpp | 5 ++--- examples/HelloTriangle.cpp | 5 ++--- examples/HelloUBO.cpp | 5 ++--- src/tests/end2end/PrimitiveTopologyTests.cpp | 5 ++--- src/tests/end2end/RenderPassLoadOpTests.cpp | 2 +- .../validation/InputStateValidationTests.cpp | 2 +- .../validation/RenderPipelineValidationTests.cpp | 5 ++--- .../validation/VertexBufferValidationTests.cpp | 5 ++--- third_party/glslang | 2 +- third_party/shaderc | 2 +- third_party/spirv-headers | 2 +- third_party/spirv-tools | 2 +- 18 files changed, 34 insertions(+), 43 deletions(-) diff --git a/examples/Animometer.cpp b/examples/Animometer.cpp index 1ee720705d..87fc34213c 100644 --- a/examples/Animometer.cpp +++ b/examples/Animometer.cpp @@ -102,12 +102,11 @@ void init() { nxt::ShaderModule fsModule = utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"( #version 450 - out vec4 fragColor; + layout(location = 0) out vec4 fragColor; layout(location = 0) in vec4 v_color; void main() { fragColor = v_color; - })" - ); + })"); renderpass = CreateDefaultRenderPass(device); depthStencilView = CreateDefaultDepthStencilView(device); diff --git a/examples/CHelloTriangle.cpp b/examples/CHelloTriangle.cpp index 405282091e..613da0bbc6 100644 --- a/examples/CHelloTriangle.cpp +++ b/examples/CHelloTriangle.cpp @@ -52,7 +52,7 @@ void init() { const char* fs = "#version 450\n" - "out vec4 fragColor;" + "layout(location = 0) out vec4 fragColor;" "void main() {\n" " fragColor = vec4(1.0, 0.0, 0.0, 1.0);\n" "}\n"; diff --git a/examples/ComputeBoids.cpp b/examples/ComputeBoids.cpp index 1b874fa75c..f9ce84f025 100644 --- a/examples/ComputeBoids.cpp +++ b/examples/ComputeBoids.cpp @@ -109,7 +109,7 @@ void initRender() { nxt::ShaderModule fsModule = utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"( #version 450 - out vec4 fragColor; + layout(location = 0) out vec4 fragColor; void main() { fragColor = vec4(1.0); } diff --git a/examples/HelloCompute.cpp b/examples/HelloCompute.cpp index 9dcafc0dc9..cb57e9f5da 100644 --- a/examples/HelloCompute.cpp +++ b/examples/HelloCompute.cpp @@ -93,17 +93,17 @@ void init() { })" ); - nxt::ShaderModule fsModule = utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"( + nxt::ShaderModule fsModule = + utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"( #version 450 layout(set = 0, binding = 0) uniform myBlock { int a; float b; } myUbo; - out vec4 fragColor; + layout(location = 0) out vec4 fragColor; void main() { fragColor = vec4(1.0, myUbo.a / 255.0, myUbo.b, 1.0); - })" - ); + })"); nxt::BindGroupLayout bgl = device.CreateBindGroupLayoutBuilder() .SetBindingsType(nxt::ShaderStageBit::Fragment, nxt::BindingType::UniformBuffer, 0, 1) diff --git a/examples/HelloDepthStencil.cpp b/examples/HelloDepthStencil.cpp index 6d3fbb8ab2..6f17ad9f89 100644 --- a/examples/HelloDepthStencil.cpp +++ b/examples/HelloDepthStencil.cpp @@ -142,20 +142,19 @@ void init() { nxt::ShaderModule fsModule = utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"( #version 450 layout(location = 2) in vec3 f_col; - out vec4 fragColor; + layout(location = 0) out vec4 fragColor; void main() { fragColor = vec4(f_col, 1.0); - })" - ); + })"); - nxt::ShaderModule fsReflectionModule = utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"( + nxt::ShaderModule fsReflectionModule = + utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"( #version 450 layout(location = 2) in vec3 f_col; - out vec4 fragColor; + layout(location = 0) out vec4 fragColor; void main() { fragColor = vec4(mix(f_col, vec3(0.5, 0.5, 0.5), 0.5), 1.0); - })" - ); + })"); auto inputState = device.CreateInputStateBuilder() .SetAttribute(0, 0, nxt::VertexFormat::FloatR32G32B32, 0) diff --git a/examples/HelloIndices.cpp b/examples/HelloIndices.cpp index 1e56a0533b..95104b772c 100644 --- a/examples/HelloIndices.cpp +++ b/examples/HelloIndices.cpp @@ -64,11 +64,10 @@ void init() { nxt::ShaderModule fsModule = utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"( #version 450 - out vec4 fragColor; + layout(location = 0) out vec4 fragColor; void main() { fragColor = vec4(1.0, 0.0, 0.0, 1.0); - })" - ); + })"); auto inputState = device.CreateInputStateBuilder() .SetAttribute(0, 0, nxt::VertexFormat::FloatR32G32B32A32, 0) diff --git a/examples/HelloInstancing.cpp b/examples/HelloInstancing.cpp index 3c09e90eaf..2b5eeb7fba 100644 --- a/examples/HelloInstancing.cpp +++ b/examples/HelloInstancing.cpp @@ -68,11 +68,10 @@ void init() { nxt::ShaderModule fsModule = utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"( #version 450 - out vec4 fragColor; + layout(location = 0) out vec4 fragColor; void main() { fragColor = vec4(1.0, 0.0, 0.0, 1.0); - })" - ); + })"); auto inputState = device.CreateInputStateBuilder() .SetAttribute(0, 0, nxt::VertexFormat::FloatR32G32B32A32, 0) diff --git a/examples/HelloTriangle.cpp b/examples/HelloTriangle.cpp index 18821d333e..f8883d3bbe 100644 --- a/examples/HelloTriangle.cpp +++ b/examples/HelloTriangle.cpp @@ -102,11 +102,10 @@ void init() { layout(set = 0, binding = 0) uniform sampler mySampler; layout(set = 0, binding = 1) uniform texture2D myTexture; - out vec4 fragColor; + layout(location = 0) out vec4 fragColor; void main() { fragColor = texture(sampler2D(myTexture, mySampler), gl_FragCoord.xy / vec2(640.0, 480.0)); - })" - ); + })"); auto inputState = device.CreateInputStateBuilder() .SetAttribute(0, 0, nxt::VertexFormat::FloatR32G32B32A32, 0) diff --git a/examples/HelloUBO.cpp b/examples/HelloUBO.cpp index cda8767e92..44b10e232c 100644 --- a/examples/HelloUBO.cpp +++ b/examples/HelloUBO.cpp @@ -50,11 +50,10 @@ void init() { int a; float b; } myUbo; - out vec4 fragColor; + layout(location = 0) out vec4 fragColor; void main() { fragColor = vec4(1.0, myUbo.a / 255.0, myUbo.b, 1.0); - })" - ); + })"); nxt::BindGroupLayout bgl = device.CreateBindGroupLayoutBuilder() .SetBindingsType(nxt::ShaderStageBit::Fragment, nxt::BindingType::UniformBuffer, 0, 1) diff --git a/src/tests/end2end/PrimitiveTopologyTests.cpp b/src/tests/end2end/PrimitiveTopologyTests.cpp index 659b192e77..c688415d4f 100644 --- a/src/tests/end2end/PrimitiveTopologyTests.cpp +++ b/src/tests/end2end/PrimitiveTopologyTests.cpp @@ -180,11 +180,10 @@ class PrimitiveTopologyTest : public NXTTest { fsModule = utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"( #version 450 - out vec4 fragColor; + layout(location = 0) out vec4 fragColor; void main() { fragColor = vec4(0.0, 1.0, 0.0, 1.0); - })" - ); + })"); inputState = device.CreateInputStateBuilder() .SetAttribute(0, 0, nxt::VertexFormat::FloatR32G32B32A32, 0) diff --git a/src/tests/end2end/RenderPassLoadOpTests.cpp b/src/tests/end2end/RenderPassLoadOpTests.cpp index 6e5cae08cc..68349c7a59 100644 --- a/src/tests/end2end/RenderPassLoadOpTests.cpp +++ b/src/tests/end2end/RenderPassLoadOpTests.cpp @@ -88,7 +88,7 @@ class RenderPassLoadOpTests : public NXTTest { )"; const char* fsSource = R"( #version 450 - out vec4 color; + layout(location = 0) out vec4 color; void main() { color = vec4(0.f, 0.f, 1.f, 1.f); } diff --git a/src/tests/unittests/validation/InputStateValidationTests.cpp b/src/tests/unittests/validation/InputStateValidationTests.cpp index 8c3bc6f51c..7fbd77e96e 100644 --- a/src/tests/unittests/validation/InputStateValidationTests.cpp +++ b/src/tests/unittests/validation/InputStateValidationTests.cpp @@ -32,7 +32,7 @@ class InputStateTest : public ValidationTest { nxt::ShaderModuleBuilder fsModuleBuilder = AssertWillBeSuccess(device.CreateShaderModuleBuilder()); utils::FillShaderModuleBuilder(fsModuleBuilder, nxt::ShaderStage::Fragment, R"( #version 450 - out vec4 fragColor; + layout(location = 0) out vec4 fragColor; void main() { fragColor = vec4(1.0, 0.0, 0.0, 1.0); } diff --git a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp index 39cfdee3f3..f5414d2959 100644 --- a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp +++ b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp @@ -38,11 +38,10 @@ class RenderPipelineValidationTest : public ValidationTest { fsModule = utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"( #version 450 - out vec4 fragColor; + layout(location = 0) out vec4 fragColor; void main() { fragColor = vec4(0.0, 1.0, 0.0, 1.0); - })" - ); + })"); } nxt::RenderPipelineBuilder& AddDefaultStates(nxt::RenderPipelineBuilder&& builder) { diff --git a/src/tests/unittests/validation/VertexBufferValidationTests.cpp b/src/tests/unittests/validation/VertexBufferValidationTests.cpp index de548a7e07..98bc3e659d 100644 --- a/src/tests/unittests/validation/VertexBufferValidationTests.cpp +++ b/src/tests/unittests/validation/VertexBufferValidationTests.cpp @@ -25,11 +25,10 @@ class VertexBufferValidationTest : public ValidationTest { fsModule = utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"( #version 450 - out vec4 fragColor; + layout(location = 0) out vec4 fragColor; void main() { fragColor = vec4(0.0, 1.0, 0.0, 1.0); - })" - ); + })"); } void MakeRenderPassAndFrameBuffer(uint32_t subpassCount) { diff --git a/third_party/glslang b/third_party/glslang index f00c245a5f..b5b0846244 160000 --- a/third_party/glslang +++ b/third_party/glslang @@ -1 +1 @@ -Subproject commit f00c245a5f697cde2257e1280969429314a84958 +Subproject commit b5b08462442239e6537315ea1405b6afcd53043e diff --git a/third_party/shaderc b/third_party/shaderc index 01921d49da..c60725343f 160000 --- a/third_party/shaderc +++ b/third_party/shaderc @@ -1 +1 @@ -Subproject commit 01921d49da5d4d4311f3e2bd1ae2a27834974ab6 +Subproject commit c60725343fd6c0822bb7f580661d2ec6460391c0 diff --git a/third_party/spirv-headers b/third_party/spirv-headers index 661ad91124..0610978784 160000 --- a/third_party/spirv-headers +++ b/third_party/spirv-headers @@ -1 +1 @@ -Subproject commit 661ad91124e6af2272afd00f804d8aa276e17107 +Subproject commit 061097878467b8e040fbf153a837d844ef9f9f96 diff --git a/third_party/spirv-tools b/third_party/spirv-tools index 06d4fd52c2..90862fe4b1 160000 --- a/third_party/spirv-tools +++ b/third_party/spirv-tools @@ -1 +1 @@ -Subproject commit 06d4fd52c244ee5abf6819f721b9f68e5a3fcdb0 +Subproject commit 90862fe4b1c6763b32ce683d2d32c2f281f577cf