Move vertex index format from RenderPipelineDesc to InputStateDesc

Bug=dawn:107

Change-Id: Ia88232848995d5c4c3ac0f3137ffa518e85aa0a0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6140
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Yunchao He
2019-03-28 17:09:23 +00:00
committed by Commit Bot service account
parent 27a294c2e8
commit f856903154
18 changed files with 19 additions and 25 deletions

View File

@@ -95,13 +95,13 @@ void init() {
DawnInputStateDescriptor inputState;
inputState.nextInChain = nullptr;
inputState.indexFormat = DAWN_INDEX_FORMAT_UINT32;
inputState.numInputs = 0;
inputState.inputs = nullptr;
inputState.numAttributes = 0;
inputState.attributes = nullptr;
descriptor.inputState = &inputState;
descriptor.indexFormat = DAWN_INDEX_FORMAT_UINT32;
descriptor.primitiveTopology = DAWN_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
descriptor.depthStencilState = nullptr;

View File

@@ -238,6 +238,7 @@ namespace {
auto oFSModule = utils::CreateShaderModule(device, dawn::ShaderStage::Fragment, hasTexture ? oFSSourceTextured : oFSSourceUntextured);
utils::ComboRenderPipelineDescriptor descriptor(device);
descriptor.cInputState.indexFormat = dawn::IndexFormat::Uint16;
uint32_t numAttributes = 0;
uint32_t numInputs = 0;
std::bitset<3> slotsSet;
@@ -306,7 +307,6 @@ namespace {
descriptor.layout = pipelineLayout;
descriptor.cVertexStage.module = oVSModule;
descriptor.cFragmentStage.module = oFSModule;
descriptor.indexFormat = dawn::IndexFormat::Uint16;
descriptor.depthStencilState = &descriptor.cDepthStencilState;
descriptor.cDepthStencilState.format = dawn::TextureFormat::D32FloatS8Uint;
descriptor.cColorStates[0]->format = GetPreferredSwapChainTextureFormat();