File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1501,7 +1501,6 @@ void VulkanDrawManager::drawSphere(material* material_def)
15011501} // namespace vulkan
15021502} // namespace graphics
15031503
1504- extern float VK_alpha_threshold;
15051504
15061505// PostProcessing_override is defined in globalincs/systemvars.cpp
15071506extern bool PostProcessing_override;
@@ -1555,7 +1554,7 @@ void vulkan_set_default_material_uniforms(material* material_info)
15551554 }
15561555
15571556 // Alpha threshold
1558- data->alphaThreshold = VK_alpha_threshold ;
1557+ data->alphaThreshold = getStateTracker ()-> getAlphaThreshold () ;
15591558
15601559 // Color from material
15611560 vec4 clr = material_info->get_color ();
Original file line number Diff line number Diff line change @@ -290,8 +290,6 @@ void VulkanStateTracker::applyDynamicState()
290290} // namespace vulkan
291291} // namespace graphics
292292
293- float VK_alpha_threshold = 0 .0f ;
294-
295293namespace graphics {
296294namespace vulkan {
297295
@@ -318,9 +316,9 @@ void vulkan_zbias(int bias)
318316int vulkan_alpha_mask_set (int mode, float alpha)
319317{
320318 if (mode) {
321- VK_alpha_threshold = alpha;
319+ getStateTracker ()-> setAlphaThreshold ( alpha) ;
322320 } else {
323- VK_alpha_threshold = 0 .0f ;
321+ getStateTracker ()-> setAlphaThreshold ( 0 .0f ) ;
324322 }
325323 return mode;
326324}
Original file line number Diff line number Diff line change @@ -176,6 +176,9 @@ class VulkanStateTracker {
176176 void setCullMode (bool enabled) { m_cullEnabled = enabled; }
177177 bool getCullMode () const { return m_cullEnabled; }
178178
179+ void setAlphaThreshold (float threshold) { m_alphaThreshold = threshold; }
180+ float getAlphaThreshold () const { return m_alphaThreshold; }
181+
179182 /* *
180183 * @brief Set color attachment count for current render pass
181184 */
@@ -237,6 +240,7 @@ class VulkanStateTracker {
237240 gr_zbuffer_type m_zbufferMode = ZBUFFER_TYPE_NONE ;
238241 int m_stencilMode = 0 ;
239242 bool m_cullEnabled = true ;
243+ float m_alphaThreshold = 0 .0f ;
240244 uint32_t m_colorAttachmentCount = 1 ;
241245 vk::SampleCountFlagBits m_currentSampleCount = vk::SampleCountFlagBits::e1 ;
242246
You can’t perform that action at this time.
0 commit comments