From 8af3624651345e68ab833dcf98ca00da5a6afd4e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg=20Kristensen?= Date: Fri, 4 Sep 2015 11:46:43 -0700 Subject: [PATCH] vk: Further reduce diff to master MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Now that we don't compile GLSL, we can roll back a few more hacks and unexport some things from the backend compiler. Signed-off-by: Kristian Høgsberg Kristensen --- src/mesa/drivers/dri/i965/brw_context.c | 5 ++--- src/mesa/drivers/dri/i965/brw_context.h | 3 --- src/mesa/drivers/dri/i965/intel_extensions.c | 20 ++++++-------------- src/vulkan/anv_compiler.cpp | 10 +--------- 4 files changed, 9 insertions(+), 29 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 020df05b2a8..907b2a07353 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -311,7 +311,7 @@ brw_init_driver_functions(struct brw_context *brw, functions->GetSamplePosition = gen6_get_sample_position; } -void +static void brw_initialize_context_constants(struct brw_context *brw) { struct gl_context *ctx = &brw->ctx; @@ -390,8 +390,7 @@ brw_initialize_context_constants(struct brw_context *brw) int max_samples; const int *msaa_modes = intel_supported_msaa_modes(brw->intelScreen); const int clamp_max_samples = - brw->optionCache.info != NULL ? - driQueryOptioni(&brw->optionCache, "clamp_max_samples") : -1; + driQueryOptioni(&brw->optionCache, "clamp_max_samples"); if (clamp_max_samples < 0) { max_samples = msaa_modes[0]; diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index 54813c51d50..49ff428b13a 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -2075,9 +2075,6 @@ gen6_upload_push_constants(struct brw_context *brw, struct brw_stage_state *stage_state, enum aub_state_struct_type type); -void -brw_initialize_context_constants(struct brw_context *brw); - bool gen9_use_linear_1d_layout(const struct brw_context *brw, const struct intel_mipmap_tree *mt); diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c index 1a246d3ea3a..4365b719801 100644 --- a/src/mesa/drivers/dri/i965/intel_extensions.c +++ b/src/mesa/drivers/dri/i965/intel_extensions.c @@ -275,17 +275,14 @@ intelInitExtensions(struct gl_context *ctx) ctx->Extensions.EXT_shader_integer_mix = ctx->Const.GLSLVersion >= 130; ctx->Extensions.EXT_timer_query = true; - if (brw->bufmgr) { - if (brw->gen == 5 || can_write_oacontrol(brw)) { - ctx->Extensions.AMD_performance_monitor = true; - ctx->Extensions.INTEL_performance_query = true; - } + if (brw->gen == 5 || can_write_oacontrol(brw)) { + ctx->Extensions.AMD_performance_monitor = true; + ctx->Extensions.INTEL_performance_query = true; } } if (brw->gen >= 6) { ctx->Extensions.ARB_blend_func_extended = - brw->optionCache.info == NULL || !driQueryOptionb(&brw->optionCache, "disable_blend_func_extended"); ctx->Extensions.ARB_conditional_render_inverted = true; ctx->Extensions.ARB_draw_buffers_blend = true; @@ -308,9 +305,7 @@ intelInitExtensions(struct gl_context *ctx) ctx->Extensions.EXT_transform_feedback = true; ctx->Extensions.OES_depth_texture_cube_map = true; - /* Test if the kernel has the ioctl. */ - if (brw->intelScreen->hw_has_timestamp) - ctx->Extensions.ARB_timer_query = true; + ctx->Extensions.ARB_timer_query = brw->intelScreen->hw_has_timestamp; /* Only enable this in core profile because other parts of Mesa behave * slightly differently when the extension is enabled. @@ -335,8 +330,7 @@ intelInitExtensions(struct gl_context *ctx) ctx->Extensions.ARB_texture_compression_bptc = true; ctx->Extensions.ARB_texture_view = true; - if (brw->bufmgr && - can_do_pipelined_register_writes(brw)) { + if (can_do_pipelined_register_writes(brw)) { ctx->Extensions.ARB_draw_indirect = true; ctx->Extensions.ARB_transform_feedback2 = true; ctx->Extensions.ARB_transform_feedback3 = true; @@ -365,9 +359,7 @@ intelInitExtensions(struct gl_context *ctx) if (ctx->API != API_OPENGL_CORE) ctx->Extensions.ARB_color_buffer_float = true; - if (ctx->Mesa_DXTn || - (brw->optionCache.info != NULL && - driQueryOptionb(&brw->optionCache, "force_s3tc_enable"))) + if (ctx->Mesa_DXTn || driQueryOptionb(&brw->optionCache, "force_s3tc_enable")) ctx->Extensions.EXT_texture_compression_s3tc = true; ctx->Extensions.ANGLE_texture_compression_dxt = true; diff --git a/src/vulkan/anv_compiler.cpp b/src/vulkan/anv_compiler.cpp index ab6d64897a5..5f189c7ce8e 100644 --- a/src/vulkan/anv_compiler.cpp +++ b/src/vulkan/anv_compiler.cpp @@ -676,8 +676,6 @@ anv_compiler_create(struct anv_device *device) compiler->device = device; - compiler->brw->optionCache.info = NULL; - compiler->brw->bufmgr = NULL; compiler->brw->gen = devinfo->gen; compiler->brw->is_g4x = devinfo->is_g4x; compiler->brw->is_baytrail = devinfo->is_baytrail; @@ -709,15 +707,9 @@ anv_compiler_create(struct anv_device *device) ctx = &compiler->brw->ctx; _mesa_init_shader_object_functions(&ctx->Driver); - _mesa_init_constants(&ctx->Const, API_OPENGL_CORE); - - /* Set dd::NewShader */ - brwInitFragProgFuncs(&ctx->Driver); - + /* brw_select_clip_planes() needs this for bogus reasons. */ ctx->_Shader = &compiler->pipeline; - compiler->brw->precompile = false; - return compiler; fail: -- 2.30.2