Skip to content

Set default global varaibles to const - #117

Merged
Young Kim (yskim1501) merged 3 commits into
microsoft:dxil-v1.0from
yskim1501:default-constants
Mar 15, 2017
Merged

Young Kim (yskim1501) merged 3 commits into
microsoft:dxil-v1.0from
yskim1501:default-constants

Conversation

@yskim1501

@yskim1501 Young Kim (yskim1501) commented Mar 2, 2017 •

Copy link
Copy Markdown
Contributor

According to HLSL documentation, the global variables are set to default const unless it is specified with 'static' specifier.
The front end therefore should assign 'const' specifiers for all global variables that will be in global constant buffers.

We also should show warnings for 'extern const' variables that have initializers

@msftclas

Youngkim93,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

@yskim1501 Young Kim (yskim1501) changed the title Implement default global varaibles. Set default global varaibles to const Mar 7, 2017

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.

Change these to be one based

Young Kim (yskim1501) and others added 2 commits March 14, 2017 19:06
  According to HLSL documentation, the global variables are set to default unless it is specified with 'static' specifier.
The front end therefore should assign 'const' specifiers for all global, cbuffer/tbuffer, or ConstantBuffer/TextureBuffer members that are
   - not static and not typedef
   - numeric (scalar, array, vector, matrix)

2. Show warnings for 'extern const' variables that have initializers
@yskim1501
Young Kim (yskim1501) merged commit dc00d74 into microsoft:dxil-v1.0 Mar 15, 2017
@yskim1501
Young Kim (yskim1501) deleted the default-constants branch April 18, 2017 01:22
Gregory Roth (pow2clk) pushed a commit to pow2clk/DirectXShaderCompiler that referenced this pull request Jan 2, 2024
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