Skip to content

Conversation

@greg-lunarg
Copy link
Contributor

This allows the GPU-AV layer to differentiate between errors with
uniform buffers versus storage buffers and map these to the relevant
VUIDs.

@greg-lunarg
Copy link
Contributor Author

@dnovillo Can someone at Google please review?

@dnovillo dnovillo self-requested a review January 7, 2021 13:26
@dnovillo
Copy link

dnovillo commented Jan 7, 2021

@greg-lunarg I'll review today.

static const int kInstErrorBindlessUninit = 1;
static const int kInstErrorBuffAddrUnallocRef = 2;
static const int kInstErrorBindlessBuffOOB = 3;
// Deleted: static const int kInstErrorBindlessBuffOOB = 3;
Copy link

Choose a reason for hiding this comment

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

Suggest to just delete the line. It can be recovered from revision control if needed later.

Copy link
Contributor Author

@greg-lunarg greg-lunarg Jan 7, 2021

Choose a reason for hiding this comment

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

Thank you for the careful review! :)

Since this is a public header and I have deleted a previously used code, I did this so if there are problems between the instrumentation and the tool using this instrumentation around this change, it is a little more clear what the problem is ie. that the constant was purposely removed.

Rather than delete this line, I am going to add another comment line explaining things better. Let me know if you still have a problem with this.

Copy link

Choose a reason for hiding this comment

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

Oh, so the value 3 is now reserved in the sense that you need backwards compatibility?

Copy link

Choose a reason for hiding this comment

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

In that case, is there a way for us to at some point remove this line? Or do we have to have this value reserved for ever?

Copy link

Choose a reason for hiding this comment

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

Incidentally, I still don't see the changes you are referring to :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you see the new line at 174?

The comment will eventually go away. It is just there for the transitional period.

Copy link

Choose a reason for hiding this comment

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

I was expecting this rationale in the comment. Otherwise, looking at this code without the context of our conversation will tempt anyone to just get rid of the line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK. I have added the rationale. Let me know if this is good.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This change is breaking the validation layers which use the old value. Can we please leave the old value in place, add the new values, update downstream and then remove the old value?

@greg-lunarg
Copy link
Contributor Author

@dnovillo I think I have now addressed all your concerns. Please have another look!

static const int kInstErrorBindlessUninit = 1;
static const int kInstErrorBuffAddrUnallocRef = 2;
static const int kInstErrorBindlessBuffOOB = 3;
// Deleted: static const int kInstErrorBindlessBuffOOB = 3;
Copy link

Choose a reason for hiding this comment

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

I was expecting this rationale in the comment. Otherwise, looking at this code without the context of our conversation will tempt anyone to just get rid of the line.

;CHECK: OpStore %97 %48
;CHECK: %99 = OpIAdd %uint %59 %uint_10
;CHECK: %100 = OpAccessChain %_ptr_StorageBuffer_uint %54 %uint_1 %99
;CHECK: OpStore %100 %49
Copy link

Choose a reason for hiding this comment

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

I know this is pre-existing code. However, would it make sense to check a few key elements instead of having CHECKs sprinkled all over the place? May facilitate maintenance in the future. No need to do this now, just wondering if all these CHECKs actually provide value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I haven't done a lot to keep these minimal. The thinking was to use CHECK-NOT and CHECK as sort of a -/+ diff format so people, especially maintainers can see exactly the substitutions that are being done. The idea is to use this as a two-fer: documentation and tests at the same time.

This is not to say that some clean up can't be done or wouldn't be helpful. I can probably get rid of definitions of uint_* since these are pretty self explanatory. A number of type declarations could probably be removed as well since their names are so self-explanatory. There is also replication between tests, for instance, the auxiliary functions that are created to read and write the special validation buffers.

I will follow this PR up with a cleanup PR.

Choose a reason for hiding this comment

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

SG. Thanks!

This allows the GPU-AV layer to differentiate between errors with
uniform buffers versus storage buffers and map these to the relevant
VUIDs.
Copy link

@dnovillo dnovillo left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM.

@dnovillo dnovillo merged commit c32277c into KhronosGroup:master Jan 11, 2021
@dj2
Copy link
Collaborator

dj2 commented Jan 12, 2021

I'm going to revert this as it breaks the validation layers by removing kInstErrorBindlessBuffOOB.

@greg-lunarg
Copy link
Contributor Author

@dj2 FWIW, even if we undeleted the old error code, this version is only generating the new error codes, so the layer would still not work. It is not correct to build the layers with any version of glslang and spirv-tools not specified through known-good.

dneto0 pushed a commit to dneto0/SPIRV-Tools that referenced this pull request Sep 14, 2024
* Deprecate WebGPU SPIRV support

Roll third_party/spirv-tools/ 1bb80d2..ee39b5d (16 commits)

KhronosGroup/SPIRV-Tools@1bb80d2...ee39b5d

$ git log 1bb80d2..ee39b5d --date=short --no-merges --format='%ad %ae %s'
2021-01-15 46493288+sfricke-samsung spirv-val: Add Vulkan Addressing Model check (KhronosGroup#4107)
2021-01-14 rharrison Remove WebGPU support (KhronosGroup#4108)
2021-01-14 46493288+sfricke-samsung spirv-val: Vulkan atomic storage class (KhronosGroup#4079)
2021-01-13 jaebaek Avoid integrity check failures caused by propagating line instructions (KhronosGroup#4096)
2021-01-13 pierremoreau Linker usability improvements (KhronosGroup#4084)
2021-01-12 dj2 Revert "Generate differentiated error codes for buffer oob checking (KhronosGroup#4097)" (KhronosGroup#4100)
2021-01-11 greg Generate differentiated error codes for buffer oob checking (KhronosGroup#4097)
2021-01-07 dneto use std::string::empty() to test for emptiness (KhronosGroup#4098)
2021-01-07 46493288+sfricke-samsung spirv-val: Label standalone Vulkan VUID (KhronosGroup#4091)
2021-01-06 46493288+sfricke-samsung spirv-val: Add Vulkan decroation VUID (KhronosGroup#4090)
2021-01-06 stevenperron Fix binding number calculation in desc sroa (KhronosGroup#4095)
2021-01-06 stevenperron Build deps: dump ini from 1.3.5 to 1.3.7 in tools/sva (KhronosGroup#4092)
2021-01-06 46493288+sfricke-samsung spirv-val: Add Vulkan FP Mode VUID (KhronosGroup#4088)
2021-01-06 46493288+sfricke-samsung spirv-val: Fix Vulkan image sampled check (KhronosGroup#4085)
2021-01-06 46493288+sfricke-samsung spirv-val: Add Vulkan ForwardPointer VUID (KhronosGroup#4089)
2021-01-06 46493288+sfricke-samsung spirv-val: Add Vulkan ImageTexelPointer format check (KhronosGroup#4087)

Created with:
  roll-dep third_party/spirv-tools

Fixes KhronosGroup#1166

* Retain the public API enums

* Fix implicit fallthrough
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