mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-13 19:01:24 +00:00
Update vertex index decoration names.
This Cl updates the `vertex_idx` to the new `vertex_index` decoration name. Change-Id: Ic3688e1af87ed0d570b00ccb72d0e84ac920831b Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/38142 Commit-Queue: dan sinclair <dsinclair@chromium.org> Auto-Submit: dan sinclair <dsinclair@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
parent
534517ca63
commit
c2032ea637
@ -37,7 +37,7 @@ void init() {
|
|||||||
wgpuSwapChainConfigure(swapchain, swapChainFormat, WGPUTextureUsage_RenderAttachment, 640, 480);
|
wgpuSwapChainConfigure(swapchain, swapChainFormat, WGPUTextureUsage_RenderAttachment, 640, 480);
|
||||||
|
|
||||||
const char* vs =
|
const char* vs =
|
||||||
"[[builtin(vertex_idx)]] var<in> VertexIndex : u32;\n"
|
"[[builtin(vertex_index)]] var<in> VertexIndex : u32;\n"
|
||||||
"[[builtin(position)]] var<out> Position : vec4<f32>;\n"
|
"[[builtin(position)]] var<out> Position : vec4<f32>;\n"
|
||||||
"const pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(\n"
|
"const pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(\n"
|
||||||
" vec2<f32>( 0.0, 0.5),\n"
|
" vec2<f32>( 0.0, 0.5),\n"
|
||||||
|
@ -313,7 +313,7 @@ int main(int argc, const char* argv[]) {
|
|||||||
// The hacky pipeline to render a triangle.
|
// The hacky pipeline to render a triangle.
|
||||||
utils::ComboRenderPipelineDescriptor pipelineDesc(device);
|
utils::ComboRenderPipelineDescriptor pipelineDesc(device);
|
||||||
pipelineDesc.vertexStage.module = utils::CreateShaderModuleFromWGSL(device, R"(
|
pipelineDesc.vertexStage.module = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
const pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(
|
const pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(
|
||||||
vec2<f32>( 0.0, 0.5),
|
vec2<f32>( 0.0, 0.5),
|
||||||
|
@ -44,7 +44,7 @@ namespace dawn_native {
|
|||||||
vec2<f32>( 0.5, 2.0));
|
vec2<f32>( 0.5, 2.0));
|
||||||
[[location(0)]] var<out> v_texcoord: vec2<f32>;
|
[[location(0)]] var<out> v_texcoord: vec2<f32>;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[binding(0), group(0)]] var<uniform> uniforms : Uniforms;
|
[[binding(0), group(0)]] var<uniform> uniforms : Uniforms;
|
||||||
[[stage(vertex)]] fn main() -> void {
|
[[stage(vertex)]] fn main() -> void {
|
||||||
Position = vec4<f32>((texcoord[VertexIndex] * 2.0 - vec2<f32>(1.0, 1.0)), 0.0, 1.0);
|
Position = vec4<f32>((texcoord[VertexIndex] * 2.0 - vec2<f32>(1.0, 1.0)), 0.0, 1.0);
|
||||||
|
@ -46,7 +46,7 @@ class BindGroupTests : public DawnTest {
|
|||||||
|
|
||||||
wgpu::ShaderModule MakeSimpleVSModule() const {
|
wgpu::ShaderModule MakeSimpleVSModule() const {
|
||||||
return utils::CreateShaderModuleFromWGSL(device, R"(
|
return utils::CreateShaderModuleFromWGSL(device, R"(
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
|
|
||||||
[[stage(vertex)]] fn main() -> void {
|
[[stage(vertex)]] fn main() -> void {
|
||||||
@ -164,7 +164,7 @@ TEST_P(BindGroupTests, ReusedUBO) {
|
|||||||
|
|
||||||
[[group(0), binding(0)]] var <uniform> vertexUbo : VertexUniformBuffer;
|
[[group(0), binding(0)]] var <uniform> vertexUbo : VertexUniformBuffer;
|
||||||
|
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
|
|
||||||
[[stage(vertex)]] fn main() -> void {
|
[[stage(vertex)]] fn main() -> void {
|
||||||
@ -251,7 +251,7 @@ TEST_P(BindGroupTests, UBOSamplerAndTexture) {
|
|||||||
};
|
};
|
||||||
[[group(0), binding(0)]] var <uniform> vertexUbo : VertexUniformBuffer;
|
[[group(0), binding(0)]] var <uniform> vertexUbo : VertexUniformBuffer;
|
||||||
|
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
|
|
||||||
[[stage(vertex)]] fn main() -> void {
|
[[stage(vertex)]] fn main() -> void {
|
||||||
@ -374,7 +374,7 @@ TEST_P(BindGroupTests, MultipleBindLayouts) {
|
|||||||
[[group(0), binding(0)]] var <uniform> vertexUbo1 : VertexUniformBuffer1;
|
[[group(0), binding(0)]] var <uniform> vertexUbo1 : VertexUniformBuffer1;
|
||||||
[[group(1), binding(0)]] var <uniform> vertexUbo2 : VertexUniformBuffer2;
|
[[group(1), binding(0)]] var <uniform> vertexUbo2 : VertexUniformBuffer2;
|
||||||
|
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
|
|
||||||
[[stage(vertex)]] fn main() -> void {
|
[[stage(vertex)]] fn main() -> void {
|
||||||
@ -961,7 +961,7 @@ TEST_P(BindGroupTests, ArbitraryBindingNumbers) {
|
|||||||
utils::BasicRenderPass renderPass = utils::CreateBasicRenderPass(device, kRTSize, kRTSize);
|
utils::BasicRenderPass renderPass = utils::CreateBasicRenderPass(device, kRTSize, kRTSize);
|
||||||
|
|
||||||
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
|
|
||||||
[[stage(vertex)]] fn main() -> void {
|
[[stage(vertex)]] fn main() -> void {
|
||||||
@ -1117,7 +1117,7 @@ TEST_P(BindGroupTests, ReadonlyStorage) {
|
|||||||
utils::ComboRenderPipelineDescriptor pipelineDescriptor(device);
|
utils::ComboRenderPipelineDescriptor pipelineDescriptor(device);
|
||||||
|
|
||||||
pipelineDescriptor.vertexStage.module = utils::CreateShaderModuleFromWGSL(device, R"(
|
pipelineDescriptor.vertexStage.module = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
|
|
||||||
[[stage(vertex)]] fn main() -> void {
|
[[stage(vertex)]] fn main() -> void {
|
||||||
|
@ -293,7 +293,7 @@ class BufferZeroInitTest : public DawnTest {
|
|||||||
CreateRenderPipelineForTest(R"(
|
CreateRenderPipelineForTest(R"(
|
||||||
[[location(0)]] var<out> o_color : vec4<f32>;
|
[[location(0)]] var<out> o_color : vec4<f32>;
|
||||||
|
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
|
|
||||||
[[stage(vertex)]] fn main() -> void {
|
[[stage(vertex)]] fn main() -> void {
|
||||||
|
@ -34,7 +34,7 @@ class ClipSpaceTest : public DawnTest {
|
|||||||
vec3<f32>(-1.0, -1.0, 0.5),
|
vec3<f32>(-1.0, -1.0, 0.5),
|
||||||
vec3<f32>( 1.0, -1.0, 0.0));
|
vec3<f32>( 1.0, -1.0, 0.0));
|
||||||
|
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
|
|
||||||
[[stage(vertex)]] fn main() -> void {
|
[[stage(vertex)]] fn main() -> void {
|
||||||
|
@ -31,7 +31,7 @@ class ColorStateTest : public DawnTest {
|
|||||||
DawnTest::SetUp();
|
DawnTest::SetUp();
|
||||||
|
|
||||||
vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
|
|
||||||
[[stage(vertex)]] fn main() -> void {
|
[[stage(vertex)]] fn main() -> void {
|
||||||
|
@ -143,7 +143,7 @@ class CompressedTextureBCFormatTest : public DawnTest {
|
|||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
[[location(0)]] var<out> texCoord : vec2 <f32>;
|
[[location(0)]] var<out> texCoord : vec2 <f32>;
|
||||||
|
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
|
|
||||||
[[stage(vertex)]] fn main() -> void {
|
[[stage(vertex)]] fn main() -> void {
|
||||||
const pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(
|
const pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(
|
||||||
|
@ -34,7 +34,7 @@ class CullingTest : public DawnTest {
|
|||||||
vec2<f32>( 1.0, 0.0),
|
vec2<f32>( 1.0, 0.0),
|
||||||
vec2<f32>( 1.0, -1.0));
|
vec2<f32>( 1.0, -1.0));
|
||||||
|
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
|
|
||||||
[[stage(vertex)]] fn main() -> void {
|
[[stage(vertex)]] fn main() -> void {
|
||||||
|
@ -36,7 +36,7 @@ class DepthBiasTests : public DawnTest {
|
|||||||
case QuadAngle::Flat:
|
case QuadAngle::Flat:
|
||||||
// Draw a square at z = 0.25
|
// Draw a square at z = 0.25
|
||||||
vertexSource = R"(
|
vertexSource = R"(
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
[[stage(vertex)]] fn main() -> void {
|
[[stage(vertex)]] fn main() -> void {
|
||||||
const pos : array<vec2<f32>, 6> = array<vec2<f32>, 6>(
|
const pos : array<vec2<f32>, 6> = array<vec2<f32>, 6>(
|
||||||
@ -54,7 +54,7 @@ class DepthBiasTests : public DawnTest {
|
|||||||
case QuadAngle::TiltedX:
|
case QuadAngle::TiltedX:
|
||||||
// Draw a square ranging from 0 to 0.5, bottom to top
|
// Draw a square ranging from 0 to 0.5, bottom to top
|
||||||
vertexSource = R"(
|
vertexSource = R"(
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
[[stage(vertex)]] fn main() -> void {
|
[[stage(vertex)]] fn main() -> void {
|
||||||
const pos : array<vec3<f32>, 6> = array<vec3<f32>, 6>(
|
const pos : array<vec3<f32>, 6> = array<vec3<f32>, 6>(
|
||||||
|
@ -29,7 +29,7 @@ class DepthStencilCopyTests : public DawnTest {
|
|||||||
|
|
||||||
// Draw a square in the bottom left quarter of the screen.
|
// Draw a square in the bottom left quarter of the screen.
|
||||||
mVertexModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
mVertexModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
|
|
||||||
[[stage(vertex)]] fn main() -> void {
|
[[stage(vertex)]] fn main() -> void {
|
||||||
@ -239,7 +239,7 @@ class DepthStencilCopyTests : public DawnTest {
|
|||||||
utils::ComboRenderPipelineDescriptor pipelineDescriptor(device);
|
utils::ComboRenderPipelineDescriptor pipelineDescriptor(device);
|
||||||
|
|
||||||
pipelineDescriptor.vertexStage.module = utils::CreateShaderModuleFromWGSL(device, R"(
|
pipelineDescriptor.vertexStage.module = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
|
|
||||||
[[stage(vertex)]] fn main() -> void {
|
[[stage(vertex)]] fn main() -> void {
|
||||||
|
@ -58,7 +58,7 @@ class DepthStencilStateTest : public DawnTest {
|
|||||||
[[offset(12)]] depth : f32;
|
[[offset(12)]] depth : f32;
|
||||||
};
|
};
|
||||||
[[group(0), binding(0)]] var<uniform> ubo : UBO;
|
[[group(0), binding(0)]] var<uniform> ubo : UBO;
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
|
|
||||||
[[stage(vertex)]] fn main() -> void {
|
[[stage(vertex)]] fn main() -> void {
|
||||||
|
@ -94,7 +94,7 @@ class DynamicBufferOffsetTests : public DawnTest {
|
|||||||
|
|
||||||
wgpu::RenderPipeline CreateRenderPipeline(bool isInheritedPipeline = false) {
|
wgpu::RenderPipeline CreateRenderPipeline(bool isInheritedPipeline = false) {
|
||||||
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
[[stage(vertex)]] fn main() -> void {
|
[[stage(vertex)]] fn main() -> void {
|
||||||
const pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(
|
const pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(
|
||||||
|
@ -91,7 +91,7 @@ void FirstIndexOffsetTests::TestImpl(DrawMode mode,
|
|||||||
|
|
||||||
if ((checkIndex & CheckIndex::Vertex) != 0) {
|
if ((checkIndex & CheckIndex::Vertex) != 0) {
|
||||||
vertexShader << R"(
|
vertexShader << R"(
|
||||||
[[builtin(vertex_idx)]] var<in> vertex_index : u32;
|
[[builtin(vertex_index)]] var<in> vertex_index : u32;
|
||||||
[[location(1)]] var<out> out_vertex_index : u32;
|
[[location(1)]] var<out> out_vertex_index : u32;
|
||||||
)";
|
)";
|
||||||
fragmentShader << R"(
|
fragmentShader << R"(
|
||||||
@ -100,7 +100,7 @@ void FirstIndexOffsetTests::TestImpl(DrawMode mode,
|
|||||||
}
|
}
|
||||||
if ((checkIndex & CheckIndex::Instance) != 0) {
|
if ((checkIndex & CheckIndex::Instance) != 0) {
|
||||||
vertexShader << R"(
|
vertexShader << R"(
|
||||||
[[builtin(instance_idx)]] var<in> instance_index : u32;
|
[[builtin(instance_index)]] var<in> instance_index : u32;
|
||||||
[[location(2)]] var<out> out_instance_index : u32;
|
[[location(2)]] var<out> out_instance_index : u32;
|
||||||
)";
|
)";
|
||||||
fragmentShader << R"(
|
fragmentShader << R"(
|
||||||
|
@ -248,7 +248,7 @@ class IOSurfaceUsageTests : public IOSurfaceTestBase {
|
|||||||
wgpu::RenderPipeline pipeline;
|
wgpu::RenderPipeline pipeline;
|
||||||
{
|
{
|
||||||
wgpu::ShaderModule vs = utils::CreateShaderModuleFromWGSL(device, R"(
|
wgpu::ShaderModule vs = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[location(0)]] var<out> o_texCoord : vec2<f32>;
|
[[location(0)]] var<out> o_texCoord : vec2<f32>;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ class IndexFormatTest : public DawnTest {
|
|||||||
wgpu::PrimitiveTopology primitiveTopology = wgpu::PrimitiveTopology::TriangleStrip) {
|
wgpu::PrimitiveTopology primitiveTopology = wgpu::PrimitiveTopology::TriangleStrip) {
|
||||||
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||||
[[location(0)]] var<in> pos : vec4<f32>;
|
[[location(0)]] var<in> pos : vec4<f32>;
|
||||||
[[builtin(vertex_idx)]] var<in> idx : u32;
|
[[builtin(vertex_index)]] var<in> idx : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
[[stage(vertex)]] fn main() -> void {
|
[[stage(vertex)]] fn main() -> void {
|
||||||
// 0xFFFFFFFE is a designated invalid index used by some tests.
|
// 0xFFFFFFFE is a designated invalid index used by some tests.
|
||||||
|
@ -39,7 +39,7 @@ class OcclusionQueryTests : public QueryTests {
|
|||||||
DawnTest::SetUp();
|
DawnTest::SetUp();
|
||||||
|
|
||||||
vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
[[stage(vertex)]] fn main() -> void {
|
[[stage(vertex)]] fn main() -> void {
|
||||||
const pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(
|
const pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(
|
||||||
|
@ -77,7 +77,7 @@ class RenderPassLoadOpTests : public DawnTest {
|
|||||||
|
|
||||||
// draws a blue quad on the right half of the screen
|
// draws a blue quad on the right half of the screen
|
||||||
const char* vsSource = R"(
|
const char* vsSource = R"(
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
|
|
||||||
[[stage(vertex)]] fn main() -> void {
|
[[stage(vertex)]] fn main() -> void {
|
||||||
|
@ -27,7 +27,7 @@ class RenderPassTest : public DawnTest {
|
|||||||
|
|
||||||
// Shaders to draw a bottom-left triangle in blue.
|
// Shaders to draw a bottom-left triangle in blue.
|
||||||
mVSModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
mVSModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
|
|
||||||
[[stage(vertex)]] fn main() -> void {
|
[[stage(vertex)]] fn main() -> void {
|
||||||
|
@ -55,7 +55,7 @@ class SamplerTest : public DawnTest {
|
|||||||
mRenderPass = utils::CreateBasicRenderPass(device, kRTSize, kRTSize);
|
mRenderPass = utils::CreateBasicRenderPass(device, kRTSize, kRTSize);
|
||||||
|
|
||||||
auto vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
auto vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
|
|
||||||
[[stage(vertex)]] fn main() -> void {
|
[[stage(vertex)]] fn main() -> void {
|
||||||
|
@ -21,9 +21,9 @@ class ScissorTest : public DawnTest {
|
|||||||
protected:
|
protected:
|
||||||
wgpu::RenderPipeline CreateQuadPipeline(wgpu::TextureFormat format) {
|
wgpu::RenderPipeline CreateQuadPipeline(wgpu::TextureFormat format) {
|
||||||
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
|
|
||||||
const pos : array<vec2<f32>, 6> = array<vec2<f32>, 6>(
|
const pos : array<vec2<f32>, 6> = array<vec2<f32>, 6>(
|
||||||
vec2<f32>(-1.0, -1.0),
|
vec2<f32>(-1.0, -1.0),
|
||||||
vec2<f32>(-1.0, 1.0),
|
vec2<f32>(-1.0, 1.0),
|
||||||
|
@ -147,7 +147,7 @@ class TextureFormatTest : public DawnTest {
|
|||||||
utils::ComboRenderPipelineDescriptor desc(device);
|
utils::ComboRenderPipelineDescriptor desc(device);
|
||||||
|
|
||||||
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
|
|
||||||
[[stage(vertex)]] fn main() -> void {
|
[[stage(vertex)]] fn main() -> void {
|
||||||
|
@ -50,7 +50,7 @@ class TextureSubresourceTest : public DawnTest {
|
|||||||
|
|
||||||
void DrawTriangle(const wgpu::TextureView& view) {
|
void DrawTriangle(const wgpu::TextureView& view) {
|
||||||
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
|
|
||||||
[[stage(vertex)]] fn main() -> void {
|
[[stage(vertex)]] fn main() -> void {
|
||||||
@ -90,7 +90,7 @@ class TextureSubresourceTest : public DawnTest {
|
|||||||
|
|
||||||
void SampleAndDraw(const wgpu::TextureView& samplerView, const wgpu::TextureView& renderView) {
|
void SampleAndDraw(const wgpu::TextureView& samplerView, const wgpu::TextureView& renderView) {
|
||||||
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
|
|
||||||
[[stage(vertex)]] fn main() -> void {
|
[[stage(vertex)]] fn main() -> void {
|
||||||
|
@ -23,7 +23,7 @@ class ViewportTest : public DawnTest {
|
|||||||
DawnTest::SetUp();
|
DawnTest::SetUp();
|
||||||
|
|
||||||
mQuadVS = utils::CreateShaderModuleFromWGSL(device, R"(
|
mQuadVS = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
|
|
||||||
const pos : array<vec2<f32>, 6> = array<vec2<f32>, 6>(
|
const pos : array<vec2<f32>, 6> = array<vec2<f32>, 6>(
|
||||||
@ -96,7 +96,7 @@ class ViewportTest : public DawnTest {
|
|||||||
// Create a pipeline drawing 3 points at depth 1.0, 0.5 and 0.0.
|
// Create a pipeline drawing 3 points at depth 1.0, 0.5 and 0.0.
|
||||||
utils::ComboRenderPipelineDescriptor pipelineDesc(device);
|
utils::ComboRenderPipelineDescriptor pipelineDesc(device);
|
||||||
pipelineDesc.vertexStage.module = utils::CreateShaderModuleFromWGSL(device, R"(
|
pipelineDesc.vertexStage.module = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
|
|
||||||
const points : array<vec3<f32>, 3> = array<vec3<f32>, 3>(
|
const points : array<vec3<f32>, 3> = array<vec3<f32>, 3>(
|
||||||
|
@ -475,7 +475,7 @@ TEST_F(RenderPipelineValidationTest, StorageBufferInVertexShaderNoLayout) {
|
|||||||
[[offset(0)]] data : [[stride(4)]] array<u32, 100>;
|
[[offset(0)]] data : [[stride(4)]] array<u32, 100>;
|
||||||
};
|
};
|
||||||
[[group(0), binding(0)]] var<storage_buffer> dst : [[access(read_write)]] Dst;
|
[[group(0), binding(0)]] var<storage_buffer> dst : [[access(read_write)]] Dst;
|
||||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||||
[[stage(vertex)]] fn main() -> void {
|
[[stage(vertex)]] fn main() -> void {
|
||||||
dst.data[VertexIndex] = 0x1234u;
|
dst.data[VertexIndex] = 0x1234u;
|
||||||
})");
|
})");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user