mirror of
https://github.com/TomHarte/CLK.git
synced 2026-04-21 02:17:08 +00:00
Align Scan to be a multiple of four bytes
Some GPUs (e.g. r600) require the stride of vertex attributes to be a multiple of four bytes, add two bytes of padding to the Scan struct to meet this alignment requirement and reduce driver CPU overhead.
This commit is contained in:
@@ -84,6 +84,11 @@ void ScanTarget::enable_vertex_attributes(ShaderType type, Shader &target) {
|
||||
Scan test_scan;
|
||||
Line test_line;
|
||||
|
||||
// Some GPUs require alignment and will need to copy vertex data to a
|
||||
// shadow buffer otherwise
|
||||
static_assert(sizeof(Scan) % 4 == 0);
|
||||
static_assert(sizeof(Line) % 4 == 0);
|
||||
|
||||
switch(type) {
|
||||
case ShaderType::Composition:
|
||||
for(int c = 0; c < 2; ++c) {
|
||||
|
||||
Reference in New Issue
Block a user