ctx->gfx_stages);
if (!entry) {
struct zink_gfx_program *prog;
- prog = zink_create_gfx_program(zink_screen(ctx->base.screen)->dev,
+ prog = zink_create_gfx_program(zink_screen(ctx->base.screen),
ctx->gfx_stages);
entry = _mesa_hash_table_insert(ctx->program_cache, prog->stages, prog);
if (!entry)
if (!gfx_program)
return;
- VkPipeline pipeline = zink_get_gfx_pipeline(screen->dev, gfx_program,
+ VkPipeline pipeline = zink_get_gfx_pipeline(screen, gfx_program,
&ctx->gfx_pipeline_state,
dinfo->mode);
}
struct zink_gfx_program *
-zink_create_gfx_program(VkDevice dev,
+zink_create_gfx_program(struct zink_screen *screen,
struct zink_shader *stages[PIPE_SHADER_TYPES - 1])
{
struct zink_gfx_program *prog = CALLOC_STRUCT(zink_gfx_program);
for (int i = 0; i < PIPE_SHADER_TYPES - 1; ++i)
prog->stages[i] = stages[i];
- prog->dsl = create_desc_set_layout(dev, stages);
+ prog->dsl = create_desc_set_layout(screen->dev, stages);
if (!prog->dsl)
goto fail;
- prog->layout = create_pipeline_layout(dev, prog->dsl);
+ prog->layout = create_pipeline_layout(screen->dev, prog->dsl);
if (!prog->layout)
goto fail;
fail:
if (prog)
- zink_destroy_gfx_program(dev, prog);
+ zink_destroy_gfx_program(screen, prog);
return NULL;
}
void
-zink_destroy_gfx_program(VkDevice dev, struct zink_gfx_program *prog)
+zink_destroy_gfx_program(struct zink_screen *screen,
+ struct zink_gfx_program *prog)
{
if (prog->layout)
- vkDestroyPipelineLayout(dev, prog->layout, NULL);
+ vkDestroyPipelineLayout(screen->dev, prog->layout, NULL);
if (prog->dsl)
- vkDestroyDescriptorSetLayout(dev, prog->dsl, NULL);
+ vkDestroyDescriptorSetLayout(screen->dev, prog->dsl, NULL);
FREE(prog);
}
}
VkPipeline
-zink_get_gfx_pipeline(VkDevice dev, struct zink_gfx_program *prog,
+zink_get_gfx_pipeline(struct zink_screen *screen,
+ struct zink_gfx_program *prog,
struct zink_gfx_pipeline_state *state,
enum pipe_prim_type mode)
{
struct hash_entry *entry = _mesa_hash_table_search(prog->pipelines[mode], state);
if (!entry) {
VkPrimitiveTopology vkmode = primitive_topology(mode);
- VkPipeline pipeline = zink_create_gfx_pipeline(dev, prog, state, vkmode);
+ VkPipeline pipeline = zink_create_gfx_pipeline(screen->dev, prog,
+ state, vkmode);
if (pipeline == VK_NULL_HANDLE)
return VK_NULL_HANDLE;
#include "pipe/p_state.h"
-struct zink_context;
+struct zink_screen;
struct zink_shader;
struct zink_gfx_pipeline_state;
};
struct zink_gfx_program *
-zink_create_gfx_program(VkDevice dev,
+zink_create_gfx_program(struct zink_screen *screen,
struct zink_shader *stages[PIPE_SHADER_TYPES - 1]);
void
-zink_destroy_gfx_program(VkDevice dev, struct zink_gfx_program *);
+zink_destroy_gfx_program(struct zink_screen *screen,
+ struct zink_gfx_program *prog);
VkPipeline
-zink_get_gfx_pipeline(VkDevice dev, struct zink_gfx_program *prog,
+zink_get_gfx_pipeline(struct zink_screen *screen,
+ struct zink_gfx_program *prog,
struct zink_gfx_pipeline_state *state,
enum pipe_prim_type mode);