Commit 0fe54733 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Don't force _FRAGMENT with samplers/textures

parent 66b5e696
......@@ -841,7 +841,7 @@ trans_emit_for_draw(struct panfrost_context *ctx)
for (int t = 0; t <= PIPE_SHADER_FRAGMENT; ++t) {
for (int i = 0; i < ctx->sampler_count[t]; ++i) {
mali_ptr ptr = panfrost_upload(&ctx->cmdstream, &ctx->samplers[PIPE_SHADER_FRAGMENT][i]->hw, sizeof(struct mali_sampler_descriptor), true);
mali_ptr ptr = panfrost_upload(&ctx->cmdstream, &ctx->samplers[t][i]->hw, sizeof(struct mali_sampler_descriptor), true);
if (!samplers_base)
samplers_base = ptr;
......@@ -866,15 +866,15 @@ trans_emit_for_draw(struct panfrost_context *ctx)
for (int i = 0; i < ctx->sampler_view_count[t]; ++i) {
/* Upload the bitmap itself. TODO: Should be swizzled */
struct pipe_resource *tex_rsrc = ctx->sampler_views[PIPE_SHADER_FRAGMENT][i]->base.texture;
struct pipe_resource *tex_rsrc = ctx->sampler_views[t][i]->base.texture;
struct panfrost_resource *rsrc = (struct panfrost_resource *) tex_rsrc;
mali_ptr bitmap = panfrost_upload(&ctx->cmdstream, (uint8_t *) rsrc->cpu, rsrc->len, false);
/* Inject the address in. XXX: Should be its own dirty flag or something... */
ctx->sampler_views[PIPE_SHADER_FRAGMENT][i]->hw.swizzled_bitmap_0 = bitmap;
ctx->sampler_views[PIPE_SHADER_FRAGMENT][i]->hw.swizzled_bitmap_1 = bitmap;
ctx->sampler_views[t][i]->hw.swizzled_bitmap_0 = bitmap;
ctx->sampler_views[t][i]->hw.swizzled_bitmap_1 = bitmap;
trampolines[i] = panfrost_upload(&ctx->cmdstream, &ctx->sampler_views[PIPE_SHADER_FRAGMENT][0]->hw, sizeof(struct mali_texture_descriptor), false);
trampolines[i] = panfrost_upload(&ctx->cmdstream, &ctx->sampler_views[t][0]->hw, sizeof(struct mali_texture_descriptor), false);
}
mali_ptr trampoline = panfrost_upload(&ctx->cmdstream, trampolines, sizeof(uint64_t) * ctx->sampler_view_count[t], false);
......
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