Skip to content

Struct for normal buf - #43

Merged
Xiang Li (python3kgae) merged 4 commits into
microsoft:dxil-v1.0from
python3kgae:struct_for_normal_buf
Jan 27, 2017
Merged

Xiang Li (python3kgae) merged 4 commits into
microsoft:dxil-v1.0from
python3kgae:struct_for_normal_buf

Conversation

@python3kgae

Copy link
Copy Markdown
Contributor

No description provided.

@msftclas

Hi Xiang Li (@python3kgae), I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!


It looks like you're a Microsoft contributor (Xiang Li). If you're full-time, we DON'T require a Contribution License Agreement. If you are a vendor, please DO sign the electronic Contribution License Agreement. It will take 2 minutes and there's no faxing! https://cla.microsoft.com.

TTYL, MSBOT;

@dmpots

Copy link
Copy Markdown
Contributor

This pull request has two commits, but should probably only have the one for the buffer fix.

@dmpots David Peixotto (dmpots) 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.

Need some more tests to exercise more of the code:

  1. Embedded struct/array to test CollectScalarTypes function.
  2. Mixed types to test the new diagnostic error.


groupshared Foo sharedData;

#ifdef DX12

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.

We should either compile with the root signature unconditionally or just delete it.

@dmpots David Peixotto (dmpots) 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.

New tests are useful. Just need to make sure we call them all :) Otherwise I have only some minor suggestions for improvement.

I think the tests themselves should be cut down to the bare minimum. It makes it easier to understand what is being tested.

For example, no need for a compute shader with InterlockedAdd. A simple pixel shader that just reads from the buffer and returns the value would be sufficient.

}

TEST_F(ValidationTest, EmptyStructInBuffer) {
TestCheck(L"..\\CodeGenHLSL\\staticGlobals.hlsl");

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.

This looks like a copy-paste error. Should probably point to the EmptyStructInBuffer test.

}

TEST_F(ValidationTest, BigStructInBuffer) {
TestCheck(L"..\\CodeGenHLSL\\staticGlobals.hlsl");

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.

Looks like a copy-paste error again.


groupshared Foo sharedData;

#ifdef DX12

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.

Kill or use the root signature.

Buffer<Foo> inputs : register(t1);

struct Empty {};
Buffer<Empty> eb;

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.

Let's just keep the big struct in this test.


// CHECK: object's templated type must have at least one element

struct Foo {

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.

Let's just keep the empty struct in this test.

@python3kgae
Xiang Li (python3kgae) merged commit 86b7e6e into microsoft:dxil-v1.0 Jan 27, 2017
@python3kgae
Xiang Li (python3kgae) deleted the struct_for_normal_buf branch January 27, 2017 22:42
Gregory Roth (pow2clk) pushed a commit to pow2clk/DirectXShaderCompiler that referenced this pull request Jan 2, 2024
* Add type punning rules to vk::BufferPointer

Fixes microsoft#43

* Clarify that type punning with buffer pointers leads to undefined
behavior.
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