← 输入框|github.com|刷新
Skip to content

replace u32/i32/u64 with normal int types or specific typedefs - #423

Merged
kainino0x merged 2 commits into
gpuweb:masterfrom
kainino0x:int-types
Aug 27, 2019
Merged

kainino0x merged 2 commits into
gpuweb:masterfrom
kainino0x:int-types

Conversation

@kainino0x

@kainino0x kainino0x commented Aug 22, 2019 •

Copy link
Copy Markdown
Contributor

We keep talking about doing this. Here it is.


Preview | Diff

@Kangz Kangz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kainino0x

Copy link
Copy Markdown
Contributor Author

2019-08-26 meeting resolution: bikeshed names (make sure the casing is right, remove 32/64), then merge

@kainino0x

Copy link
Copy Markdown
Contributor Author

Can't find a lot of prior work but UpperCamelCase seems to be the right thing for all typedefs.

Included the GPU prefix too to match everything else.

@kainino0x kainino0x changed the title replace u32/i32/u64 with normal int types or flags32/buffersize64 replace u32/i32/u64 with normal int types or specific typedefs Aug 26, 2019

@Kangz Kangz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ship it!

@kainino0x
kainino0x merged commit 84f16ce into gpuweb:master Aug 27, 2019
@kainino0x
kainino0x deleted the int-types branch August 27, 2019 20:20
JusSn pushed a commit to JusSn/gpuweb that referenced this pull request Sep 19, 2019
JusSn added a commit that referenced this pull request Sep 19, 2019
* Add a component type for GPUBGLBinding compatiblity (#384)

In shaders there are several texture types for each dimensionality
depending on their component type. It can be either float, uint or
sint, with maybe in the future depth/stencil if WebGPU allows reading
such textures.

The component type of a GPUTextureView's format must match the
component type of its binding in the shader module. This is for
several reasons:

 - Vulkan requires the following: "The Sampled Type of an
OpTypeImage declaration must match the numeric format of the
corresponding resource in type and signedness, as shown in the
SPIR-V Sampled Type column of the Interpretation of Numeric Format
table, or the values obtained by reading or sampling from this image
are undefined."

 - It is also required in OpenGL for the texture units to be complete,
a uint or sint texture unit used with a non-nearest sampler is
incomplete and returns black texels.

Similar constraints must exist in other APIs.

To encode this compatibility constraint, a new member is added to
GPUBindGroupLayoutBinding that is a new enum GPUTextureComponentType
that give the component type of the texture.

* Make GPUBGLBinding.textureDimension default to 2d.

This is the most common case and avoids having an optional dictionary
member with no default value (but that still requires a value for
texture bindings).

* Add a component type for GPUBGLBinding compatiblity (#384)

In shaders there are several texture types for each dimensionality
depending on their component type. It can be either float, uint or
sint, with maybe in the future depth/stencil if WebGPU allows reading
such textures.

The component type of a GPUTextureView's format must match the
component type of its binding in the shader module. This is for
several reasons:

 - Vulkan requires the following: "The Sampled Type of an
OpTypeImage declaration must match the numeric format of the
corresponding resource in type and signedness, as shown in the
SPIR-V Sampled Type column of the Interpretation of Numeric Format
table, or the values obtained by reading or sampling from this image
are undefined."

 - It is also required in OpenGL for the texture units to be complete,
a uint or sint texture unit used with a non-nearest sampler is
incomplete and returns black texels.

Similar constraints must exist in other APIs.

To encode this compatibility constraint, a new member is added to
GPUBindGroupLayoutBinding that is a new enum GPUTextureComponentType
that give the component type of the texture.

* Make GPUBGLBinding.textureDimension default to 2d.

This is the most common case and avoids having an optional dictionary
member with no default value (but that still requires a value for
texture bindings).

* unifinished createBindGroupLayout algorithm

* draft of BindGroupLayout details

* draft of BindGroupLayout details

* polish before PR

* fix typo

* replace u32/i32/u64 with normal int types or specific typedefs (#423)

* Do not require vertexInput in GPURenderPipelineDescriptor (#378)

* Add a default for GPURenderPassColorAttachmentDescriptor.storeOp (#376)

Supersedes #268.

* Initial spec for GPUDevice.createBuffer (#419)

* Start writing spec for device/adapter, introduce internal objects (#422)

* Move validation rules out of algorithm body and better describe GPUBindGroupLayout internal slots

* Include limits for dynamic offset buffers

* Rename 'dynamic' boolean to 'hasDynamicOffsets'

* Fix indentation for ci bot

* More indentation errors

* Fix var typos

* Fix method definition

* Fix enum references

* Missing </dfn> tag

* Missing </dfn> tag

* Remove bad [= =]

* Fix old constant name

* Half-formed new validation rule structure for createBindGroupLayout

* An interface -> the interface

* Remove old 'layout binding' reference

* fix device lost validation reference

* Fix 'dynamic' typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants