diff options
author | Jason Ekstrand <jason.ekstrand@intel.com> | 2015-12-02 16:09:02 -0800 |
---|---|---|
committer | Jason Ekstrand <jason.ekstrand@intel.com> | 2015-12-02 16:09:02 -0800 |
commit | 3079246d7e632180a82d9320724cacf3f8841e47 (patch) | |
tree | d61595b6f5b426d6d2893d8d7acec9bf1aa8455c | |
parent | fb6b9b422e7a40dc00f453bf6af32f0b478a10d0 (diff) |
vk/0.210.0: Remove the VkShaderStage enum
-rw-r--r-- | include/qonos/qonos.h | 2 | ||||
-rw-r--r-- | misc/glsl_scraper.py | 2 | ||||
-rw-r--r-- | src/qonos/qonos_pipeline.c | 16 | ||||
-rw-r--r-- | src/tests/func/compute.c | 2 | ||||
-rw-r--r-- | src/tests/stress/lots-of-surface-state.c | 8 |
5 files changed, 16 insertions, 14 deletions
diff --git a/include/qonos/qonos.h b/include/qonos/qonos.h index efbd7f8..652748b 100644 --- a/include/qonos/qonos.h +++ b/include/qonos/qonos.h @@ -109,7 +109,7 @@ typedef struct QoShaderModuleCreateInfo_ { const void *pSpirv; size_t glslSize; const char *pGlsl; - VkShaderStage stage; + VkShaderStageFlagBits stage; } QoShaderModuleCreateInfo; #define QO_EXTRA_GRAPHICS_PIPELINE_CREATE_INFO_DEFAULTS \ diff --git a/misc/glsl_scraper.py b/misc/glsl_scraper.py index ed5439f..4534555 100644 --- a/misc/glsl_scraper.py +++ b/misc/glsl_scraper.py @@ -126,7 +126,7 @@ class Shader: .pSpirv = {0}_spir_v_src, """.format(var_prefix))) - f.write(" .stage = VK_SHADER_STAGE_{0},\n".format(self.stage)) + f.write(" .stage = VK_SHADER_STAGE_{0}_BIT,\n".format(self.stage)) f.write('};') diff --git a/src/qonos/qonos_pipeline.c b/src/qonos/qonos_pipeline.c index b7f6d46..498eec8 100644 --- a/src/qonos/qonos_pipeline.c +++ b/src/qonos/qonos_pipeline.c @@ -28,6 +28,8 @@ #include "tapi/t_data.h" #include "tapi/t_result.h" +#define NUM_SHADER_STAGES 6 + VkPipeline qoCreateGraphicsPipeline(VkDevice device, VkPipelineCache pipeline_cache, @@ -42,7 +44,7 @@ qoCreateGraphicsPipeline(VkDevice device, VkPipelineMultisampleStateCreateInfo ms_info; VkPipelineDepthStencilStateCreateInfo ds_info; VkPipelineColorBlendStateCreateInfo cb_info; - VkPipelineShaderStageCreateInfo stage_info[VK_SHADER_STAGE_NUM]; + VkPipelineShaderStageCreateInfo stage_info[NUM_SHADER_STAGES]; VkDynamicState dynamic_states[VK_DYNAMIC_STATE_RANGE_SIZE]; VkPipelineDynamicStateCreateInfo dy_info; VkPipeline pipeline; @@ -140,10 +142,10 @@ qoCreateGraphicsPipeline(VkDevice device, bool has_fs = false, has_vs = false; for (unsigned i = 0; i < pipeline_info.stageCount; i++) { switch (pipeline_info.pStages[i].stage) { - case VK_SHADER_STAGE_VERTEX: + case VK_SHADER_STAGE_VERTEX_BIT: has_vs = true; break; - case VK_SHADER_STAGE_FRAGMENT: + case VK_SHADER_STAGE_FRAGMENT_BIT: has_fs = true; break; default: @@ -191,7 +193,7 @@ qoCreateGraphicsPipeline(VkDevice device, if (!has_vs || !has_fs || extra->geometryShader != VK_NULL_HANDLE) { /* Make a copy of the shader stages so that we can modify it */ - assert(pipeline_info.stageCount < VK_SHADER_STAGE_NUM); + assert(pipeline_info.stageCount < NUM_SHADER_STAGES); memcpy(stage_info, pipeline_info.pStages, pipeline_info.stageCount * sizeof(*pipeline_info.pStages)); pipeline_info.pStages = stage_info; @@ -216,7 +218,7 @@ qoCreateGraphicsPipeline(VkDevice device, stage_info[pipeline_info.stageCount++] = (VkPipelineShaderStageCreateInfo) { .sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, - .stage = VK_SHADER_STAGE_VERTEX, + .stage = VK_SHADER_STAGE_VERTEX_BIT, .module = vs, .pName = "main", .pSpecializationInfo = NULL, @@ -229,7 +231,7 @@ qoCreateGraphicsPipeline(VkDevice device, stage_info[pipeline_info.stageCount++] = (VkPipelineShaderStageCreateInfo) { .sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, - .stage = VK_SHADER_STAGE_GEOMETRY, + .stage = VK_SHADER_STAGE_GEOMETRY_BIT, .module = extra->geometryShader, .pName = "main", .pSpecializationInfo = NULL, @@ -253,7 +255,7 @@ qoCreateGraphicsPipeline(VkDevice device, stage_info[pipeline_info.stageCount++] = (VkPipelineShaderStageCreateInfo) { .sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, - .stage = VK_SHADER_STAGE_FRAGMENT, + .stage = VK_SHADER_STAGE_FRAGMENT_BIT, .module = fs, .pName = "main", .pSpecializationInfo = NULL, diff --git a/src/tests/func/compute.c b/src/tests/func/compute.c index 698e88b..60a5627 100644 --- a/src/tests/func/compute.c +++ b/src/tests/func/compute.c @@ -67,7 +67,7 @@ test(void) .sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO, .pNext = NULL, .stage = { - .stage = VK_SHADER_STAGE_COMPUTE, + .stage = VK_SHADER_STAGE_COMPUTE_BIT, .module = cs, .pName = "main", }, diff --git a/src/tests/stress/lots-of-surface-state.c b/src/tests/stress/lots-of-surface-state.c index 902ba00..a0e4b37 100644 --- a/src/tests/stress/lots-of-surface-state.c +++ b/src/tests/stress/lots-of-surface-state.c @@ -34,7 +34,7 @@ static void test_lots_of_surface_state(VkShaderModule vs, VkShaderModule fs, - VkShaderStage ubo_stage, + VkShaderStageFlagBits ubo_stage, bool use_dynamic_offsets) { VkRenderPass pass = qoCreateRenderPass(t_device, @@ -70,7 +70,7 @@ test_lots_of_surface_state(VkShaderModule vs, VkShaderModule fs, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC: VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, .descriptorCount = 12, - .stageFlags = (1 << ubo_stage), + .stageFlags = ubo_stage, .pImmutableSamplers = NULL, }, }); @@ -318,7 +318,7 @@ test_lots_of_surface_state_vs(bool use_dynamic_offsets) } ); - test_lots_of_surface_state(vs, fs, VK_SHADER_STAGE_VERTEX, + test_lots_of_surface_state(vs, fs, VK_SHADER_STAGE_VERTEX_BIT, use_dynamic_offsets); } @@ -370,7 +370,7 @@ test_lots_of_surface_state_fs(bool use_dynamic_offsets) } ); - test_lots_of_surface_state(vs, fs, VK_SHADER_STAGE_FRAGMENT, + test_lots_of_surface_state(vs, fs, VK_SHADER_STAGE_FRAGMENT_BIT, use_dynamic_offsets); } |