mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-17 17:05:31 +00:00
Implement WebGPU formats on D3D12
BUG=dawn:128 Change-Id: I1a71df25d9b7f003882366f052b83085ac5d1258 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8620 Reviewed-by: Austin Eng <enga@chromium.org> Reviewed-by: Jiawei Shao <jiawei.shao@intel.com> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
3e1bca702c
commit
bb218b8aea
@@ -141,7 +141,6 @@ class TextureFormatTest : public DawnTest {
|
||||
dawn::ShaderModule vsModule =
|
||||
utils::CreateShaderModule(device, dawn::ShaderStage::Vertex, R"(
|
||||
#version 450
|
||||
layout(location=0) out vec2 texCoord;
|
||||
void main() {
|
||||
const vec2 pos[3] = vec2[3](
|
||||
vec2(-3.0f, -1.0f),
|
||||
@@ -149,7 +148,6 @@ class TextureFormatTest : public DawnTest {
|
||||
vec2( 0.0f, 2.0f)
|
||||
);
|
||||
gl_Position = vec4(pos[gl_VertexIndex], 0.0f, 1.0f);
|
||||
texCoord = gl_Position.xy / 2.0f + vec2(0.5f);
|
||||
})");
|
||||
|
||||
// Compute the prefix needed for GLSL types that handle our texture's data.
|
||||
@@ -173,13 +171,11 @@ class TextureFormatTest : public DawnTest {
|
||||
fsSource << "#version 450\n";
|
||||
fsSource << "layout(set=0, binding=0) uniform sampler mySampler;\n";
|
||||
fsSource << "layout(set=0, binding=1) uniform " << prefix << "texture2D myTexture;\n";
|
||||
|
||||
fsSource << "layout(location=0) in vec2 texCoord;\n";
|
||||
fsSource << "layout(location=0) out " << prefix << "vec4 fragColor;\n";
|
||||
|
||||
fsSource << "void main() {\n";
|
||||
fsSource << " fragColor = texture(" << prefix
|
||||
<< "sampler2D(myTexture, mySampler), texCoord);\n";
|
||||
fsSource << " fragColor = texelFetch(" << prefix
|
||||
<< "sampler2D(myTexture, mySampler), ivec2(gl_FragCoord), 0);\n";
|
||||
fsSource << "}";
|
||||
|
||||
dawn::ShaderModule fsModule =
|
||||
@@ -685,4 +681,4 @@ TEST_P(TextureFormatTest, RG11B10Float) {
|
||||
// TODO(cwallez@chromium.org): Add tests for depth-stencil formats when we know if they are copyable
|
||||
// in WebGPU.
|
||||
|
||||
DAWN_INSTANTIATE_TEST(TextureFormatTest, MetalBackend, VulkanBackend);
|
||||
DAWN_INSTANTIATE_TEST(TextureFormatTest, D3D12Backend, MetalBackend, VulkanBackend);
|
||||
|
||||
Reference in New Issue
Block a user