mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 16:37:08 +00:00
Remove deprecated SetIndexBuffer (without format).
This also simplifies a bunch of code in backends that was used to handle getting the indexFormat from the pipeline "late". Bug: dawn:502 Change-Id: Ibae50c8df21323fd391515f6036552e9fb868d93 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/32023 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org> Reviewed-by: Stephen White <senorblanco@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
33f29ea9b2
commit
5fad85bbd9
@@ -126,20 +126,12 @@ namespace dawn_native {
|
||||
}
|
||||
}
|
||||
|
||||
if (aspects[VALIDATION_ASPECT_INDEX_BUFFER]) {
|
||||
if (mIndexBufferSet) {
|
||||
wgpu::IndexFormat pipelineIndexFormat =
|
||||
mLastRenderPipeline->GetVertexStateDescriptor()->indexFormat;
|
||||
if (mIndexFormat != wgpu::IndexFormat::Undefined) {
|
||||
if (!IsStripPrimitiveTopology(mLastRenderPipeline->GetPrimitiveTopology()) ||
|
||||
mIndexFormat == pipelineIndexFormat) {
|
||||
mAspects.set(VALIDATION_ASPECT_INDEX_BUFFER);
|
||||
}
|
||||
} else if (pipelineIndexFormat != wgpu::IndexFormat::Undefined) {
|
||||
// TODO(crbug.com/dawn/502): Deprecated path. Remove once setIndexFormat always
|
||||
// requires an index format.
|
||||
mAspects.set(VALIDATION_ASPECT_INDEX_BUFFER);
|
||||
}
|
||||
if (aspects[VALIDATION_ASPECT_INDEX_BUFFER] && mIndexBufferSet) {
|
||||
wgpu::IndexFormat pipelineIndexFormat =
|
||||
mLastRenderPipeline->GetVertexStateDescriptor()->indexFormat;
|
||||
if (!IsStripPrimitiveTopology(mLastRenderPipeline->GetPrimitiveTopology()) ||
|
||||
mIndexFormat == pipelineIndexFormat) {
|
||||
mAspects.set(VALIDATION_ASPECT_INDEX_BUFFER);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -154,17 +146,10 @@ namespace dawn_native {
|
||||
mLastRenderPipeline->GetVertexStateDescriptor()->indexFormat;
|
||||
if (!mIndexBufferSet) {
|
||||
return DAWN_VALIDATION_ERROR("Missing index buffer");
|
||||
} else if (mIndexFormat != wgpu::IndexFormat::Undefined &&
|
||||
IsStripPrimitiveTopology(mLastRenderPipeline->GetPrimitiveTopology()) &&
|
||||
mIndexFormat != pipelineIndexFormat) {
|
||||
} else if (IsStripPrimitiveTopology(mLastRenderPipeline->GetPrimitiveTopology()) &&
|
||||
mIndexFormat != pipelineIndexFormat) {
|
||||
return DAWN_VALIDATION_ERROR(
|
||||
"Pipeline strip index format does not match index buffer format");
|
||||
} else if (mIndexFormat == wgpu::IndexFormat::Undefined &&
|
||||
pipelineIndexFormat == wgpu::IndexFormat::Undefined) {
|
||||
// TODO(crbug.com/dawn/502): Deprecated path. Remove once setIndexFormat always
|
||||
// requires an index format.
|
||||
return DAWN_VALIDATION_ERROR(
|
||||
"Index format must be specified on the pipeline or in setIndexBuffer");
|
||||
}
|
||||
|
||||
// The chunk of code above should be similar to the one in |RecomputeLazyAspects|.
|
||||
|
||||
Reference in New Issue
Block a user