Remove stray push constant code.

There was still some logic associated with push constants in Dawn. This
removes it to remove some code and reclaim one buffer in Metal. Related
code was found via `git grep "push constant"`.

BUG=

Change-Id: I17de9d47872483875b6fa292f8259ef1fc4ecaf3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11904
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2019-10-08 07:37:02 +00:00 committed by Commit Bot service account
parent bd481fc199
commit a83e0cdbcc
4 changed files with 1 additions and 37 deletions

View File

@ -24,8 +24,7 @@ namespace dawn_native { namespace metal {
: PipelineLayoutBase(device, descriptor) {
// Each stage has its own numbering namespace in CompilerMSL.
for (auto stage : IterateStages(kAllStages)) {
// Buffer number 0 is reserved for push constants
uint32_t bufferIndex = 1;
uint32_t bufferIndex = 0;
uint32_t samplerIndex = 0;
uint32_t textureIndex = 0;

View File

@ -365,8 +365,6 @@ namespace dawn_native { namespace metal {
descriptorMTL.sampleCount = GetSampleCount();
// TODO(kainino@chromium.org): push constants, textures, samplers
{
NSError* error = nil;
mMtlRenderPipelineState = [mtlDevice newRenderPipelineStateWithDescriptor:descriptorMTL

View File

@ -73,17 +73,6 @@ namespace dawn_native { namespace metal {
// To make the MSL indices match the indices chosen in the PipelineLayout, we build
// a table of MSLResourceBinding to give to SPIRV-Cross.
// Reserve index 0 for buffers for the push constants buffer.
for (auto stage : IterateStages(kAllStages)) {
spirv_cross::MSLResourceBinding binding;
binding.stage = SpirvExecutionModelForStage(stage);
binding.desc_set = spirv_cross::kPushConstDescSet;
binding.binding = spirv_cross::kPushConstBinding;
binding.msl_buffer = 0;
compiler.add_msl_resource_binding(binding);
}
// Create one resource binding entry per stage per binding.
for (uint32_t group : IterateBitSet(layout->GetBindGroupLayoutsMask())) {
const auto& bgInfo = layout->GetBindGroupLayout(group)->GetBindingInfo();

View File

@ -69,28 +69,6 @@ namespace dawn_native { namespace opengl {
#endif
compiler.set_common_options(options);
// Rename the push constant block to be prefixed with the shader stage type so that uniform
// names don't match between the FS and the VS.
const auto& resources = compiler.get_shader_resources();
if (resources.push_constant_buffers.size() > 0) {
const char* prefix = nullptr;
switch (compiler.get_execution_model()) {
case spv::ExecutionModelVertex:
prefix = "vs_";
break;
case spv::ExecutionModelFragment:
prefix = "fs_";
break;
case spv::ExecutionModelGLCompute:
prefix = "cs_";
break;
default:
UNREACHABLE();
}
auto interfaceBlock = resources.push_constant_buffers[0];
compiler.set_name(interfaceBlock.id, prefix + interfaceBlock.name);
}
ExtractSpirvInfo(compiler);
const auto& bindingInfo = GetBindingInfo();