From f2dc0fe8d222931cf85580c20023990f6a9feafc Mon Sep 17 00:00:00 2001 From: Jiawei Shao Date: Thu, 21 May 2020 17:05:05 +0800 Subject: [PATCH 1/2] Disallow using cube map or cube map array texture views as storage textures This patch adds validation to disallow using cube map and cube map array texture views as storage textures as HLSL doesn't support RWTextureCube or RWTextureCubeArray, and Load() function cannot be called on TextureCube or TextureCubeArray. --- spec/index.bs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/index.bs b/spec/index.bs index 51014d5140..aa91d734f0 100644 --- a/spec/index.bs +++ b/spec/index.bs @@ -1879,7 +1879,8 @@ A {{GPUBindGroupLayout}} object has the following internal slots: 1. If |bindingDescriptor|.{{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/sampled-texture}} , ensure [=sampled texture validation=] is not violated. 1. If |bindingDescriptor|.{{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/readonly-storage-texture}} or {{GPUBindingType/writeonly-storage-texture}} - , ensure [=storage texture validation=] is not violated. + 1. Ensure [=storage texture validation=] is not violated. + 1. |bindingDescriptor|.{{GPUBindGroupLayoutEntry/viewDimension}} must not be {{GPUTextureViewDimension/cube}} or {{GPUTextureViewDimension/cube-array}}. 1. If |bindingDescriptor|.{{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/sampler}} , ensure [=sampler validation=] is not violated. 1. Insert |bindingDescriptor| into |layout|.{{GPUBindGroupLayout/[[entryMap]]}} From 8b34f8b5dcbd18ed26bbda579745638681e79854 Mon Sep 17 00:00:00 2001 From: Jiawei Shao Date: Thu, 21 May 2020 18:29:20 +0800 Subject: [PATCH 2/2] Small fix --- spec/index.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/index.bs b/spec/index.bs index aa91d734f0..19ac1da4b4 100644 --- a/spec/index.bs +++ b/spec/index.bs @@ -1879,8 +1879,7 @@ A {{GPUBindGroupLayout}} object has the following internal slots: 1. If |bindingDescriptor|.{{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/sampled-texture}} , ensure [=sampled texture validation=] is not violated. 1. If |bindingDescriptor|.{{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/readonly-storage-texture}} or {{GPUBindingType/writeonly-storage-texture}} - 1. Ensure [=storage texture validation=] is not violated. - 1. |bindingDescriptor|.{{GPUBindGroupLayoutEntry/viewDimension}} must not be {{GPUTextureViewDimension/cube}} or {{GPUTextureViewDimension/cube-array}}. + , ensure [=storage texture validation=] is not violated. 1. If |bindingDescriptor|.{{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/sampler}} , ensure [=sampler validation=] is not violated. 1. Insert |bindingDescriptor| into |layout|.{{GPUBindGroupLayout/[[entryMap]]}} @@ -1921,6 +1920,7 @@ A {{GPUBindGroupLayout}} object has the following internal slots: storage texture validation: There must be {{GPULimits/maxStorageTexturesPerShaderStage|GPULimits.maxStorageTexturesPerShaderStage}} or fewer |bindingDescriptor|s of type {{GPUBindingType/readonly-storage-texture}} and {{GPUBindingType/writeonly-storage-texture}} visible on each shader stage in |descriptor|. |bindingDescriptor|.{{GPUBindGroupLayoutEntry/hasDynamicOffset}} must be `false`. + |bindingDescriptor|.{{GPUBindGroupLayoutEntry/viewDimension}} must not be {{GPUTextureViewDimension/cube}} or {{GPUTextureViewDimension/cube-array}}. sampler validation: There must be {{GPULimits/maxSamplersPerShaderStage|GPULimits.maxSamplersPerShaderStage}} or fewer |bindingDescriptor|s of type {{GPUBindingType/sampler}} visible on each shader stage in |descriptor|.