mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-13 19:01:24 +00:00
Roll shaderc
This commit is contained in:
parent
ae7f113fe8
commit
b6fb5f3149
@ -102,12 +102,11 @@ void init() {
|
|||||||
|
|
||||||
nxt::ShaderModule fsModule = utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"(
|
nxt::ShaderModule fsModule = utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"(
|
||||||
#version 450
|
#version 450
|
||||||
out vec4 fragColor;
|
layout(location = 0) out vec4 fragColor;
|
||||||
layout(location = 0) in vec4 v_color;
|
layout(location = 0) in vec4 v_color;
|
||||||
void main() {
|
void main() {
|
||||||
fragColor = v_color;
|
fragColor = v_color;
|
||||||
})"
|
})");
|
||||||
);
|
|
||||||
|
|
||||||
renderpass = CreateDefaultRenderPass(device);
|
renderpass = CreateDefaultRenderPass(device);
|
||||||
depthStencilView = CreateDefaultDepthStencilView(device);
|
depthStencilView = CreateDefaultDepthStencilView(device);
|
||||||
|
@ -52,7 +52,7 @@ void init() {
|
|||||||
|
|
||||||
const char* fs =
|
const char* fs =
|
||||||
"#version 450\n"
|
"#version 450\n"
|
||||||
"out vec4 fragColor;"
|
"layout(location = 0) out vec4 fragColor;"
|
||||||
"void main() {\n"
|
"void main() {\n"
|
||||||
" fragColor = vec4(1.0, 0.0, 0.0, 1.0);\n"
|
" fragColor = vec4(1.0, 0.0, 0.0, 1.0);\n"
|
||||||
"}\n";
|
"}\n";
|
||||||
|
@ -109,7 +109,7 @@ void initRender() {
|
|||||||
|
|
||||||
nxt::ShaderModule fsModule = utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"(
|
nxt::ShaderModule fsModule = utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"(
|
||||||
#version 450
|
#version 450
|
||||||
out vec4 fragColor;
|
layout(location = 0) out vec4 fragColor;
|
||||||
void main() {
|
void main() {
|
||||||
fragColor = vec4(1.0);
|
fragColor = vec4(1.0);
|
||||||
}
|
}
|
||||||
|
@ -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
|
#version 450
|
||||||
layout(set = 0, binding = 0) uniform myBlock {
|
layout(set = 0, binding = 0) uniform myBlock {
|
||||||
int a;
|
int a;
|
||||||
float b;
|
float b;
|
||||||
} myUbo;
|
} myUbo;
|
||||||
out vec4 fragColor;
|
layout(location = 0) out vec4 fragColor;
|
||||||
void main() {
|
void main() {
|
||||||
fragColor = vec4(1.0, myUbo.a / 255.0, myUbo.b, 1.0);
|
fragColor = vec4(1.0, myUbo.a / 255.0, myUbo.b, 1.0);
|
||||||
})"
|
})");
|
||||||
);
|
|
||||||
|
|
||||||
nxt::BindGroupLayout bgl = device.CreateBindGroupLayoutBuilder()
|
nxt::BindGroupLayout bgl = device.CreateBindGroupLayoutBuilder()
|
||||||
.SetBindingsType(nxt::ShaderStageBit::Fragment, nxt::BindingType::UniformBuffer, 0, 1)
|
.SetBindingsType(nxt::ShaderStageBit::Fragment, nxt::BindingType::UniformBuffer, 0, 1)
|
||||||
|
@ -142,20 +142,19 @@ void init() {
|
|||||||
nxt::ShaderModule fsModule = utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"(
|
nxt::ShaderModule fsModule = utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"(
|
||||||
#version 450
|
#version 450
|
||||||
layout(location = 2) in vec3 f_col;
|
layout(location = 2) in vec3 f_col;
|
||||||
out vec4 fragColor;
|
layout(location = 0) out vec4 fragColor;
|
||||||
void main() {
|
void main() {
|
||||||
fragColor = vec4(f_col, 1.0);
|
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
|
#version 450
|
||||||
layout(location = 2) in vec3 f_col;
|
layout(location = 2) in vec3 f_col;
|
||||||
out vec4 fragColor;
|
layout(location = 0) out vec4 fragColor;
|
||||||
void main() {
|
void main() {
|
||||||
fragColor = vec4(mix(f_col, vec3(0.5, 0.5, 0.5), 0.5), 1.0);
|
fragColor = vec4(mix(f_col, vec3(0.5, 0.5, 0.5), 0.5), 1.0);
|
||||||
})"
|
})");
|
||||||
);
|
|
||||||
|
|
||||||
auto inputState = device.CreateInputStateBuilder()
|
auto inputState = device.CreateInputStateBuilder()
|
||||||
.SetAttribute(0, 0, nxt::VertexFormat::FloatR32G32B32, 0)
|
.SetAttribute(0, 0, nxt::VertexFormat::FloatR32G32B32, 0)
|
||||||
|
@ -64,11 +64,10 @@ void init() {
|
|||||||
|
|
||||||
nxt::ShaderModule fsModule = utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"(
|
nxt::ShaderModule fsModule = utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"(
|
||||||
#version 450
|
#version 450
|
||||||
out vec4 fragColor;
|
layout(location = 0) out vec4 fragColor;
|
||||||
void main() {
|
void main() {
|
||||||
fragColor = vec4(1.0, 0.0, 0.0, 1.0);
|
fragColor = vec4(1.0, 0.0, 0.0, 1.0);
|
||||||
})"
|
})");
|
||||||
);
|
|
||||||
|
|
||||||
auto inputState = device.CreateInputStateBuilder()
|
auto inputState = device.CreateInputStateBuilder()
|
||||||
.SetAttribute(0, 0, nxt::VertexFormat::FloatR32G32B32A32, 0)
|
.SetAttribute(0, 0, nxt::VertexFormat::FloatR32G32B32A32, 0)
|
||||||
|
@ -68,11 +68,10 @@ void init() {
|
|||||||
|
|
||||||
nxt::ShaderModule fsModule = utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"(
|
nxt::ShaderModule fsModule = utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"(
|
||||||
#version 450
|
#version 450
|
||||||
out vec4 fragColor;
|
layout(location = 0) out vec4 fragColor;
|
||||||
void main() {
|
void main() {
|
||||||
fragColor = vec4(1.0, 0.0, 0.0, 1.0);
|
fragColor = vec4(1.0, 0.0, 0.0, 1.0);
|
||||||
})"
|
})");
|
||||||
);
|
|
||||||
|
|
||||||
auto inputState = device.CreateInputStateBuilder()
|
auto inputState = device.CreateInputStateBuilder()
|
||||||
.SetAttribute(0, 0, nxt::VertexFormat::FloatR32G32B32A32, 0)
|
.SetAttribute(0, 0, nxt::VertexFormat::FloatR32G32B32A32, 0)
|
||||||
|
@ -102,11 +102,10 @@ void init() {
|
|||||||
layout(set = 0, binding = 0) uniform sampler mySampler;
|
layout(set = 0, binding = 0) uniform sampler mySampler;
|
||||||
layout(set = 0, binding = 1) uniform texture2D myTexture;
|
layout(set = 0, binding = 1) uniform texture2D myTexture;
|
||||||
|
|
||||||
out vec4 fragColor;
|
layout(location = 0) out vec4 fragColor;
|
||||||
void main() {
|
void main() {
|
||||||
fragColor = texture(sampler2D(myTexture, mySampler), gl_FragCoord.xy / vec2(640.0, 480.0));
|
fragColor = texture(sampler2D(myTexture, mySampler), gl_FragCoord.xy / vec2(640.0, 480.0));
|
||||||
})"
|
})");
|
||||||
);
|
|
||||||
|
|
||||||
auto inputState = device.CreateInputStateBuilder()
|
auto inputState = device.CreateInputStateBuilder()
|
||||||
.SetAttribute(0, 0, nxt::VertexFormat::FloatR32G32B32A32, 0)
|
.SetAttribute(0, 0, nxt::VertexFormat::FloatR32G32B32A32, 0)
|
||||||
|
@ -50,11 +50,10 @@ void init() {
|
|||||||
int a;
|
int a;
|
||||||
float b;
|
float b;
|
||||||
} myUbo;
|
} myUbo;
|
||||||
out vec4 fragColor;
|
layout(location = 0) out vec4 fragColor;
|
||||||
void main() {
|
void main() {
|
||||||
fragColor = vec4(1.0, myUbo.a / 255.0, myUbo.b, 1.0);
|
fragColor = vec4(1.0, myUbo.a / 255.0, myUbo.b, 1.0);
|
||||||
})"
|
})");
|
||||||
);
|
|
||||||
|
|
||||||
nxt::BindGroupLayout bgl = device.CreateBindGroupLayoutBuilder()
|
nxt::BindGroupLayout bgl = device.CreateBindGroupLayoutBuilder()
|
||||||
.SetBindingsType(nxt::ShaderStageBit::Fragment, nxt::BindingType::UniformBuffer, 0, 1)
|
.SetBindingsType(nxt::ShaderStageBit::Fragment, nxt::BindingType::UniformBuffer, 0, 1)
|
||||||
|
@ -180,11 +180,10 @@ class PrimitiveTopologyTest : public NXTTest {
|
|||||||
|
|
||||||
fsModule = utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"(
|
fsModule = utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"(
|
||||||
#version 450
|
#version 450
|
||||||
out vec4 fragColor;
|
layout(location = 0) out vec4 fragColor;
|
||||||
void main() {
|
void main() {
|
||||||
fragColor = vec4(0.0, 1.0, 0.0, 1.0);
|
fragColor = vec4(0.0, 1.0, 0.0, 1.0);
|
||||||
})"
|
})");
|
||||||
);
|
|
||||||
|
|
||||||
inputState = device.CreateInputStateBuilder()
|
inputState = device.CreateInputStateBuilder()
|
||||||
.SetAttribute(0, 0, nxt::VertexFormat::FloatR32G32B32A32, 0)
|
.SetAttribute(0, 0, nxt::VertexFormat::FloatR32G32B32A32, 0)
|
||||||
|
@ -88,7 +88,7 @@ class RenderPassLoadOpTests : public NXTTest {
|
|||||||
)";
|
)";
|
||||||
const char* fsSource = R"(
|
const char* fsSource = R"(
|
||||||
#version 450
|
#version 450
|
||||||
out vec4 color;
|
layout(location = 0) out vec4 color;
|
||||||
void main() {
|
void main() {
|
||||||
color = vec4(0.f, 0.f, 1.f, 1.f);
|
color = vec4(0.f, 0.f, 1.f, 1.f);
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ class InputStateTest : public ValidationTest {
|
|||||||
nxt::ShaderModuleBuilder fsModuleBuilder = AssertWillBeSuccess(device.CreateShaderModuleBuilder());
|
nxt::ShaderModuleBuilder fsModuleBuilder = AssertWillBeSuccess(device.CreateShaderModuleBuilder());
|
||||||
utils::FillShaderModuleBuilder(fsModuleBuilder, nxt::ShaderStage::Fragment, R"(
|
utils::FillShaderModuleBuilder(fsModuleBuilder, nxt::ShaderStage::Fragment, R"(
|
||||||
#version 450
|
#version 450
|
||||||
out vec4 fragColor;
|
layout(location = 0) out vec4 fragColor;
|
||||||
void main() {
|
void main() {
|
||||||
fragColor = vec4(1.0, 0.0, 0.0, 1.0);
|
fragColor = vec4(1.0, 0.0, 0.0, 1.0);
|
||||||
}
|
}
|
||||||
|
@ -38,11 +38,10 @@ class RenderPipelineValidationTest : public ValidationTest {
|
|||||||
|
|
||||||
fsModule = utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"(
|
fsModule = utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"(
|
||||||
#version 450
|
#version 450
|
||||||
out vec4 fragColor;
|
layout(location = 0) out vec4 fragColor;
|
||||||
void main() {
|
void main() {
|
||||||
fragColor = vec4(0.0, 1.0, 0.0, 1.0);
|
fragColor = vec4(0.0, 1.0, 0.0, 1.0);
|
||||||
})"
|
})");
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nxt::RenderPipelineBuilder& AddDefaultStates(nxt::RenderPipelineBuilder&& builder) {
|
nxt::RenderPipelineBuilder& AddDefaultStates(nxt::RenderPipelineBuilder&& builder) {
|
||||||
|
@ -25,11 +25,10 @@ class VertexBufferValidationTest : public ValidationTest {
|
|||||||
|
|
||||||
fsModule = utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"(
|
fsModule = utils::CreateShaderModule(device, nxt::ShaderStage::Fragment, R"(
|
||||||
#version 450
|
#version 450
|
||||||
out vec4 fragColor;
|
layout(location = 0) out vec4 fragColor;
|
||||||
void main() {
|
void main() {
|
||||||
fragColor = vec4(0.0, 1.0, 0.0, 1.0);
|
fragColor = vec4(0.0, 1.0, 0.0, 1.0);
|
||||||
})"
|
})");
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeRenderPassAndFrameBuffer(uint32_t subpassCount) {
|
void MakeRenderPassAndFrameBuffer(uint32_t subpassCount) {
|
||||||
|
2
third_party/glslang
vendored
2
third_party/glslang
vendored
@ -1 +1 @@
|
|||||||
Subproject commit f00c245a5f697cde2257e1280969429314a84958
|
Subproject commit b5b08462442239e6537315ea1405b6afcd53043e
|
2
third_party/shaderc
vendored
2
third_party/shaderc
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 01921d49da5d4d4311f3e2bd1ae2a27834974ab6
|
Subproject commit c60725343fd6c0822bb7f580661d2ec6460391c0
|
2
third_party/spirv-headers
vendored
2
third_party/spirv-headers
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 661ad91124e6af2272afd00f804d8aa276e17107
|
Subproject commit 061097878467b8e040fbf153a837d844ef9f9f96
|
2
third_party/spirv-tools
vendored
2
third_party/spirv-tools
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 06d4fd52c244ee5abf6819f721b9f68e5a3fcdb0
|
Subproject commit 90862fe4b1c6763b32ce683d2d32c2f281f577cf
|
Loading…
x
Reference in New Issue
Block a user