freedreno+ir3: Move storage_16bit to compiler options

This isn't a thing in gl.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21152>
This commit is contained in:
Rob Clark 2023-02-06 14:33:04 -08:00 committed by Marge Bot
parent 79caf8a44b
commit 284547af55
5 changed files with 7 additions and 5 deletions

View file

@ -196,8 +196,6 @@ ir3_compiler_create(struct fd_device *dev, const struct fd_dev_id *dev_id,
compiler->tess_use_shared = dev_info->a6xx.tess_use_shared;
compiler->storage_16bit = dev_info->a6xx.storage_16bit;
compiler->has_getfiberid = dev_info->a6xx.has_getfiberid;
compiler->has_dp2acc = dev_info->a6xx.has_dp2acc;

View file

@ -61,6 +61,9 @@ struct ir3_compiler_options {
*/
int bindless_fb_read_descriptor;
int bindless_fb_read_slot;
/* True if 16-bit descriptors are used for both 16-bit and 32-bit access. */
bool storage_16bit;
};
struct ir3_compiler {

View file

@ -602,7 +602,7 @@ ir3_nir_post_finalize(struct ir3_shader *shader)
* dwords.
*/
if (compiler->gen >= 6)
OPT_V(s, ir3_nir_lower_ssbo_size, compiler->storage_16bit ? 1 : 2);
OPT_V(s, ir3_nir_lower_ssbo_size, compiler->options.storage_16bit ? 1 : 2);
ir3_optimize_loop(compiler, s);
}

View file

@ -2085,6 +2085,8 @@ tu_CreateDevice(VkPhysicalDevice physicalDevice,
.disable_cache = true,
.bindless_fb_read_descriptor = -1,
.bindless_fb_read_slot = -1,
.storage_16bit =
physical_device->info->a6xx.storage_16bit
});
if (!device->compiler) {
result = vk_startup_errorf(physical_device->instance,

View file

@ -55,8 +55,7 @@ fd6_ssbo_descriptor(struct fd_context *ctx,
{
fdl6_buffer_view_init(
descriptor,
ctx->screen->info->a6xx.storage_16bit ? PIPE_FORMAT_R16_UINT
: PIPE_FORMAT_R32_UINT,
PIPE_FORMAT_R32_UINT,
swiz_identity, rsc_iova(buf->buffer, buf->buffer_offset),
buf->buffer_size);
}