mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-25 07:46:01 +00:00
fix(venus): DXVK runs on Mali GPUs without dual-source blending (#2293)
* fix(venus): DXVK runs on Mali GPUs without dual-source blending DXVK requires dualSrcBlend for D3D11 and skips any GPU without it, so on Mali through Venus no adapter was found. The Mali compatibility layer now reports the feature and maxFragmentDualSrcAttachments 1, keeps it out of the driver's device, turns fragment outputs decorated Index 1 into Private variables (shader modules and inline stage code), and maps SRC1 blend factors to source alpha in pipelines and vkCmdSetColorBlendEquationEXT. Only active when the driver lacks the feature. Adds a mock loader and driver test for the layer, and fetches the layer's pinned headers for it in CI. * build(venus): pin the Mali component with dual-source blending
This commit is contained in:
1 parent
eb190f2dd7
commit
99bf382ae8
9 files changed
+757
-31
No files matched your search
@@ -212,6 +212,8 @@ uint32_t physical_device_gaps(struct instance *inst, VkPhysicalDevice physical_d
|
||||
gaps |= GAP_ROBUSTNESS2;
|
||||
if (!features.features.multiDrawIndirect)
|
||||
gaps |= GAP_MULTI_DRAW;
|
||||
if (!features.features.dualSrcBlend)
|
||||
gaps |= GAP_DUAL_SRC_BLEND;
|
||||
if (!has_extension(inst, physical_device, VK_EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME))
|
||||
gaps |= GAP_DEPTH_CLIP;
|
||||
/* No robustness2 at all: the extension is offered with robustBufferAccess2 (as robustBufferAccess)
|
||||
@@ -284,6 +286,8 @@ static void report_features(VkPhysicalDeviceFeatures *features, uint32_t gaps)
|
||||
features->textureCompressionBC = VK_TRUE;
|
||||
if (gaps & GAP_MULTI_DRAW)
|
||||
features->multiDrawIndirect = VK_TRUE;
|
||||
if (gaps & GAP_DUAL_SRC_BLEND)
|
||||
features->dualSrcBlend = VK_TRUE;
|
||||
}
|
||||
|
||||
/* Which made-up features the application asked for, and off with them before the driver sees them. */
|
||||
@@ -314,6 +318,10 @@ static uint32_t take_features(VkPhysicalDeviceFeatures *features, uint32_t gaps)
|
||||
requested |= GAP_MULTI_DRAW;
|
||||
features->multiDrawIndirect = VK_FALSE;
|
||||
}
|
||||
if ((gaps & GAP_DUAL_SRC_BLEND) && features->dualSrcBlend) {
|
||||
requested |= GAP_DUAL_SRC_BLEND;
|
||||
features->dualSrcBlend = VK_FALSE;
|
||||
}
|
||||
return requested;
|
||||
}
|
||||
|
||||
@@ -323,6 +331,8 @@ static void report_limits(VkPhysicalDeviceLimits *limits, uint32_t gaps)
|
||||
limits->maxViewports = 16;
|
||||
if ((gaps & GAP_MULTI_DRAW) && limits->maxDrawIndirectCount < (1u << 30))
|
||||
limits->maxDrawIndirectCount = 1u << 30;
|
||||
if ((gaps & GAP_DUAL_SRC_BLEND) && !limits->maxFragmentDualSrcAttachments)
|
||||
limits->maxFragmentDualSrcAttachments = 1;
|
||||
if (gaps & GAPS_SHADER) {
|
||||
limits->maxClipDistances = 8;
|
||||
limits->maxCullDistances = 8;
|
||||
@@ -616,7 +626,7 @@ static VKAPI_ATTR VkResult VKAPI_CALL CreateDevice(VkPhysicalDevice physical_dev
|
||||
pthread_mutex_unlock(&global_lock);
|
||||
|
||||
if (requested) {
|
||||
layer_log("emulating%s%s%s%s%s%s%s%s%s for %s", (requested & GAP_FILL_MODE) ? " fillModeNonSolid" : "",
|
||||
layer_log("emulating%s%s%s%s%s%s%s%s%s%s for %s", (requested & GAP_FILL_MODE) ? " fillModeNonSolid" : "",
|
||||
(requested & GAP_MULTI_VIEWPORT) ? " multiViewport" : "",
|
||||
(requested & GAP_CLIP_DISTANCE) ? " shaderClipDistance" : "",
|
||||
(requested & GAP_CULL_DISTANCE) ? " shaderCullDistance" : "",
|
||||
@@ -624,7 +634,8 @@ static VKAPI_ATTR VkResult VKAPI_CALL CreateDevice(VkPhysicalDevice physical_dev
|
||||
(requested & GAP_BC) ? " textureCompressionBC" : "",
|
||||
(requested & GAP_MULTI_DRAW) ? " multiDrawIndirect" : "",
|
||||
(requested & GAP_DEPTH_CLIP) ? " depthClipEnable" : "",
|
||||
(requested & GAP_NULL_DESCRIPTOR) ? " nullDescriptor" : "", properties.deviceName);
|
||||
(requested & GAP_NULL_DESCRIPTOR) ? " nullDescriptor" : "",
|
||||
(requested & GAP_DUAL_SRC_BLEND) ? " dualSrcBlend" : "", properties.deviceName);
|
||||
}
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
@@ -667,8 +678,8 @@ struct hook {
|
||||
#define HOOK_ALIAS(name, alias, gaps) {"vk" #alias, (PFN_vkVoidFunction)name, gaps}
|
||||
|
||||
static const struct hook device_hooks[] = {
|
||||
HOOK(CreateShaderModule, GAPS_SHADER),
|
||||
HOOK(DestroyShaderModule, GAPS_SHADER),
|
||||
HOOK(CreateShaderModule, GAPS_SHADER | GAP_DUAL_SRC_BLEND),
|
||||
HOOK(DestroyShaderModule, GAPS_SHADER | GAP_DUAL_SRC_BLEND),
|
||||
HOOK(CreateGraphicsPipelines, GAPS_PIPELINE),
|
||||
HOOK(CmdSetViewport, GAP_MULTI_VIEWPORT),
|
||||
HOOK(CmdSetScissor, GAP_MULTI_VIEWPORT),
|
||||
@@ -676,6 +687,7 @@ static const struct hook device_hooks[] = {
|
||||
HOOK_ALIAS(CmdSetViewportWithCount, CmdSetViewportWithCountEXT, GAP_MULTI_VIEWPORT),
|
||||
HOOK(CmdSetScissorWithCount, GAP_MULTI_VIEWPORT),
|
||||
HOOK_ALIAS(CmdSetScissorWithCount, CmdSetScissorWithCountEXT, GAP_MULTI_VIEWPORT),
|
||||
HOOK(CmdSetColorBlendEquationEXT, GAP_DUAL_SRC_BLEND),
|
||||
HOOK(CreateImage, GAP_BC),
|
||||
HOOK(DestroyImage, GAP_BC),
|
||||
HOOK(CreateImageView, GAP_BC),
|
||||
|
||||
@@ -29,10 +29,11 @@ enum gap {
|
||||
GAP_MULTI_DRAW = 1u << 6, /* multiDrawIndirect: indirect draws looped one by one */
|
||||
GAP_DEPTH_CLIP = 1u << 7, /* VK_EXT_depth_clip_enable: depthClipEnable off becomes depth clamp */
|
||||
GAP_NULL_DESCRIPTOR = 1u << 8, /* VK_EXT_robustness2 missing entirely: nullDescriptor stand-ins */
|
||||
GAP_DUAL_SRC_BLEND = 1u << 9,
|
||||
};
|
||||
|
||||
#define GAPS_SHADER (GAP_CLIP_DISTANCE | GAP_CULL_DISTANCE)
|
||||
#define GAPS_PIPELINE (GAP_FILL_MODE | GAP_MULTI_VIEWPORT | GAPS_SHADER | GAP_DEPTH_CLIP)
|
||||
#define GAPS_PIPELINE (GAP_FILL_MODE | GAP_MULTI_VIEWPORT | GAPS_SHADER | GAP_DEPTH_CLIP | GAP_DUAL_SRC_BLEND)
|
||||
|
||||
void layer_log(const char *format, ...) __attribute__((format(printf, 1, 2)));
|
||||
|
||||
@@ -135,7 +136,8 @@ struct instance {
|
||||
X(UpdateDescriptorSetWithTemplate) \
|
||||
X(CmdPushDescriptorSetWithTemplate) \
|
||||
X(CmdBindVertexBuffers) \
|
||||
X(CmdBindVertexBuffers2)
|
||||
X(CmdBindVertexBuffers2) \
|
||||
X(CmdSetColorBlendEquationEXT)
|
||||
|
||||
struct staging_block;
|
||||
|
||||
@@ -183,6 +185,8 @@ struct spirv_code {
|
||||
bool spirv_uses_distances(const uint32_t *words, size_t count);
|
||||
/* The module with clip and cull distances taken out; false when it cannot be rewritten. */
|
||||
bool spirv_strip_distances(const uint32_t *words, size_t count, struct spirv_code *out);
|
||||
bool spirv_uses_dual_source(const uint32_t *words, size_t count);
|
||||
bool spirv_strip_dual_source(const uint32_t *words, size_t count, struct spirv_code *out);
|
||||
|
||||
enum clip_role { CLIP_STRIP, CLIP_PRODUCER, CLIP_CONSUMER };
|
||||
|
||||
@@ -216,6 +220,8 @@ VKAPI_ATTR void VKAPI_CALL CmdSetScissor(VkCommandBuffer cmd, uint32_t first, ui
|
||||
VKAPI_ATTR void VKAPI_CALL CmdSetViewportWithCount(VkCommandBuffer cmd, uint32_t count,
|
||||
const VkViewport *viewports);
|
||||
VKAPI_ATTR void VKAPI_CALL CmdSetScissorWithCount(VkCommandBuffer cmd, uint32_t count, const VkRect2D *scissors);
|
||||
VKAPI_ATTR void VKAPI_CALL CmdSetColorBlendEquationEXT(VkCommandBuffer cmd, uint32_t first, uint32_t count,
|
||||
const VkColorBlendEquationEXT *equations);
|
||||
|
||||
/* bc.c */
|
||||
VkFormat bc_substitute(VkFormat format);
|
||||
|
||||
+115
-13
@@ -12,27 +12,46 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateShaderModule(VkDevice device, const VkShade
|
||||
const VkAllocationCallbacks *allocator, VkShaderModule *module)
|
||||
{
|
||||
struct device *dev = device_from_handle(device);
|
||||
VkShaderModuleCreateInfo copy = *info;
|
||||
size_t count = info->codeSize / sizeof(uint32_t);
|
||||
if (!spirv_uses_distances(info->pCode, count))
|
||||
return dev->CreateShaderModule(device, info, allocator, module);
|
||||
struct spirv_code single = {0};
|
||||
if ((dev->emulated & GAP_DUAL_SRC_BLEND) && spirv_uses_dual_source(info->pCode, count)) {
|
||||
if (spirv_strip_dual_source(info->pCode, count, &single)) {
|
||||
copy.pCode = single.words;
|
||||
copy.codeSize = single.count * sizeof(uint32_t);
|
||||
count = single.count;
|
||||
} else {
|
||||
layer_log("could not take the second blend source out of a shader module");
|
||||
}
|
||||
}
|
||||
if (!(dev->emulated & GAPS_SHADER) || !spirv_uses_distances(copy.pCode, count)) {
|
||||
VkResult result = dev->CreateShaderModule(device, ©, allocator, module);
|
||||
free(single.words);
|
||||
return result;
|
||||
}
|
||||
|
||||
struct spirv_code stripped;
|
||||
if (!spirv_strip_distances(info->pCode, count, &stripped)) {
|
||||
if (!spirv_strip_distances(copy.pCode, count, &stripped)) {
|
||||
layer_log("could not take the clip and cull distances out of a shader module");
|
||||
return dev->CreateShaderModule(device, info, allocator, module);
|
||||
VkResult result = dev->CreateShaderModule(device, ©, allocator, module);
|
||||
free(single.words);
|
||||
return result;
|
||||
}
|
||||
VkShaderModuleCreateInfo copy = *info;
|
||||
struct spirv_code *original = malloc(sizeof(*original));
|
||||
original->count = count;
|
||||
original->words = malloc(copy.codeSize);
|
||||
memcpy(original->words, copy.pCode, copy.codeSize);
|
||||
free(single.words);
|
||||
copy.pCode = stripped.words;
|
||||
copy.codeSize = stripped.count * sizeof(uint32_t);
|
||||
VkResult result = dev->CreateShaderModule(device, ©, allocator, module);
|
||||
free(stripped.words);
|
||||
if (result != VK_SUCCESS)
|
||||
if (result != VK_SUCCESS) {
|
||||
free(original->words);
|
||||
free(original);
|
||||
return result;
|
||||
}
|
||||
|
||||
struct spirv_code *original = malloc(sizeof(*original));
|
||||
original->count = count;
|
||||
original->words = malloc(info->codeSize);
|
||||
memcpy(original->words, info->pCode, info->codeSize);
|
||||
pthread_mutex_lock(&dev->lock);
|
||||
map_put(&dev->shader_modules, HANDLE(*module), original);
|
||||
pthread_mutex_unlock(&dev->lock);
|
||||
@@ -87,12 +106,15 @@ static void find_stage_code(struct device *dev, const VkPipelineShaderStageCreat
|
||||
|
||||
struct pipeline_rewrite {
|
||||
VkPipelineRasterizationStateCreateInfo rasterization;
|
||||
VkPipelineColorBlendStateCreateInfo blend;
|
||||
VkPipelineColorBlendAttachmentState *attachments;
|
||||
/* VK_EXT_depth_clip_enable's state, taken out of the application's chain for the call. */
|
||||
VkBaseOutStructure *clip_prev, *clip_node;
|
||||
VkPipelineViewportStateCreateInfo viewport;
|
||||
VkPipelineShaderStageCreateInfo stages[MAX_STAGES];
|
||||
VkShaderModuleCreateInfo modules[MAX_STAGES];
|
||||
struct spirv_code code[MAX_STAGES];
|
||||
struct spirv_code single[MAX_STAGES];
|
||||
VkShaderModule temporary[MAX_STAGES];
|
||||
/* Rewritten where they are, when they are not first in their stage's chain. */
|
||||
VkShaderModuleCreateInfo *in_place[MAX_STAGES];
|
||||
@@ -154,8 +176,17 @@ static void rewrite_shaders(struct device *dev, VkGraphicsPipelineCreateInfo *in
|
||||
bool any = false;
|
||||
for (uint32_t i = 0; i < n; i++) {
|
||||
find_stage_code(dev, &info->pStages[i], &code[i]);
|
||||
uses[i] = code[i].words && spirv_uses_distances(code[i].words, code[i].count);
|
||||
any |= uses[i];
|
||||
if ((dev->emulated & GAP_DUAL_SRC_BLEND) && code[i].inline_info &&
|
||||
spirv_uses_dual_source(code[i].words, code[i].count)) {
|
||||
if (spirv_strip_dual_source(code[i].words, code[i].count, &rw->single[i])) {
|
||||
code[i].words = rw->single[i].words;
|
||||
code[i].count = rw->single[i].count;
|
||||
} else {
|
||||
layer_log("could not take the second blend source out of a pipeline's shader");
|
||||
}
|
||||
}
|
||||
uses[i] = (dev->emulated & GAPS_SHADER) && code[i].words && spirv_uses_distances(code[i].words, code[i].count);
|
||||
any |= uses[i] || rw->single[i].words;
|
||||
}
|
||||
if (!any)
|
||||
return;
|
||||
@@ -196,11 +227,63 @@ static void rewrite_shaders(struct device *dev, VkGraphicsPipelineCreateInfo *in
|
||||
!spirv_strip_distances(code[i].words, code[i].count, &rw->code[i])) {
|
||||
layer_log("could not take the clip and cull distances out of a pipeline's shader");
|
||||
}
|
||||
if (!rw->code[i].words && rw->single[i].words) {
|
||||
rw->code[i] = rw->single[i];
|
||||
rw->single[i] = (struct spirv_code){0};
|
||||
}
|
||||
if (rw->code[i].words)
|
||||
use_code(dev, info, rw, &code[i], i);
|
||||
}
|
||||
}
|
||||
|
||||
static bool single_source(VkBlendFactor *factor)
|
||||
{
|
||||
switch (*factor) {
|
||||
case VK_BLEND_FACTOR_SRC1_COLOR:
|
||||
case VK_BLEND_FACTOR_SRC1_ALPHA:
|
||||
*factor = VK_BLEND_FACTOR_SRC_ALPHA;
|
||||
return true;
|
||||
case VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR:
|
||||
case VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA:
|
||||
*factor = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA;
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static bool single_source_equation(VkBlendFactor *src_color, VkBlendFactor *dst_color, VkBlendFactor *src_alpha,
|
||||
VkBlendFactor *dst_alpha)
|
||||
{
|
||||
bool changed = single_source(src_color);
|
||||
changed |= single_source(dst_color);
|
||||
changed |= single_source(src_alpha);
|
||||
changed |= single_source(dst_alpha);
|
||||
return changed;
|
||||
}
|
||||
|
||||
static void rewrite_blend(const VkGraphicsPipelineCreateInfo *info, struct pipeline_rewrite *rw)
|
||||
{
|
||||
const VkPipelineColorBlendStateCreateInfo *blend = info->pColorBlendState;
|
||||
if (!blend || !blend->pAttachments || !blend->attachmentCount)
|
||||
return;
|
||||
rw->attachments = malloc(blend->attachmentCount * sizeof(*rw->attachments));
|
||||
memcpy(rw->attachments, blend->pAttachments, blend->attachmentCount * sizeof(*rw->attachments));
|
||||
bool changed = false;
|
||||
for (uint32_t i = 0; i < blend->attachmentCount; i++) {
|
||||
VkPipelineColorBlendAttachmentState *a = &rw->attachments[i];
|
||||
changed |= single_source_equation(&a->srcColorBlendFactor, &a->dstColorBlendFactor, &a->srcAlphaBlendFactor,
|
||||
&a->dstAlphaBlendFactor);
|
||||
}
|
||||
if (!changed) {
|
||||
free(rw->attachments);
|
||||
rw->attachments = NULL;
|
||||
return;
|
||||
}
|
||||
rw->blend = *blend;
|
||||
rw->blend.pAttachments = rw->attachments;
|
||||
}
|
||||
|
||||
static void rewrite_pipeline(struct device *dev, VkGraphicsPipelineCreateInfo *info, struct pipeline_rewrite *rw)
|
||||
{
|
||||
if ((dev->emulated & GAP_FILL_MODE) && info->pRasterizationState &&
|
||||
@@ -241,7 +324,12 @@ static void rewrite_pipeline(struct device *dev, VkGraphicsPipelineCreateInfo *i
|
||||
rw->viewport.scissorCount = 1;
|
||||
info->pViewportState = &rw->viewport;
|
||||
}
|
||||
if (dev->emulated & GAPS_SHADER)
|
||||
if (dev->emulated & GAP_DUAL_SRC_BLEND) {
|
||||
rewrite_blend(info, rw);
|
||||
if (rw->attachments)
|
||||
info->pColorBlendState = &rw->blend;
|
||||
}
|
||||
if (dev->emulated & (GAPS_SHADER | GAP_DUAL_SRC_BLEND))
|
||||
rewrite_shaders(dev, info, rw);
|
||||
}
|
||||
|
||||
@@ -257,7 +345,9 @@ static void undo_rewrite(struct device *dev, struct pipeline_rewrite *rw)
|
||||
if (rw->temporary[i] != VK_NULL_HANDLE)
|
||||
dev->DestroyShaderModule(dev->handle, rw->temporary[i], NULL);
|
||||
free(rw->code[i].words);
|
||||
free(rw->single[i].words);
|
||||
}
|
||||
free(rw->attachments);
|
||||
}
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL CreateGraphicsPipelines(VkDevice device, VkPipelineCache cache, uint32_t count,
|
||||
@@ -306,3 +396,15 @@ VKAPI_ATTR void VKAPI_CALL CmdSetScissorWithCount(VkCommandBuffer cmd, uint32_t
|
||||
struct device *dev = device_from_handle(cmd);
|
||||
dev->CmdSetScissorWithCount(cmd, count > 1 ? 1 : count, scissors);
|
||||
}
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL CmdSetColorBlendEquationEXT(VkCommandBuffer cmd, uint32_t first, uint32_t count,
|
||||
const VkColorBlendEquationEXT *equations)
|
||||
{
|
||||
struct device *dev = device_from_handle(cmd);
|
||||
for (uint32_t i = 0; i < count; i++) {
|
||||
VkColorBlendEquationEXT equation = equations[i];
|
||||
single_source_equation(&equation.srcColorBlendFactor, &equation.dstColorBlendFactor,
|
||||
&equation.srcAlphaBlendFactor, &equation.dstAlphaBlendFactor);
|
||||
dev->CmdSetColorBlendEquationEXT(cmd, first + i, 1, &equation);
|
||||
}
|
||||
}
|
||||
@@ -416,19 +416,19 @@ static void add_to_interface(struct module *m, uint32_t id)
|
||||
}
|
||||
|
||||
/* A standalone distance variable becomes Private, and its decorations go. */
|
||||
static void privatize(struct module *m, const struct distance_var *var)
|
||||
static void privatize(struct module *m, uint32_t id)
|
||||
{
|
||||
size_t d = definition(m, var->id);
|
||||
size_t d = definition(m, id);
|
||||
uint32_t storage, pointee;
|
||||
pointer_parts(m, m->w[d + 1], &storage, &pointee);
|
||||
m->w[d + 1] = pointer_type(m, SpvStorageClassPrivate, pointee);
|
||||
m->w[d + 3] = SpvStorageClassPrivate;
|
||||
mark_private(m, var->id);
|
||||
mark_private(m, id);
|
||||
/* Before SPIR-V 1.4 an entry point lists only its inputs and outputs. */
|
||||
if (m->version < VERSION_1_4)
|
||||
m->interface_remove[var->id] = 1;
|
||||
m->interface_remove[id] = 1;
|
||||
for (size_t i = 5; i < m->first_declaration; i += LENGTH(m->w[i])) {
|
||||
if (OPCODE(m->w[i]) == SpvOpDecorate && m->w[i + 1] == var->id)
|
||||
if (OPCODE(m->w[i]) == SpvOpDecorate && m->w[i + 1] == id)
|
||||
edit(m, i, INSTEAD);
|
||||
}
|
||||
}
|
||||
@@ -667,7 +667,7 @@ static void strip(struct module *m, const struct analysis *a, uint32_t keep)
|
||||
{
|
||||
for (uint32_t i = 0; i < a->var_count; i++) {
|
||||
if (a->vars[i].id != keep)
|
||||
privatize(m, &a->vars[i]);
|
||||
privatize(m, a->vars[i].id);
|
||||
}
|
||||
struct stand_in stand_ins[16];
|
||||
uint32_t count = make_stand_ins(m, a, stand_ins, 16);
|
||||
@@ -688,6 +688,50 @@ bool spirv_strip_distances(const uint32_t *words, size_t count, struct spirv_cod
|
||||
return done;
|
||||
}
|
||||
|
||||
static bool is_second_source(const uint32_t *w)
|
||||
{
|
||||
return OPCODE(w[0]) == SpvOpDecorate && LENGTH(w[0]) == 4 && w[2] == SpvDecorationIndex && w[3] == 1;
|
||||
}
|
||||
|
||||
bool spirv_uses_dual_source(const uint32_t *words, size_t count)
|
||||
{
|
||||
if (count <= 5 || words[0] != SpvMagicNumber)
|
||||
return false;
|
||||
for (size_t i = 5; i < count && LENGTH(words[i]) && i + LENGTH(words[i]) <= count; i += LENGTH(words[i])) {
|
||||
if (is_declaration(OPCODE(words[i])))
|
||||
break;
|
||||
if (is_second_source(&words[i]))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool spirv_strip_dual_source(const uint32_t *words, size_t count, struct spirv_code *out)
|
||||
{
|
||||
struct module m;
|
||||
if (!load(&m, words, count))
|
||||
return false;
|
||||
uint32_t outputs[8];
|
||||
uint32_t output_count = 0;
|
||||
for (size_t i = 5; i < m.first_declaration; i += LENGTH(m.w[i])) {
|
||||
if (!is_second_source(&m.w[i]))
|
||||
continue;
|
||||
size_t d = definition(&m, m.w[i + 1]);
|
||||
uint32_t storage, pointee;
|
||||
if (output_count == 8 || !d || OPCODE(m.w[d]) != SpvOpVariable ||
|
||||
!pointer_parts(&m, m.w[d + 1], &storage, &pointee) || storage != SpvStorageClassOutput)
|
||||
m.failed = true;
|
||||
else
|
||||
outputs[output_count++] = m.w[i + 1];
|
||||
}
|
||||
for (uint32_t i = 0; i < output_count && !m.failed; i++)
|
||||
privatize(&m, outputs[i]);
|
||||
retarget_accesses(&m, NULL, 0);
|
||||
bool done = finish(&m, out);
|
||||
unload(&m);
|
||||
return done;
|
||||
}
|
||||
|
||||
static const struct distance_var *clip_output(const struct module *m, const struct analysis *a, uint32_t *length)
|
||||
{
|
||||
for (uint32_t i = 0; i < a->var_count; i++) {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
VENUS_REPO=The412Banner/droiddeck-nonadreno-drivers
|
||||
VENUS_TAG=venus-proto13-e24ed8ab
|
||||
VENUS_SHA256=25f236bbc32c8490fc61c20a6016b0bea4a8c3267a69de6b91496da2afe6bc04
|
||||
VENUS_REPO=Droid-Deck/DroidDeck-Components
|
||||
VENUS_TAG=venus-dualsrc-463ba9ef
|
||||
VENUS_SHA256=ace6f4c3e62db0c7487859d8cebdcdd83656272951f84c00471fafc364ae30af
|
||||
Reference in new issue
Block a user