Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Unorm10_10_10_2 VertexFormat #1

Open
wants to merge 127 commits into
base: trunk
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
bd51f85
Implement VertexFormat Unorm_10_10_10_2
McMackety Feb 11, 2024
84ec826
Fix issues with updating web-sys and update CHANGELOG.md
McMackety Feb 11, 2024
e154cc0
refactor(vulkan): hoist validation layer check
ErichDonGubler Feb 5, 2024
6a51f3d
refactor(vulkan): extract `enumerate_instance_extension_properties` h…
ErichDonGubler Feb 9, 2024
31ac63c
feat(vulkan): enable GPU-based validation for Vulkan backend
ErichDonGubler Jan 11, 2024
95c026b
docs: note that `GPU_BASED_VALIDATION` implies `VALIDATION`
ErichDonGubler Feb 1, 2024
f350f28
Separate native-only feature for `wgpu::CommandEncoder::write_timesta…
Wumpf Feb 13, 2024
e4ef3b4
Add an advanced_debugging preset including wgpu base validation (#5248)
nical Feb 13, 2024
a7d7674
MissingBufferUsageError now has an id prop (#5203)
andristarr Feb 14, 2024
d4fe193
build(deps): bump crate-ci/typos from 1.18.0 to 1.18.2 (#5240)
dependabot[bot] Feb 15, 2024
2b48772
fix(dx12): discard cmd. enc. buf. on drop
ErichDonGubler Feb 13, 2024
754d93a
fix(gles): discard cmd. enc. buf. on drop
ErichDonGubler Feb 13, 2024
18b7904
fix: discard cmd. enc. buf. on `wgpu_core::Global::command_encoder_drop`
ErichDonGubler Feb 14, 2024
b704132
Remove unnecessary "gl_PerVertex" name check so unused builtins will be
Imberflur Feb 9, 2024
4554f85
[spv-in] Remove providing "perVertexStruct" for certain unnamed inputs
Imberflur Feb 11, 2024
ae22743
Add test case to naga/spv-in for an unnamed glPerVertex struct
Imberflur Feb 11, 2024
6223af3
Extract entry point processing from parse_function into an independen…
Imberflur Feb 11, 2024
8b818a2
Defer entry-point processing so that all potential uses of builtin's …
Imberflur Feb 11, 2024
abc0b30
Add test case for builtin only accessed in function parsed after the …
Imberflur Feb 11, 2024
286306d
Store the device's queue via a weak ref instead of an ID (#5230)
nical Feb 15, 2024
66ba64b
Store Arcs instead of IDs in render bundles (#5242)
nical Feb 15, 2024
004e3ef
Simplify the ID allocation in IdentityValues (#5229)
nical Feb 15, 2024
df386da
Add vec3-in-array-test (#5264)
cwfitzgerald Feb 18, 2024
a302c8d
Docs surface creation no longer unsafe (#5265)
hackaugusto Feb 19, 2024
a016a3a
Make Features fit in 64 bits again (#5268)
nical Feb 19, 2024
2e9ee0a
[wgpu-hal.gles] Error log for failed GLES heuristics (#5266)
PolyMeilex Feb 19, 2024
910fb7c
Remove GPU based validation in Tests (#5271)
cwfitzgerald Feb 19, 2024
75a98f2
Validate that the view dimension of a multisampled texture binding is…
nical Feb 21, 2024
66c7e98
Add feature flags in hal to panic when running into some types of err…
nical Feb 21, 2024
3715cb1
fix doc link (#5280)
HexoKnight Feb 21, 2024
440574f
fix typo in docstring (#5281)
PWhiddy Feb 21, 2024
5b9ade8
Add AccelerationStructure to WGSL write_value_type (#5261)
JMS55 Feb 24, 2024
a315925
wgpu-core: Inform user about possible fix (#5298)
hackaugusto Feb 25, 2024
177517a
deps: Update `ahash` to fix "unknown feature `stdsimd`" error. (#5304)
waywardmonkeys Feb 26, 2024
7300b9f
style: fix fmt. of `assert!(…)` in `clear_texture_via_buffer_copies`
ErichDonGubler Feb 21, 2024
751cddc
refactor: `command_encoder_clear_buffer`: s/end/end_offset
ErichDonGubler Feb 21, 2024
9747a0e
fix: always check buffer clear `offset` for OOB
ErichDonGubler Feb 21, 2024
d646570
fix: `command_encoder_clear_buffer`: err. on `offset + size > u64::MAX`
ErichDonGubler Feb 21, 2024
38419a9
Fix Integer Clamp (#5300)
cwfitzgerald Feb 26, 2024
c77b4d3
Use a unique tracker index per resource instead of the ID in trackers…
nical Feb 26, 2024
ed852c4
Don't put the mapped-at-creation staging buffer in the registry
nical Feb 26, 2024
6f68d3d
Correctly set the tacker sizes before executing render bundles
nical Feb 27, 2024
23392c5
Try to load `libX11.so.6` in addition to `libX11.so`. (#5307)
vorporeal Feb 27, 2024
5e6f799
Fix docs.rs Builds (#5310)
cwfitzgerald Feb 27, 2024
be384fc
refactor: factor out `stage_err` helper in pipeline creation
ErichDonGubler Feb 26, 2024
2c66504
refactor(valid): factor out `shader_stage_from_stage_bit` helper
ErichDonGubler Feb 26, 2024
023b0e0
feat!: make `ProgrammableStage::entry_point` optional in `wgpu-core`
ErichDonGubler Jan 30, 2024
d365927
test(player): don't specify shader entry points
ErichDonGubler Feb 26, 2024
744454b
Bump Many Dependencies and MSRV (#5241)
dependabot[bot] Feb 27, 2024
330a860
Fix Presentation (#5312)
cwfitzgerald Feb 28, 2024
8129897
Nested loop test
cwfitzgerald Feb 27, 2024
b020b98
[naga] Fix docs generated by `gen_component_wise_extractor`. (#5314)
jimblandy Feb 29, 2024
a5c0181
Bitfield Fixes (#5305)
cwfitzgerald Feb 29, 2024
aaf6db6
Vendor WebGPU Bindings from web_sys (#5325)
cwfitzgerald Mar 1, 2024
2d8d045
wgpu-hal: add ndk-sys dependency to fix linking error. (#5326)
ashdnazg Mar 1, 2024
f0ed4cf
Add support for running on OpenGL 4.1 with a core profile on macOS (#…
bes Mar 3, 2024
352cb3d
Add OpenGL support for TEXTURE_FORMAT_16BIT_NORM on supported version…
bes Mar 3, 2024
19cc9d9
Revert "Add OpenGL support for TEXTURE_FORMAT_16BIT_NORM on supported…
bes Mar 4, 2024
9c9418e
[wgpu-hal] make android dependencies optional based on features
teoxoy Mar 4, 2024
f5b5d68
build(deps): bump crate-ci/typos from 1.18.2 to 1.19.0 (#5336)
dependabot[bot] Mar 4, 2024
44faebf
build(deps): bump mio from 0.8.10 to 0.8.11
dependabot[bot] Mar 4, 2024
badb3c8
feat: const feature defaults (#5343)
MultisampledNight Mar 5, 2024
4e85106
Don't depend on validation layers for setting object names
DJMcNab Mar 5, 2024
74238e2
Fix clippy error
DJMcNab Mar 5, 2024
5162fd4
Add a changelog entry
DJMcNab Mar 5, 2024
8f1981d
fix: emit valid. err. on dev. mismatch in `queue_write_buffer` (#5359)
ErichDonGubler Mar 7, 2024
ffaabeb
[naga xtask] Update Cargo.lock for dependabot #5241.
jimblandy Mar 6, 2024
d417433
Naga: GLSL 410 does not support layout(binding = ...)
bes Mar 6, 2024
8ee3c41
[naga] Document return types of image query operations.
jimblandy Mar 6, 2024
14dbf8c
[naga] Document the absence of "phi" expressions.
jimblandy Mar 6, 2024
f86898f
Don't create shader-clear program on GLES if it's not needed (#5348)
Dinnerbone Mar 8, 2024
2234fd6
Cache MAX_SAMPLES on gles backend (#5346)
Dinnerbone Mar 9, 2024
5e12273
docs: mention primitive restart in the description of strip_index_for…
cpsdqs Mar 9, 2024
b731495
Fix output args for render_to_texture example (#5338)
ratmice Mar 9, 2024
cf4f8bc
Minor rewording of ConfigureSurfaceError::TooLarge (#5371)
rukai Mar 10, 2024
f78e2f7
GL actually supports DEPTH32FLOAT_STENCIL8 (#5370)
Dinnerbone Mar 10, 2024
8e15707
gles: fix crash when holding multiple devices on wayland/surfaceless.…
ashdnazg Mar 10, 2024
53ac03c
fix typo (render pass -> compute pass) (#5380)
PWhiddy Mar 12, 2024
3107f5e
[mtl-out] Add "assert" to reserved words
teoxoy Mar 11, 2024
4e6f873
Add shader I64 and U64 support (#5154)
atlv24 Mar 12, 2024
e3b23a6
fix: add missing deferred resource dtor. in `Global::poll_all_devices`
ErichDonGubler Mar 11, 2024
fe28eda
refactor: `Global::poll_device`: use `&=` for `all_queue_empty`
ErichDonGubler Mar 12, 2024
c5ee3b6
refactor: `Global::device_poll`: hoist `submission_index` extr.
ErichDonGubler Mar 12, 2024
9499e8c
refactor: rename `Global::poll_device` to `poll_all_devices_of_api`
ErichDonGubler Mar 12, 2024
6040820
refactor: extract `Global::poll_single_device` helper
ErichDonGubler Mar 11, 2024
6a5418b
Fix 5385 by updating the documentation (#5386)
stefnotch Mar 14, 2024
e04a9f4
build(deps): bump the patch-updates group with 29 updates (#5376)
dependabot[bot] Mar 14, 2024
a63bec8
add cli arg to choose metal version
Mar 14, 2024
fe91958
Give short example of WGSL `push_constant` syntax. (#5393)
waywardmonkeys Mar 16, 2024
e68e628
Add patch release notes from 0.19.1/2/3 and remove redundant changelo…
Wumpf Mar 16, 2024
152a94b
suspect all the future suspects (#5413)
robtfm Mar 18, 2024
00e0e72
Invoke a DeviceLostClosure immediately if set on an invalid device. (…
bradwerth Mar 21, 2024
136ca15
[wgpu-hal] migrate `A` from a generic parameter to an associated type…
lylythechosenone Mar 23, 2024
ed95dfe
Pool tracker vecs (#5414)
robtfm Mar 23, 2024
6b996dd
Avoid recursive snatch lock acquisitions (#5426)
SludgePhD Mar 23, 2024
e102e59
Minor doc fixes - plural/singular wrong, wrong word for compute/rende…
Wumpf Mar 24, 2024
a9ccbc7
Add support for storage texture access modes ReadOnly and ReadWrite o…
JolifantoBambla Mar 26, 2024
b34219c
Implement the `device_set_device_lost_callback` method for `ContextWe…
suti Mar 26, 2024
c613fbb
[naga] Add some documentation for the uniformity analysis.
jimblandy Mar 25, 2024
0f4839c
Include the glsl global name in entrypoint arguments. (#5418)
LegNeato Mar 28, 2024
ec1484b
[hal/vulkan] Use `Option::insert` and avoid an `unwrap`.
jimblandy Mar 28, 2024
18f7215
[hal/vulkan] Document physical device info structures. (#5451)
jimblandy Mar 29, 2024
ed7d9de
Fix indexed drawing with RenderBundle (#5441)
Wumpf Mar 30, 2024
c2fb18a
Fix deno_webgpu & cts_runner (#5459)
crowlKats Apr 1, 2024
4fa2fbb
fix(dx12): don't depend on BG{,L} entry order
ErichDonGubler Mar 21, 2024
74f514c
fix(gles): don't depend on BG{,L} entry order
ErichDonGubler Mar 21, 2024
d12e89c
fix(metal): don't depend on BG{,L} entry order
ErichDonGubler Mar 21, 2024
b842265
test: don't depend on BG{,L} entry order in HAL
ErichDonGubler Mar 21, 2024
1144b06
style(readme): adjust whitespace to match previous entries
ErichDonGubler Mar 29, 2024
7954bb6
Rename `PhysicalDeviceCapabilities` to `PhysicalDeviceProperties`.
jimblandy Mar 31, 2024
e30e300
[hal/vulkan] Document more PhysicalDeviceFeatures-related things.
jimblandy Mar 30, 2024
dc7cbe6
docs: Fix incorrect git URL for naga-cli installation (#5457)
sudoBash418 Apr 2, 2024
1ead287
Fix unused acceleration structures causing invalid SPIR-V (#5463)
Vecvec Apr 2, 2024
1fd47b5
Expose all items in `naga::back`.
LegNeato Mar 15, 2024
bfe0b90
spv-out: implement OpArrayLength on array buffer bindings
kvark Mar 23, 2024
3a467ad
spv-out: Support arrayLength of a dynamically indexed bindings array
kvark Mar 23, 2024
5bab673
Update CHANGELOG for the spv-out arrayLength feature
kvark Mar 23, 2024
d828f27
chore: update deno (#5469)
crowlKats Apr 2, 2024
0c5bebc
fix: unlock guard for `release_gpu_resources` call in `Device::maintain`
ErichDonGubler Apr 2, 2024
ed843f8
Add more hal methods (#5452)
JMS55 Apr 2, 2024
5ae66ce
Merge branch 'trunk' into unorm_10_10_10_2
McMackety Apr 3, 2024
b0ba1fe
Fix whitespace in webgpu.rs
McMackety Apr 3, 2024
f9e1553
Rename Unorm10_10_10_2 w/ serde
McMackety Apr 3, 2024
b3ab330
Remove whitespace
McMackety Apr 3, 2024
825c722
remove some more whitespace
teoxoy Apr 3, 2024
0fef206
add back newline
teoxoy Apr 3, 2024
94a39f9
gate attribute behind serde feature
teoxoy Apr 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add test case to naga/spv-in for an unnamed glPerVertex struct
Imberflur authored and teoxoy committed Feb 15, 2024
commit ae2274332665f598c839e23fce54fbfe27926cd5
Binary file added naga/tests/in/spv/unnamed-gl-per-vertex.spv
Binary file not shown.
73 changes: 73 additions & 0 deletions naga/tests/in/spv/unnamed-gl-per-vertex.spvasm
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
;; Make sure that we don't have a validation error due to lacking capabilities
;; for bulltins such as ClipDistance when those builtin are not actually used.
;;
;; This specifically doesn't name the gl_PerVertex struct to make sure we don't
;; rely on checks for this name.
;;
;; See https://github.com/gfx-rs/wgpu/issues/4915
;;
;; Generated via `glslc -O` on this glsl code (taken from https://github.com/gfx-rs/wgpu/issues/4915):
;;
;; ```glsl
;; #version 450
;;
;; void main()
;; {
;; gl_Position = vec4(
;; (gl_VertexIndex == 0) ? -4.0 : 1.0,
;; (gl_VertexIndex == 2) ? 4.0 : -1.0,
;; 0.0,
;; 1.0
;; );
;; }
;; ```
;;
; SPIR-V
; Version: 1.0
; Generator: Google Shaderc over Glslang; 11
; Bound: 34
; Schema: 0
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %4 "main" %13 %gl_VertexIndex
OpMemberDecorate %_struct_11 0 BuiltIn Position
OpMemberDecorate %_struct_11 1 BuiltIn PointSize
OpMemberDecorate %_struct_11 2 BuiltIn ClipDistance
OpMemberDecorate %_struct_11 3 BuiltIn CullDistance
OpDecorate %_struct_11 Block
OpDecorate %gl_VertexIndex BuiltIn VertexIndex
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%_arr_float_uint_1 = OpTypeArray %float %uint_1
%_struct_11 = OpTypeStruct %v4float %float %_arr_float_uint_1 %_arr_float_uint_1
%_ptr_Output__struct_11 = OpTypePointer Output %_struct_11
%13 = OpVariable %_ptr_Output__struct_11 Output
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%_ptr_Input_int = OpTypePointer Input %int
%gl_VertexIndex = OpVariable %_ptr_Input_int Input
%bool = OpTypeBool
%float_n4 = OpConstant %float -4
%float_1 = OpConstant %float 1
%int_2 = OpConstant %int 2
%float_4 = OpConstant %float 4
%float_n1 = OpConstant %float -1
%float_0 = OpConstant %float 0
%_ptr_Output_v4float = OpTypePointer Output %v4float
%4 = OpFunction %void None %3
%5 = OpLabel
%18 = OpLoad %int %gl_VertexIndex
%20 = OpIEqual %bool %18 %int_0
%23 = OpSelect %float %20 %float_n4 %float_1
%26 = OpIEqual %bool %18 %int_2
%29 = OpSelect %float %26 %float_4 %float_n1
%31 = OpCompositeConstruct %v4float %23 %29 %float_0 %float_1
%33 = OpAccessChain %_ptr_Output_v4float %13 %int_0
OpStore %33 %31
OpReturn
OpFunctionEnd
34 changes: 34 additions & 0 deletions naga/tests/out/glsl/unnamed-gl-per-vertex.main.Vertex.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#version 310 es

precision highp float;
precision highp int;

struct type_4 {
vec4 member;
float member_1;
float member_2[1];
float member_3[1];
};
type_4 global = type_4(vec4(0.0, 0.0, 0.0, 1.0), 1.0, float[1](0.0), float[1](0.0));

int global_1 = 0;


void function() {
int _e9 = global_1;
global.member = vec4(((_e9 == 0) ? -4.0 : 1.0), ((_e9 == 2) ? 4.0 : -1.0), 0.0, 1.0);
return;
}

void main() {
uint param = uint(gl_VertexID);
global_1 = int(param);
function();
float _e6 = global.member.y;
global.member.y = -(_e6);
vec4 _e8 = global.member;
gl_Position = _e8;
gl_Position.yz = vec2(-gl_Position.y, gl_Position.z * 2.0 - gl_Position.w);
return;
}

36 changes: 36 additions & 0 deletions naga/tests/out/hlsl/unnamed-gl-per-vertex.hlsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
struct type_4 {
float4 member : SV_Position;
float member_1;
float member_2[1];
float member_3[1];
int _end_pad_0;
};

type_4 Constructtype_4(float4 arg0, float arg1, float arg2[1], float arg3[1]) {
type_4 ret = (type_4)0;
ret.member = arg0;
ret.member_1 = arg1;
ret.member_2 = arg2;
ret.member_3 = arg3;
return ret;
}

static type_4 global = Constructtype_4(float4(0.0, 0.0, 0.0, 1.0), 1.0, (float[1])0, (float[1])0);
static int global_1 = (int)0;

void function()
{
int _expr9 = global_1;
global.member = float4(((_expr9 == 0) ? -4.0 : 1.0), ((_expr9 == 2) ? 4.0 : -1.0), 0.0, 1.0);
return;
}

float4 main(uint param : SV_VertexID) : SV_Position
{
global_1 = int(param);
function();
float _expr6 = global.member.y;
global.member.y = -(_expr6);
float4 _expr8 = global.member;
return _expr8;
}
12 changes: 12 additions & 0 deletions naga/tests/out/hlsl/unnamed-gl-per-vertex.ron
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(
vertex:[
(
entry_point:"main",
target_profile:"vs_5_1",
),
],
fragment:[
],
compute:[
],
)
42 changes: 42 additions & 0 deletions naga/tests/out/msl/unnamed-gl-per-vertex.msl
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

using metal::uint;

struct type_3 {
float inner[1];
};
struct type_4 {
metal::float4 member;
float member_1;
type_3 member_2;
type_3 member_3;
};

void function(
thread type_4& global,
thread int& global_1
) {
int _e9 = global_1;
global.member = metal::float4((_e9 == 0) ? -4.0 : 1.0, (_e9 == 2) ? 4.0 : -1.0, 0.0, 1.0);
return;
}

struct main_Input {
};
struct main_Output {
metal::float4 member [[position]];
};
vertex main_Output main_(
uint param [[vertex_id]]
) {
type_4 global = type_4 {metal::float4(0.0, 0.0, 0.0, 1.0), 1.0, type_3 {}, type_3 {}};
int global_1 = {};
global_1 = static_cast<int>(param);
function(global, global_1);
float _e6 = global.member.y;
global.member.y = -(_e6);
metal::float4 _e8 = global.member;
return main_Output { _e8 };
}
25 changes: 25 additions & 0 deletions naga/tests/out/wgsl/unnamed-gl-per-vertex.wgsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
struct type_4 {
@builtin(position) member: vec4<f32>,
member_1: f32,
member_2: array<f32, 1>,
member_3: array<f32, 1>,
}

var<private> global: type_4 = type_4(vec4<f32>(0f, 0f, 0f, 1f), 1f, array<f32, 1>(), array<f32, 1>());
var<private> global_1: i32;

fn function() {
let _e9 = global_1;
global.member = vec4<f32>(select(1f, -4f, (_e9 == 0i)), select(-1f, 4f, (_e9 == 2i)), 0f, 1f);
return;
}

@vertex
fn main(@builtin(vertex_index) param: u32) -> @builtin(position) vec4<f32> {
global_1 = i32(param);
function();
let _e6 = global.member.y;
global.member.y = -(_e6);
let _e8 = global.member;
return _e8;
}
5 changes: 5 additions & 0 deletions naga/tests/snapshots.rs
Original file line number Diff line number Diff line change
@@ -886,6 +886,11 @@ fn convert_spv_all() {
true,
Targets::METAL | Targets::GLSL | Targets::HLSL | Targets::WGSL,
);
convert_spv(
"unnamed-gl-per-vertex",
true,
Targets::METAL | Targets::GLSL | Targets::HLSL | Targets::WGSL,
);
}

#[cfg(feature = "glsl-in")]