Commit e16a4519 by Jamie Madill Committed by Commit Bot

D3D11 FL9_3: Fix bug in R32F vertex format emulation.

We would allow direct storage when this format is emulated. Noticed this when making a test which used a single float vertex format. BUG=angleproject:1635 Change-Id: Ia2164b0f311b27f24b6aa7760eb9f9a3834c6044 Reviewed-on: https://chromium-review.googlesource.com/451578Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent e08a1d36
...@@ -80,13 +80,19 @@ bool DirectStoragePossible(const gl::VertexAttribute &attrib, const gl::VertexBi ...@@ -80,13 +80,19 @@ bool DirectStoragePossible(const gl::VertexAttribute &attrib, const gl::VertexBi
// 4-byte boundary, whichever is smaller. (Undocumented, and experimentally confirmed) // 4-byte boundary, whichever is smaller. (Undocumented, and experimentally confirmed)
size_t alignment = 4; size_t alignment = 4;
if (attrib.type != GL_FLOAT) // TODO(jmadill): add VertexFormatCaps
{ BufferFactoryD3D *factory = bufferD3D->getFactory();
gl::VertexFormatType vertexFormatType = gl::GetVertexFormatType(attrib);
gl::VertexFormatType vertexFormatType = gl::GetVertexFormatType(attrib);
// TODO(jmadill): add VertexFormatCaps // CPU-converted vertex data must be converted (naturally).
BufferFactoryD3D *factory = bufferD3D->getFactory(); if ((factory->getVertexConversionType(vertexFormatType) & VERTEX_CONVERT_CPU) != 0)
{
return false;
}
if (attrib.type != GL_FLOAT)
{
auto errorOrElementSize = factory->getVertexSpaceRequired(attrib, binding, 1, 0); auto errorOrElementSize = factory->getVertexSpaceRequired(attrib, binding, 1, 0);
if (errorOrElementSize.isError()) if (errorOrElementSize.isError())
{ {
...@@ -95,12 +101,6 @@ bool DirectStoragePossible(const gl::VertexAttribute &attrib, const gl::VertexBi ...@@ -95,12 +101,6 @@ bool DirectStoragePossible(const gl::VertexAttribute &attrib, const gl::VertexBi
} }
alignment = std::min<size_t>(errorOrElementSize.getResult(), 4); alignment = std::min<size_t>(errorOrElementSize.getResult(), 4);
// CPU-converted vertex data must be converted (naturally).
if ((factory->getVertexConversionType(vertexFormatType) & VERTEX_CONVERT_CPU) != 0)
{
return false;
}
} }
GLintptr offset = ComputeVertexAttributeOffset(attrib, binding); GLintptr offset = ComputeVertexAttributeOffset(attrib, binding);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment