Skip to content

Turn stores to initializer for static variable where possible. - #2122

Merged
Adam Yang (adam-yang) merged 7 commits into
microsoft:masterfrom
adam-yang:const_array_init
Apr 22, 2019
Merged

Adam Yang (adam-yang) merged 7 commits into
microsoft:masterfrom
adam-yang:const_array_init

Conversation

@adam-yang

Copy link
Copy Markdown
Contributor

No description provided.

@AppVeyorBot

Copy link
Copy Markdown

@tristanlabelle

Tristan Labelle (tristanlabelle) commented Apr 12, 2019 •

Copy link
Copy Markdown
Contributor

Additional tests we should have:

  • With a scalar value (since the code claims to handle it)
  • With the array initialization happening inside the shader entry point (maybe even with an unrolled loop) rather than using the initialization syntax.
  • With a load before store
  • With redundant stores

@tristanlabelle Tristan Labelle (tristanlabelle) 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.

I think scalar global support is broken and there are a few more tests I'd like to see.

@AppVeyorBot

Copy link
Copy Markdown

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.

Still could use a few more tests but code looks good.

@adam-yang

Copy link
Copy Markdown
Contributor Author

I'm adding the tests, but there's more code changes to come... Just had some more ideas.

CodeGenTestCheck(L"function_call_initializer.hlsl");
CodeGenTestCheck(L"function_call_initializer_uint.hlsl");
CodeGenTestCheck(L"function_call_initializer_vec.hlsl");
CodeGenTestCheckBatchDir(L"initializer");

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.

I meant that I moved tests around such that all batch tests are under the "batch" directory so that we don't have to add one function here for each new batch directory anymore. Note that you can still test your single subdirectory by using hcttest file-check <directory-path>. The only reason I haven't moved "debug" under "batch" yet is because I have pending code reviews that modify it so it would conflict.

@tristanlabelle

Copy link
Copy Markdown
Contributor

Good catches!

@AppVeyorBot

Copy link
Copy Markdown

@tristanlabelle

Copy link
Copy Markdown
Contributor

Looking good!

@AppVeyorBot

Copy link
Copy Markdown

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